{"id":357654,"date":"2024-05-20T23:55:18","date_gmt":"2024-05-20T23:55:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=357654"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=357654","title":{"rendered":"<span>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 Midjourney \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Discord API \u2022 \u0427\u0430\u0441\u0442\u044c I<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6e4\/887\/60a\/6e488760ac6738ef1e67c867098daf54.png\" width=\"875\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e4\/887\/60a\/6e488760ac6738ef1e67c867098daf54.png\"\/><\/figure>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 Midjourney <a href=\"https:\/\/docs.midjourney.com\/docs\/quick-start#5-use-the-imagine-command\" rel=\"noopener noreferrer nofollow\">\/imagine<\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c Discord \u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 Midjourney, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u0437\u0430 $10 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u044d\u0442\u0438\u043c <a href=\"https:\/\/useapi.net\/docs\/start-here\/setup-midjourney\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0448\u0430\u0433\u0430\u043c<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>server_id<\/code><\/p>\n<\/li>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>channel_id<\/code><\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043a\u0435\u043d Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>discord_token<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 Discord API:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">Application Commands<\/a> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine Midjourney \u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 imagine \u0432 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Discord<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">Get Channel Messages<\/a>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439) \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 imagine \u0438\u0437 \u043a\u0430\u043d\u0430\u043b\u0430 Discord<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.postman.com\/useapinet\/workspace\/useapi-net\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e Postman<\/a>. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 GET \u0438 POST \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4bd\/736\/cd4\/4bd736cd4eb5a96635cac1ab9afd4e0b.png\" width=\"800\" height=\"329\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4bd\/736\/cd4\/4bd736cd4eb5a96635cac1ab9afd4e0b.png\"\/><\/figure>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f Discord API<\/h4>\n<p>\u0412\u0441\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0437\u043e\u0432\u044b Discord API \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 HTTP Authorization \u0441 <code>discord_token<\/code>, \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">Authorization: discord_token<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine Discord<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">application-commands<\/a> <code>https:\/\/discord.com\/api\/v10\/channels\/channel_id\/application-commands\/search?type=1&amp;include_applications=true&amp;query=imagine<\/code>  <\/p>\n<pre><code class=\"json\">{     \"applications\": [         {             \"id\": \"936929561302675456\",             \"name\": \"Midjourney Bot\",             \"icon\": \"f6ce562a6b4979c4b1cbc5b436d3be76\",             \"description\": \"Generate an image based on a text prompt in under 60 seconds using the &lt;\/imagine:938956540159881230> command!\\n\\nhttps:\/\/docs.midjourney.com\/docs\/terms-of-service\",             \"summary\": \"\",             \"type\": null,             \"bot\": {                 \"id\": \"936929561302675456\",                 \"username\": \"Midjourney Bot\",                 \"global_name\": null,                 \"avatar\": \"f6ce562a6b4979c4b1cbc5b436d3be76\",                 \"discriminator\": \"9282\",                 \"public_flags\": 589824,                 \"bot\": true,                 \"avatar_decoration_data\": null             }         }     ],     \"application_commands\": [         {             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         }     ],     \"cursor\": {         \"previous\": \"WzExNTE1NDQ4NzM4MjA4OTMzMDYsIDAsIDkzODk1NjU0MDE1OTg4MTIzMF0=\",         \"next\": null,         \"repaired\": false     } } <\/code><\/pre>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>application_commands[0]<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine, \u0438\u0437\u0432\u043b\u0435\u043a\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:  <\/p>\n<pre><code class=\"json\">{             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         } <\/code><\/pre>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b imagine \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Discord<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">interactions<\/a> <code>https:\/\/discord.com\/api\/v10\/interactions<\/code>.  <\/p>\n<pre><code class=\"json\">{     \"type\": 2,     \"application_id\": \"936929561302675456\",     \"guild_id\": \"server_id\",     \"channel_id\": \"channel_id\",     \"session_id\": \"$randomInt\",     \"data\": {         \"version\": \"1166847114203123795\",         \"id\": \"938956540159881230\",         \"name\": \"imagine\",         \"type\": 1,         \"options\": [             {                 \"type\": 3,                 \"name\": \"prompt\",                 \"value\": \"\u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u043a Midjourney\"             }         ],         \"application_command\": {             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         },         \"attachments\": []     } } <\/code><\/pre>\n<p>\u041f\u043e\u043b\u044f <code>application_id<\/code> \u0438 <code>application_command<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435. \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u0434\u043b\u044f Midjourney \u0432 \u043f\u043e\u043b\u0435 <code>data.options[0].value<\/code>. \u041f\u043e\u043b\u0435 <code>session_id<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/www.postman.com\/useapinet\/workspace\/useapi-net\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e Postman<\/a>, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 Postman.<\/p>\n<p>\u0421\u0442\u0430\u0442\u0443\u0441 HTTP-\u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status\/204\" rel=\"noopener noreferrer nofollow\">204 No Content<\/a>, \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/p>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b imagine<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">messages<\/a> <code>https:\/\/discord.com\/api\/v10\/channels\/channel_id\/messages<\/code><\/p>\n<p>\u041e\u0442\u0432\u0435\u0442 (\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438):<\/p>\n<pre><code class=\"json\">[     {         \"id\": \"&lt;Discord message id>\",         \"type\": 0,         \"content\": \"**\u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u043a Midjourney --s 750 --v 5.2** - &lt;@Discord user id> (fast)\",         \"channel_id\": \"&lt;Discord channel id>\",         \"attachments\": [           {               \"url\": \"&lt;generated image url>\",               \"proxy_url\": \"&lt;generated proxy image url>\",               \"width\": 2048,               \"height\": 2048,               \"content_type\": \"&lt;generated image type>\",               \"id\": \"&lt;Discord image id>\",               \"filename\": \"&lt;generated image name>\",               \"size\": 7204115           }         ],         \"components\": [             {                 \"type\": 1,                 \"components\": [                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::1::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U1\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::2::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U2\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::3::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U3\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::4::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U4\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::reroll::0::45e9bf62-5f3d-4bd6-a567-958af28f15d3::SOLO\",                         \"style\": 2,                         \"emoji\": {                             \"name\": \"?\"                         }                     }                 ]             },             {                 \"type\": 1,                 \"components\": [                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::1::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V1\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::2::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V2\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::3::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V3\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::4::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V4\"                     }                 ]             }         ],     }, ] <\/code><\/pre>\n<p>Discord API <a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">messages<\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 50 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 <code>channel_id<\/code>, \u0441 \u0441\u0430\u043c\u044b\u043c \u0441\u0432\u0435\u0436\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Midjourney \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434 (fast mode) \u0434\u043e 10 \u043c\u0438\u043d\u0443\u0442 (relax mode).<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u0442 10 \u0434\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u043c\u0435\u0436\u0434\u0443 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438, \u043f\u043e\u043a\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 <code>components<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u043c. \u0417\u0430\u0442\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u043b\u044f <code>attachments[0].url<\/code>.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 Midjourney \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 Discord <a href=\"https:\/\/discord.com\/developers\/docs\/topics\/rate-limits\" rel=\"noopener noreferrer nofollow\">rate limits<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/767878\/\"> https:\/\/habr.com\/ru\/articles\/767878\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0443 Midjourney <a href=\"https:\/\/docs.midjourney.com\/docs\/quick-start#5-use-the-imagine-command\" rel=\"noopener noreferrer nofollow\">\/imagine<\/a> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c Discord \u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u043e\u0439 \u043d\u0430 Midjourney, \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u043b\u0430\u043d \u0437\u0430 $10 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u0439\u0442\u0435 \u044d\u0442\u0438\u043c <a href=\"https:\/\/useapi.net\/docs\/start-here\/setup-midjourney\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0448\u0430\u0433\u0430\u043c<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>server_id<\/code><\/p>\n<\/li>\n<li>\n<p>\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>channel_id<\/code><\/p>\n<\/li>\n<li>\n<p>\u0422\u043e\u043a\u0435\u043d Discord, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043a\u0430\u043a <code>discord_token<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 Discord API:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">Application Commands<\/a> \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine Midjourney \u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 imagine \u0432 \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Discord<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">Get Channel Messages<\/a>\u00a0\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 (\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439) \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 imagine \u0438\u0437 \u043a\u0430\u043d\u0430\u043b\u0430 Discord<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.postman.com\/useapinet\/workspace\/useapi-net\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e Postman<\/a>. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 GET \u0438 POST \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438:  <\/p>\n<figure class=\"full-width\"><\/figure>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f Discord API<\/h4>\n<p>\u0412\u0441\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u0432\u044b\u0437\u043e\u0432\u044b Discord API \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 HTTP Authorization \u0441 <code>discord_token<\/code>, \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">Authorization: discord_token<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine Discord<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">application-commands<\/a> <code>https:\/\/discord.com\/api\/v10\/channels\/channel_id\/application-commands\/search?type=1&amp;include_applications=true&amp;query=imagine<\/code>  <\/p>\n<pre><code class=\"json\">{     \"applications\": [         {             \"id\": \"936929561302675456\",             \"name\": \"Midjourney Bot\",             \"icon\": \"f6ce562a6b4979c4b1cbc5b436d3be76\",             \"description\": \"Generate an image based on a text prompt in under 60 seconds using the &lt;\/imagine:938956540159881230> command!\\n\\nhttps:\/\/docs.midjourney.com\/docs\/terms-of-service\",             \"summary\": \"\",             \"type\": null,             \"bot\": {                 \"id\": \"936929561302675456\",                 \"username\": \"Midjourney Bot\",                 \"global_name\": null,                 \"avatar\": \"f6ce562a6b4979c4b1cbc5b436d3be76\",                 \"discriminator\": \"9282\",                 \"public_flags\": 589824,                 \"bot\": true,                 \"avatar_decoration_data\": null             }         }     ],     \"application_commands\": [         {             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         }     ],     \"cursor\": {         \"previous\": \"WzExNTE1NDQ4NzM4MjA4OTMzMDYsIDAsIDkzODk1NjU0MDE1OTg4MTIzMF0=\",         \"next\": null,         \"repaired\": false     } } <\/code><\/pre>\n<p>\u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>application_commands[0]<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e \u043a\u043e\u043c\u0430\u043d\u0434\u0435 imagine, \u0438\u0437\u0432\u043b\u0435\u043a\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0441\u0441\u044b\u043b\u043e\u043a:  <\/p>\n<pre><code class=\"json\">{             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         } <\/code><\/pre>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b imagine \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u0430\u043d\u0430\u043b\u0435 Discord<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/interactions\/application-commands\" rel=\"noopener noreferrer nofollow\">interactions<\/a> <code>https:\/\/discord.com\/api\/v10\/interactions<\/code>.  <\/p>\n<pre><code class=\"json\">{     \"type\": 2,     \"application_id\": \"936929561302675456\",     \"guild_id\": \"server_id\",     \"channel_id\": \"channel_id\",     \"session_id\": \"$randomInt\",     \"data\": {         \"version\": \"1166847114203123795\",         \"id\": \"938956540159881230\",         \"name\": \"imagine\",         \"type\": 1,         \"options\": [             {                 \"type\": 3,                 \"name\": \"prompt\",                 \"value\": \"\u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u043a Midjourney\"             }         ],         \"application_command\": {             \"id\": \"938956540159881230\",             \"application_id\": \"936929561302675456\",             \"version\": \"1166847114203123795\",             \"default_member_permissions\": null,             \"type\": 1,             \"nsfw\": false,             \"name\": \"imagine\",             \"description\": \"Create images with Midjourney\",             \"dm_permission\": true,             \"contexts\": [                 0,                 1,                 2             ],             \"integration_types\": [                 0             ],             \"options\": [                 {                     \"type\": 3,                     \"name\": \"prompt\",                     \"description\": \"The prompt to imagine\",                     \"required\": true                 }             ]         },         \"attachments\": []     } } <\/code><\/pre>\n<p>\u041f\u043e\u043b\u044f <code>application_id<\/code> \u0438 <code>application_command<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435. \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u0434\u043b\u044f Midjourney \u0432 \u043f\u043e\u043b\u0435 <code>data.options[0].value<\/code>. \u041f\u043e\u043b\u0435 <code>session_id<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u043c \u0446\u0435\u043b\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e <a href=\"https:\/\/www.postman.com\/useapinet\/workspace\/useapi-net\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e Postman<\/a>, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 Postman.<\/p>\n<p>\u0421\u0442\u0430\u0442\u0443\u0441 HTTP-\u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status\/204\" rel=\"noopener noreferrer nofollow\">204 No Content<\/a>, \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0442\u0432\u0435\u0442\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/p>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b imagine<\/h4>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 GET-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">messages<\/a> <code>https:\/\/discord.com\/api\/v10\/channels\/channel_id\/messages<\/code><\/p>\n<p>\u041e\u0442\u0432\u0435\u0442 (\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043e \u0434\u043b\u044f \u043a\u0440\u0430\u0442\u043a\u043e\u0441\u0442\u0438):<\/p>\n<pre><code class=\"json\">[     {         \"id\": \"&lt;Discord message id>\",         \"type\": 0,         \"content\": \"**\u0422\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 (prompt) \u043a Midjourney --s 750 --v 5.2** - &lt;@Discord user id> (fast)\",         \"channel_id\": \"&lt;Discord channel id>\",         \"attachments\": [           {               \"url\": \"&lt;generated image url>\",               \"proxy_url\": \"&lt;generated proxy image url>\",               \"width\": 2048,               \"height\": 2048,               \"content_type\": \"&lt;generated image type>\",               \"id\": \"&lt;Discord image id>\",               \"filename\": \"&lt;generated image name>\",               \"size\": 7204115           }         ],         \"components\": [             {                 \"type\": 1,                 \"components\": [                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::1::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U1\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::2::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U2\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::3::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U3\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::upsample::4::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"U4\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::reroll::0::45e9bf62-5f3d-4bd6-a567-958af28f15d3::SOLO\",                         \"style\": 2,                         \"emoji\": {                             \"name\": \"?\"                         }                     }                 ]             },             {                 \"type\": 1,                 \"components\": [                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::1::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V1\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::2::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V2\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::3::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V3\"                     },                     {                         \"type\": 2,                         \"custom_id\": \"MJ::JOB::variation::4::45e9bf62-5f3d-4bd6-a567-958af28f15d3\",                         \"style\": 2,                         \"label\": \"V4\"                     }                 ]             }         ],     }, ] <\/code><\/pre>\n<p>Discord API <a href=\"https:\/\/discord.com\/developers\/docs\/resources\/channel#get-channel-messages\" rel=\"noopener noreferrer nofollow\">messages<\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 50 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438\u0437 <code>channel_id<\/code>, \u0441 \u0441\u0430\u043c\u044b\u043c \u0441\u0432\u0435\u0436\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a Midjourney \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u044f\u0442\u044c \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434 (fast mode) \u0434\u043e 10 \u043c\u0438\u043d\u0443\u0442 (relax mode).<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u0442 10 \u0434\u043e 20 \u0441\u0435\u043a\u0443\u043d\u0434 \u043c\u0435\u0436\u0434\u0443 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438, \u043f\u043e\u043a\u0430 \u043c\u0430\u0441\u0441\u0438\u0432 <code>components<\/code> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0443\u0441\u0442\u044b\u043c. \u0417\u0430\u0442\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u043a\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u043b\u044f <code>attachments[0].url<\/code>.<\/p>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 Midjourney \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 Discord <a href=\"https:\/\/discord.com\/developers\/docs\/topics\/rate-limits\" rel=\"noopener noreferrer nofollow\">rate limits<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-357654","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=357654"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/357654\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=357654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=357654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=357654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}