@scopieflows/app-discord 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/package.json +29 -0
- package/src/i18n/ca.json +101 -0
- package/src/i18n/de.json +108 -0
- package/src/i18n/es.json +108 -0
- package/src/i18n/fr.json +108 -0
- package/src/i18n/hi.json +101 -0
- package/src/i18n/id.json +101 -0
- package/src/i18n/ja.json +108 -0
- package/src/i18n/nl.json +108 -0
- package/src/i18n/pt.json +108 -0
- package/src/i18n/ru.json +101 -0
- package/src/i18n/translation.json +108 -0
- package/src/i18n/vi.json +101 -0
- package/src/i18n/zh.json +108 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +87 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-role-to-member.d.ts +5 -0
- package/src/lib/actions/add-role-to-member.js +40 -0
- package/src/lib/actions/add-role-to-member.js.map +1 -0
- package/src/lib/actions/ban-a-guild-member.d.ts +5 -0
- package/src/lib/actions/ban-a-guild-member.js +48 -0
- package/src/lib/actions/ban-a-guild-member.js.map +1 -0
- package/src/lib/actions/create-channel.d.ts +4 -0
- package/src/lib/actions/create-channel.js +46 -0
- package/src/lib/actions/create-channel.js.map +1 -0
- package/src/lib/actions/create-guild-role.d.ts +8 -0
- package/src/lib/actions/create-guild-role.js +70 -0
- package/src/lib/actions/create-guild-role.js.map +1 -0
- package/src/lib/actions/delete-channel.d.ts +3 -0
- package/src/lib/actions/delete-channel.js +32 -0
- package/src/lib/actions/delete-channel.js.map +1 -0
- package/src/lib/actions/delete-guild-role.d.ts +5 -0
- package/src/lib/actions/delete-guild-role.js +41 -0
- package/src/lib/actions/delete-guild-role.js.map +1 -0
- package/src/lib/actions/find-channel.d.ts +4 -0
- package/src/lib/actions/find-channel.js +41 -0
- package/src/lib/actions/find-channel.js.map +1 -0
- package/src/lib/actions/find-guild-member.d.ts +4 -0
- package/src/lib/actions/find-guild-member.js +52 -0
- package/src/lib/actions/find-guild-member.js.map +1 -0
- package/src/lib/actions/remove-ban-from-user.d.ts +5 -0
- package/src/lib/actions/remove-ban-from-user.js +48 -0
- package/src/lib/actions/remove-ban-from-user.js.map +1 -0
- package/src/lib/actions/remove-member-from-guild.d.ts +4 -0
- package/src/lib/actions/remove-member-from-guild.js +39 -0
- package/src/lib/actions/remove-member-from-guild.js.map +1 -0
- package/src/lib/actions/remove-role-from-member.d.ts +5 -0
- package/src/lib/actions/remove-role-from-member.js +40 -0
- package/src/lib/actions/remove-role-from-member.js.map +1 -0
- package/src/lib/actions/rename-channel.d.ts +4 -0
- package/src/lib/actions/rename-channel.js +42 -0
- package/src/lib/actions/rename-channel.js.map +1 -0
- package/src/lib/actions/send-approval-message.d.ts +4 -0
- package/src/lib/actions/send-approval-message.js +79 -0
- package/src/lib/actions/send-approval-message.js.map +1 -0
- package/src/lib/actions/send-message-webhook.d.ts +8 -0
- package/src/lib/actions/send-message-webhook.js +59 -0
- package/src/lib/actions/send-message-webhook.js.map +1 -0
- package/src/lib/actions/send-message-with-bot.d.ts +5 -0
- package/src/lib/actions/send-message-with-bot.js +63 -0
- package/src/lib/actions/send-message-with-bot.js.map +1 -0
- package/src/lib/common/index.d.ts +11 -0
- package/src/lib/common/index.js +147 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/common/models.d.ts +39 -0
- package/src/lib/common/models.js +3 -0
- package/src/lib/common/models.js.map +1 -0
- package/src/lib/triggers/new-member.d.ts +14 -0
- package/src/lib/triggers/new-member.js +96 -0
- package/src/lib/triggers/new-member.js.map +1 -0
- package/src/lib/triggers/new-message.d.ts +14 -0
- package/src/lib/triggers/new-message.js +96 -0
- package/src/lib/triggers/new-message.js.map +1 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Instant messaging and VoIP social platform": "Instant messaging and VoIP social platform",
|
|
3
|
+
"\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n": "\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n",
|
|
4
|
+
"Send Message with Bot": "Send Message with Bot",
|
|
5
|
+
"Send Message Webhook": "Send Message Webhook",
|
|
6
|
+
"Request Approval in a Channel": "Request Approval in a Channel",
|
|
7
|
+
"Add role to member": "Add role to member",
|
|
8
|
+
"Remove role from member": "Remove role from member",
|
|
9
|
+
"Remove member from guild": "Remove member from guild",
|
|
10
|
+
"List guild members": "List guild members",
|
|
11
|
+
"Rename channel": "Rename channel",
|
|
12
|
+
"Create channel": "Create channel",
|
|
13
|
+
"Delete channel": "Delete channel",
|
|
14
|
+
"Find channel": "Find channel",
|
|
15
|
+
"Remove ban from user": "Remove ban from user",
|
|
16
|
+
"Create guild role": "Create guild role",
|
|
17
|
+
"Delete guild role": "Delete guild role",
|
|
18
|
+
"Ban guild member": "Ban guild member",
|
|
19
|
+
"Custom API Call": "Custom API Call",
|
|
20
|
+
"Send messages via bot to any channel or thread you want, with an optional file attachment.": "Send messages via bot to any channel or thread you want, with an optional file attachment.",
|
|
21
|
+
"Send a discord message via webhook": "Send a discord message via webhook",
|
|
22
|
+
"send a message to a channel asking for approval and wait for a response": "send a message to a channel asking for approval and wait for a response",
|
|
23
|
+
"Add Guild Member Role": "Add Guild Member Role",
|
|
24
|
+
"Remove Guild Member Role": "Remove Guild Member Role",
|
|
25
|
+
"Remove Guild Member": "Remove Guild Member",
|
|
26
|
+
"List Guild Members": "List Guild Members",
|
|
27
|
+
"rename a channel": "rename a channel",
|
|
28
|
+
"create a channel": "create a channel",
|
|
29
|
+
"delete a channel": "delete a channel",
|
|
30
|
+
"find a channel by name": "find a channel by name",
|
|
31
|
+
"Removes the guild ban from a user": "Removes the guild ban from a user",
|
|
32
|
+
"Creates a new role on the specified guild": "Creates a new role on the specified guild",
|
|
33
|
+
"Deletes the specified role from the specified guild": "Deletes the specified role from the specified guild",
|
|
34
|
+
"Bans a guild member": "Bans a guild member",
|
|
35
|
+
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
36
|
+
"Channel": "Channel",
|
|
37
|
+
"Message": "Message",
|
|
38
|
+
"Attachments": "Attachments",
|
|
39
|
+
"Webhook URL": "Webhook URL",
|
|
40
|
+
"Name": "Name",
|
|
41
|
+
"Avatar URL": "Avatar URL",
|
|
42
|
+
"embeds": "embeds",
|
|
43
|
+
"Text to speech": "Text to speech",
|
|
44
|
+
"Guilds": "Guilds",
|
|
45
|
+
"User ID": "User ID",
|
|
46
|
+
"Roles": "Roles",
|
|
47
|
+
"Search": "Search",
|
|
48
|
+
"Unban Reason": "Unban Reason",
|
|
49
|
+
"Role Name": "Role Name",
|
|
50
|
+
"Role Color": "Role Color",
|
|
51
|
+
"Display Separated": "Display Separated",
|
|
52
|
+
"Mentionable": "Mentionable",
|
|
53
|
+
"Creation Reason": "Creation Reason",
|
|
54
|
+
"Deletion reason": "Deletion reason",
|
|
55
|
+
"Ban Reason": "Ban Reason",
|
|
56
|
+
"Method": "Method",
|
|
57
|
+
"Headers": "Headers",
|
|
58
|
+
"Query Parameters": "Query Parameters",
|
|
59
|
+
"Body Type": "Body Type",
|
|
60
|
+
"Body": "Body",
|
|
61
|
+
"Response is Binary ?": "Response is Binary ?",
|
|
62
|
+
"No Error on Failure": "No Error on Failure",
|
|
63
|
+
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
64
|
+
"Follow redirects": "Follow redirects",
|
|
65
|
+
"List of channels": "List of channels",
|
|
66
|
+
"Message content to send.": "Message content to send.",
|
|
67
|
+
"The avatar url for webhook": "The avatar url for webhook",
|
|
68
|
+
"Embeds to send along with the message": "Embeds to send along with the message",
|
|
69
|
+
"Robot reads the message": "Robot reads the message",
|
|
70
|
+
"The message you want to send": "The message you want to send",
|
|
71
|
+
"List of guilds": "List of guilds",
|
|
72
|
+
"The user id of the member": "The user id of the member",
|
|
73
|
+
"List of roles": "List of roles",
|
|
74
|
+
"Search for a member": "Search for a member",
|
|
75
|
+
"The new name of the channel": "The new name of the channel",
|
|
76
|
+
"The name of the new channel": "The name of the new channel",
|
|
77
|
+
"The name of the channel": "The name of the channel",
|
|
78
|
+
"The ID of the user": "The ID of the user",
|
|
79
|
+
"The reason for unbanning the user": "The reason for unbanning the user",
|
|
80
|
+
"The name of the role": "The name of the role",
|
|
81
|
+
"The RGB color of the role (may be better to set manually on the server)": "The RGB color of the role (may be better to set manually on the server)",
|
|
82
|
+
"Whether the role should be displayed separately in the sidebar": "Whether the role should be displayed separately in the sidebar",
|
|
83
|
+
"Whether the role can be mentioned by other users": "Whether the role can be mentioned by other users",
|
|
84
|
+
"The reason for creating the role": "The reason for creating the role",
|
|
85
|
+
"The reason for deleting the role": "The reason for deleting the role",
|
|
86
|
+
"The reason for banning the member": "The reason for banning the member",
|
|
87
|
+
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
88
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
89
|
+
"GET": "GET",
|
|
90
|
+
"POST": "POST",
|
|
91
|
+
"PATCH": "PATCH",
|
|
92
|
+
"PUT": "PUT",
|
|
93
|
+
"DELETE": "DELETE",
|
|
94
|
+
"HEAD": "HEAD",
|
|
95
|
+
"None": "None",
|
|
96
|
+
"JSON": "JSON",
|
|
97
|
+
"Form Data": "Form Data",
|
|
98
|
+
"Raw": "Raw",
|
|
99
|
+
"New message": "New message",
|
|
100
|
+
"New Member": "New Member",
|
|
101
|
+
"Triggers when a message is sent in a channel": "Triggers when a message is sent in a channel",
|
|
102
|
+
"Triggers when a new member joins a guild": "Triggers when a new member joins a guild",
|
|
103
|
+
"Limit": "Limit",
|
|
104
|
+
"Guild ID": "Guild ID",
|
|
105
|
+
"The number of messages to fetch": "The number of messages to fetch",
|
|
106
|
+
"The number of members to fetch (max 1000)": "The number of members to fetch (max 1000)",
|
|
107
|
+
"The ID of the Discord guild (server)": "The ID of the Discord guild (server)"
|
|
108
|
+
}
|
package/src/i18n/vi.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Discord": "Discord",
|
|
3
|
+
"Instant messaging and VoIP social platform": "Instant messaging and VoIP social platform",
|
|
4
|
+
"\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n": "\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n",
|
|
5
|
+
"Send Message with Bot": "Send Message with Bot",
|
|
6
|
+
"Send Message Webhook": "Send Message Webhook",
|
|
7
|
+
"Request Approval in a Channel": "Request Approval in a Channel",
|
|
8
|
+
"Add role to member": "Add role to member",
|
|
9
|
+
"Remove role from member": "Remove role from member",
|
|
10
|
+
"Remove member from guild": "Remove member from guild",
|
|
11
|
+
"List guild members": "List guild members",
|
|
12
|
+
"Rename channel": "Rename channel",
|
|
13
|
+
"Create channel": "Create channel",
|
|
14
|
+
"Delete channel": "Delete channel",
|
|
15
|
+
"Find channel": "Find channel",
|
|
16
|
+
"Remove ban from user": "Remove ban from user",
|
|
17
|
+
"Create guild role": "Create guild role",
|
|
18
|
+
"Delete guild role": "Delete guild role",
|
|
19
|
+
"Ban guild member": "Ban guild member",
|
|
20
|
+
"Custom API Call": "Custom API Call",
|
|
21
|
+
"Send messages via bot to any channel or thread you want, with an optional file attachment.": "Send messages via bot to any channel or thread you want, with an optional file attachment.",
|
|
22
|
+
"Send a discord message via webhook": "Send a discord message via webhook",
|
|
23
|
+
"send a message to a channel asking for approval and wait for a response": "send a message to a channel asking for approval and wait for a response",
|
|
24
|
+
"Add Guild Member Role": "Add Guild Member Role",
|
|
25
|
+
"Remove Guild Member Role": "Remove Guild Member Role",
|
|
26
|
+
"Remove Guild Member": "Remove Guild Member",
|
|
27
|
+
"List Guild Members": "List Guild Members",
|
|
28
|
+
"rename a channel": "rename a channel",
|
|
29
|
+
"create a channel": "create a channel",
|
|
30
|
+
"delete a channel": "delete a channel",
|
|
31
|
+
"find a channel by name": "find a channel by name",
|
|
32
|
+
"Removes the guild ban from a user": "Removes the guild ban from a user",
|
|
33
|
+
"Creates a new role on the specified guild": "Creates a new role on the specified guild",
|
|
34
|
+
"Deletes the specified role from the specified guild": "Deletes the specified role from the specified guild",
|
|
35
|
+
"Bans a guild member": "Bans a guild member",
|
|
36
|
+
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
|
37
|
+
"Channel": "Channel",
|
|
38
|
+
"Message": "Message",
|
|
39
|
+
"Attachments": "Attachments",
|
|
40
|
+
"Webhook URL": "Webhook URL",
|
|
41
|
+
"Name": "Name",
|
|
42
|
+
"Avatar URL": "Avatar URL",
|
|
43
|
+
"embeds": "embeds",
|
|
44
|
+
"Text to speech": "Text to speech",
|
|
45
|
+
"Guilds": "Guilds",
|
|
46
|
+
"User ID": "User ID",
|
|
47
|
+
"Roles": "Roles",
|
|
48
|
+
"Search": "Search",
|
|
49
|
+
"Unban Reason": "Unban Reason",
|
|
50
|
+
"Role Name": "Role Name",
|
|
51
|
+
"Role Color": "Role Color",
|
|
52
|
+
"Display Separated": "Display Separated",
|
|
53
|
+
"Mentionable": "Mentionable",
|
|
54
|
+
"Creation Reason": "Creation Reason",
|
|
55
|
+
"Deletion reason": "Deletion reason",
|
|
56
|
+
"Ban Reason": "Ban Reason",
|
|
57
|
+
"Method": "Method",
|
|
58
|
+
"Headers": "Headers",
|
|
59
|
+
"Query Parameters": "Query Parameters",
|
|
60
|
+
"Body": "Body",
|
|
61
|
+
"No Error on Failure": "No Error on Failure",
|
|
62
|
+
"Timeout (in seconds)": "Timeout (in seconds)",
|
|
63
|
+
"List of channels": "List of channels",
|
|
64
|
+
"Message content to send.": "Message content to send.",
|
|
65
|
+
"The avatar url for webhook": "The avatar url for webhook",
|
|
66
|
+
"Embeds to send along with the message": "Embeds to send along with the message",
|
|
67
|
+
"Robot reads the message": "Robot reads the message",
|
|
68
|
+
"The message you want to send": "The message you want to send",
|
|
69
|
+
"List of guilds": "List of guilds",
|
|
70
|
+
"The user id of the member": "The user id of the member",
|
|
71
|
+
"List of roles": "List of roles",
|
|
72
|
+
"Search for a member": "Search for a member",
|
|
73
|
+
"The new name of the channel": "The new name of the channel",
|
|
74
|
+
"The name of the new channel": "The name of the new channel",
|
|
75
|
+
"The name of the channel": "The name of the channel",
|
|
76
|
+
"The ID of the user": "The ID of the user",
|
|
77
|
+
"The reason for unbanning the user": "The reason for unbanning the user",
|
|
78
|
+
"The name of the role": "The name of the role",
|
|
79
|
+
"The RGB color of the role (may be better to set manually on the server)": "The RGB color of the role (may be better to set manually on the server)",
|
|
80
|
+
"Whether the role should be displayed separately in the sidebar": "Whether the role should be displayed separately in the sidebar",
|
|
81
|
+
"Whether the role can be mentioned by other users": "Whether the role can be mentioned by other users",
|
|
82
|
+
"The reason for creating the role": "The reason for creating the role",
|
|
83
|
+
"The reason for deleting the role": "The reason for deleting the role",
|
|
84
|
+
"The reason for banning the member": "The reason for banning the member",
|
|
85
|
+
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
|
86
|
+
"GET": "GET",
|
|
87
|
+
"POST": "POST",
|
|
88
|
+
"PATCH": "PATCH",
|
|
89
|
+
"PUT": "PUT",
|
|
90
|
+
"DELETE": "DELETE",
|
|
91
|
+
"HEAD": "HEAD",
|
|
92
|
+
"New message": "New message",
|
|
93
|
+
"New Member": "New Member",
|
|
94
|
+
"Triggers when a message is sent in a channel": "Triggers when a message is sent in a channel",
|
|
95
|
+
"Triggers when a new member joins a guild": "Triggers when a new member joins a guild",
|
|
96
|
+
"Limit": "Limit",
|
|
97
|
+
"Guild ID": "Guild ID",
|
|
98
|
+
"The number of messages to fetch": "The number of messages to fetch",
|
|
99
|
+
"The number of members to fetch (max 1000)": "The number of members to fetch (max 1000)",
|
|
100
|
+
"The ID of the Discord guild (server)": "The ID of the Discord guild (server)"
|
|
101
|
+
}
|
package/src/i18n/zh.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Instant messaging and VoIP social platform": "Instant messaging and VoIP social platform",
|
|
3
|
+
"\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n": "\nTo obtain a token, follow these steps:\n1. Go to https://discord.com/developers/applications\n2. Click on Application (or create one if you don't have one)\n3. Click on Bot\n4. Copy the token\n",
|
|
4
|
+
"Send Message with Bot": "Send Message with Bot",
|
|
5
|
+
"Send Message Webhook": "Send Message Webhook",
|
|
6
|
+
"Request Approval in a Channel": "Request Approval in a Channel",
|
|
7
|
+
"Add role to member": "Add role to member",
|
|
8
|
+
"Remove role from member": "Remove role from member",
|
|
9
|
+
"Remove member from guild": "Remove member from guild",
|
|
10
|
+
"List guild members": "List guild members",
|
|
11
|
+
"Rename channel": "Rename channel",
|
|
12
|
+
"Create channel": "Create channel",
|
|
13
|
+
"Delete channel": "Delete channel",
|
|
14
|
+
"Find channel": "Find channel",
|
|
15
|
+
"Remove ban from user": "Remove ban from user",
|
|
16
|
+
"Create guild role": "Create guild role",
|
|
17
|
+
"Delete guild role": "Delete guild role",
|
|
18
|
+
"Ban guild member": "Ban guild member",
|
|
19
|
+
"Custom API Call": "自定义 API 呼叫",
|
|
20
|
+
"Send messages via bot to any channel or thread you want, with an optional file attachment.": "Send messages via bot to any channel or thread you want, with an optional file attachment.",
|
|
21
|
+
"Send a discord message via webhook": "Send a discord message via webhook",
|
|
22
|
+
"send a message to a channel asking for approval and wait for a response": "send a message to a channel asking for approval and wait for a response",
|
|
23
|
+
"Add Guild Member Role": "Add Guild Member Role",
|
|
24
|
+
"Remove Guild Member Role": "Remove Guild Member Role",
|
|
25
|
+
"Remove Guild Member": "Remove Guild Member",
|
|
26
|
+
"List Guild Members": "List Guild Members",
|
|
27
|
+
"rename a channel": "rename a channel",
|
|
28
|
+
"create a channel": "create a channel",
|
|
29
|
+
"delete a channel": "delete a channel",
|
|
30
|
+
"find a channel by name": "find a channel by name",
|
|
31
|
+
"Removes the guild ban from a user": "Removes the guild ban from a user",
|
|
32
|
+
"Creates a new role on the specified guild": "Creates a new role on the specified guild",
|
|
33
|
+
"Deletes the specified role from the specified guild": "Deletes the specified role from the specified guild",
|
|
34
|
+
"Bans a guild member": "Bans a guild member",
|
|
35
|
+
"Make a custom API call to a specific endpoint": "将一个自定义 API 调用到一个特定的终点",
|
|
36
|
+
"Channel": "Channel",
|
|
37
|
+
"Message": "Message",
|
|
38
|
+
"Attachments": "Attachments",
|
|
39
|
+
"Webhook URL": "Webhook URL",
|
|
40
|
+
"Name": "名称",
|
|
41
|
+
"Avatar URL": "Avatar URL",
|
|
42
|
+
"embeds": "embeds",
|
|
43
|
+
"Text to speech": "Text to speech",
|
|
44
|
+
"Guilds": "Guilds",
|
|
45
|
+
"User ID": "User ID",
|
|
46
|
+
"Roles": "角色",
|
|
47
|
+
"Search": "Search",
|
|
48
|
+
"Unban Reason": "Unban Reason",
|
|
49
|
+
"Role Name": "角色名称",
|
|
50
|
+
"Role Color": "Role Color",
|
|
51
|
+
"Display Separated": "Display Separated",
|
|
52
|
+
"Mentionable": "Mentionable",
|
|
53
|
+
"Creation Reason": "Creation Reason",
|
|
54
|
+
"Deletion reason": "Deletion reason",
|
|
55
|
+
"Ban Reason": "Ban Reason",
|
|
56
|
+
"Method": "方法",
|
|
57
|
+
"Headers": "信头",
|
|
58
|
+
"Query Parameters": "查询参数",
|
|
59
|
+
"Body Type": "Body Type",
|
|
60
|
+
"Body": "正文内容",
|
|
61
|
+
"Response is Binary ?": "Response is Binary ?",
|
|
62
|
+
"No Error on Failure": "失败时没有错误",
|
|
63
|
+
"Timeout (in seconds)": "超时(秒)",
|
|
64
|
+
"Follow redirects": "Follow redirects",
|
|
65
|
+
"List of channels": "List of channels",
|
|
66
|
+
"Message content to send.": "Message content to send.",
|
|
67
|
+
"The avatar url for webhook": "The avatar url for webhook",
|
|
68
|
+
"Embeds to send along with the message": "Embeds to send along with the message",
|
|
69
|
+
"Robot reads the message": "Robot reads the message",
|
|
70
|
+
"The message you want to send": "The message you want to send",
|
|
71
|
+
"List of guilds": "List of guilds",
|
|
72
|
+
"The user id of the member": "The user id of the member",
|
|
73
|
+
"List of roles": "List of roles",
|
|
74
|
+
"Search for a member": "Search for a member",
|
|
75
|
+
"The new name of the channel": "The new name of the channel",
|
|
76
|
+
"The name of the new channel": "The name of the new channel",
|
|
77
|
+
"The name of the channel": "The name of the channel",
|
|
78
|
+
"The ID of the user": "The ID of the user",
|
|
79
|
+
"The reason for unbanning the user": "The reason for unbanning the user",
|
|
80
|
+
"The name of the role": "The name of the role",
|
|
81
|
+
"The RGB color of the role (may be better to set manually on the server)": "The RGB color of the role (may be better to set manually on the server)",
|
|
82
|
+
"Whether the role should be displayed separately in the sidebar": "Whether the role should be displayed separately in the sidebar",
|
|
83
|
+
"Whether the role can be mentioned by other users": "Whether the role can be mentioned by other users",
|
|
84
|
+
"The reason for creating the role": "The reason for creating the role",
|
|
85
|
+
"The reason for deleting the role": "The reason for deleting the role",
|
|
86
|
+
"The reason for banning the member": "The reason for banning the member",
|
|
87
|
+
"Authorization headers are injected automatically from your connection.": "授权头自动从您的连接中注入。",
|
|
88
|
+
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
|
|
89
|
+
"GET": "获取",
|
|
90
|
+
"POST": "帖子",
|
|
91
|
+
"PATCH": "PATCH",
|
|
92
|
+
"PUT": "弹出",
|
|
93
|
+
"DELETE": "删除",
|
|
94
|
+
"HEAD": "黑色",
|
|
95
|
+
"None": "无",
|
|
96
|
+
"JSON": "JSON",
|
|
97
|
+
"Form Data": "表单数据",
|
|
98
|
+
"Raw": "原始文件",
|
|
99
|
+
"New message": "New message",
|
|
100
|
+
"New Member": "New Member",
|
|
101
|
+
"Triggers when a message is sent in a channel": "Triggers when a message is sent in a channel",
|
|
102
|
+
"Triggers when a new member joins a guild": "Triggers when a new member joins a guild",
|
|
103
|
+
"Limit": "Limit",
|
|
104
|
+
"Guild ID": "Guild ID",
|
|
105
|
+
"The number of messages to fetch": "The number of messages to fetch",
|
|
106
|
+
"The number of members to fetch (max 1000)": "The number of members to fetch (max 1000)",
|
|
107
|
+
"The ID of the Discord guild (server)": "The ID of the Discord guild (server)"
|
|
108
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discord = exports.discordAuth = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_common_1 = require("@scopieflows/pieces-common");
|
|
6
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
7
|
+
const shared_1 = require("@scopieflows/shared");
|
|
8
|
+
const add_role_to_member_1 = require("./lib/actions/add-role-to-member");
|
|
9
|
+
const find_channel_1 = require("./lib/actions/find-channel");
|
|
10
|
+
const find_guild_member_1 = require("./lib/actions/find-guild-member");
|
|
11
|
+
const remove_member_from_guild_1 = require("./lib/actions/remove-member-from-guild");
|
|
12
|
+
const remove_role_from_member_1 = require("./lib/actions/remove-role-from-member");
|
|
13
|
+
const rename_channel_1 = require("./lib/actions/rename-channel");
|
|
14
|
+
const create_channel_1 = require("./lib/actions/create-channel");
|
|
15
|
+
const delete_channel_1 = require("./lib/actions/delete-channel");
|
|
16
|
+
const send_approval_message_1 = require("./lib/actions/send-approval-message");
|
|
17
|
+
const send_message_webhook_1 = require("./lib/actions/send-message-webhook");
|
|
18
|
+
const new_message_1 = require("./lib/triggers/new-message");
|
|
19
|
+
const remove_ban_from_user_1 = require("./lib/actions/remove-ban-from-user");
|
|
20
|
+
const create_guild_role_1 = require("./lib/actions/create-guild-role");
|
|
21
|
+
const delete_guild_role_1 = require("./lib/actions/delete-guild-role");
|
|
22
|
+
const ban_a_guild_member_1 = require("./lib/actions/ban-a-guild-member");
|
|
23
|
+
const new_member_1 = require("./lib/triggers/new-member");
|
|
24
|
+
const send_message_with_bot_1 = require("./lib/actions/send-message-with-bot");
|
|
25
|
+
const markdown = `
|
|
26
|
+
To obtain a token, follow these steps:
|
|
27
|
+
1. Go to https://discord.com/developers/applications
|
|
28
|
+
2. Click on Application (or create one if you don't have one)
|
|
29
|
+
3. Click on Bot
|
|
30
|
+
4. Copy the token
|
|
31
|
+
`;
|
|
32
|
+
exports.discordAuth = pieces_framework_1.PieceAuth.SecretText({
|
|
33
|
+
displayName: 'Bot Token',
|
|
34
|
+
description: markdown,
|
|
35
|
+
required: true,
|
|
36
|
+
});
|
|
37
|
+
exports.discord = (0, pieces_framework_1.createPiece)({
|
|
38
|
+
displayName: 'Discord',
|
|
39
|
+
description: 'Instant messaging and VoIP social platform',
|
|
40
|
+
minimumSupportedRelease: '0.30.0',
|
|
41
|
+
logoUrl: '/pieces/discord.png',
|
|
42
|
+
categories: [shared_1.PieceCategory.COMMUNICATION],
|
|
43
|
+
auth: exports.discordAuth,
|
|
44
|
+
actions: [
|
|
45
|
+
send_message_with_bot_1.sendMessageWithBot,
|
|
46
|
+
send_message_webhook_1.discordSendMessageWebhook,
|
|
47
|
+
send_approval_message_1.discordSendApprovalMessage,
|
|
48
|
+
add_role_to_member_1.discordAddRoleToMember,
|
|
49
|
+
remove_role_from_member_1.discordRemoveRoleFromMember,
|
|
50
|
+
remove_member_from_guild_1.discordRemoveMemberFromGuild,
|
|
51
|
+
find_guild_member_1.discordFindGuildMemberByUsername,
|
|
52
|
+
rename_channel_1.discordRenameChannel,
|
|
53
|
+
create_channel_1.discordCreateChannel,
|
|
54
|
+
delete_channel_1.discordDeleteChannel,
|
|
55
|
+
find_channel_1.discordFindChannel,
|
|
56
|
+
remove_ban_from_user_1.discordRemoveBanFromUser,
|
|
57
|
+
create_guild_role_1.discordCreateGuildRole,
|
|
58
|
+
delete_guild_role_1.discordDeleteGuildRole,
|
|
59
|
+
ban_a_guild_member_1.discordBanGuildMember,
|
|
60
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
61
|
+
auth: exports.discordAuth,
|
|
62
|
+
baseUrl: () => {
|
|
63
|
+
return 'https://discord.com/api/v9';
|
|
64
|
+
},
|
|
65
|
+
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
return {
|
|
67
|
+
Authorization: `Bot ${auth.secret_text}`,
|
|
68
|
+
};
|
|
69
|
+
}),
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
authors: [
|
|
73
|
+
'creed983',
|
|
74
|
+
'TaskMagicKyle',
|
|
75
|
+
'karimkhaleel',
|
|
76
|
+
'Abdallah-Alwarawreh',
|
|
77
|
+
'kishanprmr',
|
|
78
|
+
'MoShizzle',
|
|
79
|
+
'AbdulTheActivePiecer',
|
|
80
|
+
'khaledmashaly',
|
|
81
|
+
'abuaboud',
|
|
82
|
+
'tintinthedev',
|
|
83
|
+
'AshotZaqoyan'
|
|
84
|
+
],
|
|
85
|
+
triggers: [new_message_1.newMessage, new_member_1.newMember],
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/discord/src/index.ts"],"names":[],"mappings":";;;;AAAA,8DAAuE;AACvE,oEAAuE;AACvE,gDAAoD;AACpD,yEAA0E;AAC1E,6DAAgE;AAChE,uEAAmF;AACnF,qFAAsF;AACtF,mFAAoF;AACpF,iEAAoE;AACpE,iEAAoE;AACpE,iEAAoE;AACpE,+EAAiF;AACjF,6EAA+E;AAC/E,4DAAwD;AACxD,6EAA8E;AAC9E,uEAAyE;AACzE,uEAAyE;AACzE,yEAAyE;AACzE,0DAAsD;AACtD,+EAAwE;AAExE,MAAM,QAAQ,GAAG;;;;;;CAMhB,CAAC;AAEW,QAAA,WAAW,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC9C,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,4CAA4C;IACzD,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,qBAAqB;IAC9B,UAAU,EAAE,CAAC,sBAAa,CAAC,aAAa,CAAC;IACzC,IAAI,EAAE,mBAAW;IACjB,OAAO,EAAE;QACP,0CAAkB;QAClB,gDAAyB;QACzB,kDAA0B;QAC1B,2CAAsB;QACtB,qDAA2B;QAC3B,uDAA4B;QAC5B,oDAAgC;QAChC,qCAAoB;QACpB,qCAAoB;QACpB,qCAAoB;QACpB,iCAAkB;QAClB,+CAAwB;QACxB,0CAAsB;QACtB,0CAAsB;QACtB,0CAAqB;QACrB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAC,mBAAW;YAChB,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,4BAA4B,CAAC;YACtC,CAAC;YACD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,OAAO,IAAI,CAAC,WAAW,EAAE;iBACzC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,OAAO,EAAE;QACP,UAAU;QACV,eAAe;QACf,cAAc;QACd,qBAAqB;QACrB,YAAY;QACZ,WAAW;QACX,sBAAsB;QACtB,eAAe;QACf,UAAU;QACV,cAAc;QACd,cAAc;KACf;IACD,QAAQ,EAAE,CAAC,wBAAU,EAAE,sBAAS,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const discordAddRoleToMember: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
guild_id: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
user_id: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
role_id: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").SecretTextProperty<true>>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discordAddRoleToMember = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@scopieflows/pieces-common");
|
|
7
|
+
const index_1 = require("../../index");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.discordAddRoleToMember = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.discordAuth,
|
|
11
|
+
name: 'add_role_to_member',
|
|
12
|
+
description: 'Add Guild Member Role',
|
|
13
|
+
displayName: 'Add role to member',
|
|
14
|
+
props: {
|
|
15
|
+
guild_id: common_1.discordCommon.guilds,
|
|
16
|
+
user_id: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'User ID',
|
|
18
|
+
description: 'The user id of the member',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
role_id: common_1.discordCommon.roles,
|
|
22
|
+
},
|
|
23
|
+
run(configValue) {
|
|
24
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const request = {
|
|
26
|
+
method: pieces_common_1.HttpMethod.PUT,
|
|
27
|
+
url: `https://discord.com/api/v9/guilds/${configValue.propsValue.guild_id}/members/${configValue.propsValue.user_id}/roles/${configValue.propsValue.role_id}`,
|
|
28
|
+
headers: {
|
|
29
|
+
authorization: `Bot ${configValue.auth.secret_text}`,
|
|
30
|
+
'Content-Type': 'application/json',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const res = yield pieces_common_1.httpClient.sendRequest(request);
|
|
34
|
+
return {
|
|
35
|
+
success: res.status === 204,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=add-role-to-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-role-to-member.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discord/src/lib/actions/add-role-to-member.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAIoC;AACpC,uCAA0C;AAC1C,sCAA0C;AAE7B,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,mBAAW;IACjB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACL,QAAQ,EAAE,sBAAa,CAAC,MAAM;QAC9B,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,sBAAa,CAAC,KAAK;KAC7B;IAEK,GAAG,CAAC,WAAW;;YACnB,MAAM,OAAO,GAAqB;gBAChC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,qCAAqC,WAAW,CAAC,UAAU,CAAC,QAAQ,YAAY,WAAW,CAAC,UAAU,CAAC,OAAO,UAAU,WAAW,CAAC,UAAU,CAAC,OAAO,EAAE;gBAC7J,OAAO,EAAE;oBACP,aAAa,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE;oBACpD,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC;YAEF,MAAM,GAAG,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAQ,OAAO,CAAC,CAAC;YAEzD,OAAO;gBACL,OAAO,EAAE,GAAG,CAAC,MAAM,KAAK,GAAG;aAC5B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const discordBanGuildMember: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
guild_id: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
user_id: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
ban_reason: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discordBanGuildMember = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@scopieflows/pieces-common");
|
|
7
|
+
const index_1 = require("../../index");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.discordBanGuildMember = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.discordAuth,
|
|
11
|
+
name: 'ban_guild_member',
|
|
12
|
+
description: 'Bans a guild member',
|
|
13
|
+
displayName: 'Ban guild member',
|
|
14
|
+
props: {
|
|
15
|
+
guild_id: common_1.discordCommon.guilds,
|
|
16
|
+
user_id: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'User ID',
|
|
18
|
+
description: 'The user id of the member',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
ban_reason: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Ban Reason',
|
|
23
|
+
description: 'The reason for banning the member',
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
run(configValue) {
|
|
28
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const request = {
|
|
30
|
+
method: pieces_common_1.HttpMethod.PUT,
|
|
31
|
+
url: `https://discord.com/api/v9/guilds/${configValue.propsValue.guild_id}/bans/${configValue.propsValue.user_id}`,
|
|
32
|
+
headers: {
|
|
33
|
+
authorization: `Bot ${configValue.auth.secret_text}`,
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'X-Audit-Log-Reason': `${configValue.propsValue.ban_reason}`,
|
|
36
|
+
},
|
|
37
|
+
body: {
|
|
38
|
+
reason: `${configValue.propsValue.ban_reason}`,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const res = yield pieces_common_1.httpClient.sendRequest(request);
|
|
42
|
+
return {
|
|
43
|
+
success: res.status === 204,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=ban-a-guild-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ban-a-guild-member.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discord/src/lib/actions/ban-a-guild-member.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAIoC;AACpC,uCAA0C;AAC1C,sCAA0C;AAE7B,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,mBAAW;IACjB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,kBAAkB;IAC/B,KAAK,EAAE;QACL,QAAQ,EAAE,sBAAa,CAAC,MAAM;QAC9B,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IAEK,GAAG,CAAC,WAAW;;YACnB,MAAM,OAAO,GAAqB;gBAChC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,qCAAqC,WAAW,CAAC,UAAU,CAAC,QAAQ,SAAS,WAAW,CAAC,UAAU,CAAC,OAAO,EAAE;gBAClH,OAAO,EAAE;oBACP,aAAa,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE;oBACpD,cAAc,EAAE,kBAAkB;oBAClC,oBAAoB,EAAE,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE;iBAC7D;gBACD,IAAI,EAAE;oBACJ,MAAM,EAAE,GAAG,WAAW,CAAC,UAAU,CAAC,UAAU,EAAE;iBAC/C;aACF,CAAC;YAEF,MAAM,GAAG,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAQ,OAAO,CAAC,CAAC;YAEzD,OAAO;gBACL,OAAO,EAAE,GAAG,CAAC,MAAM,KAAK,GAAG;aAC5B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const discordCreateChannel: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
guild_id: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
name: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.discordCreateChannel = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@scopieflows/pieces-framework");
|
|
6
|
+
const pieces_common_1 = require("@scopieflows/pieces-common");
|
|
7
|
+
const index_1 = require("../../index");
|
|
8
|
+
const common_1 = require("../common");
|
|
9
|
+
exports.discordCreateChannel = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: index_1.discordAuth,
|
|
11
|
+
name: 'create_channel',
|
|
12
|
+
description: 'create a channel',
|
|
13
|
+
displayName: 'Create channel',
|
|
14
|
+
props: {
|
|
15
|
+
guild_id: common_1.discordCommon.guilds,
|
|
16
|
+
name: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Name',
|
|
18
|
+
description: 'The name of the new channel',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
run(configValue) {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const request = {
|
|
25
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
26
|
+
url: `https://discord.com/api/v9/guilds/${configValue.propsValue.guild_id}/channels`,
|
|
27
|
+
body: {
|
|
28
|
+
name: configValue.propsValue.name,
|
|
29
|
+
},
|
|
30
|
+
headers: {
|
|
31
|
+
authorization: `Bot ${configValue.auth.secret_text}`,
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
const res = yield pieces_common_1.httpClient.sendRequest(request);
|
|
36
|
+
return {
|
|
37
|
+
success: res.status === 201,
|
|
38
|
+
channel: {
|
|
39
|
+
id: res.body.id,
|
|
40
|
+
name: res.body.name,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=create-channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-channel.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/discord/src/lib/actions/create-channel.ts"],"names":[],"mappings":";;;;AAAA,oEAAuE;AACvE,8DAIoC;AACpC,uCAA0C;AAC1C,sCAA0C;AAE7B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,mBAAW;IACjB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE;QACL,QAAQ,EAAE,sBAAa,CAAC,MAAM;QAC9B,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IAEK,GAAG,CAAC,WAAW;;YACnB,MAAM,OAAO,GAAgB;gBAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,qCAAqC,WAAW,CAAC,UAAU,CAAC,QAAQ,WAAW;gBACpF,IAAI,EAAE;oBACJ,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI;iBAClC;gBACD,OAAO,EAAE;oBACP,aAAa,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE;oBACpD,cAAc,EAAE,kBAAkB;iBACnC;aACF,CAAC;YAEF,MAAM,GAAG,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAElD,OAAO;gBACL,OAAO,EAAE,GAAG,CAAC,MAAM,KAAK,GAAG;gBAC3B,OAAO,EAAE;oBACP,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE;oBACf,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;iBACpB;aACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const discordCreateGuildRole: import("@scopieflows/pieces-framework").IAction<import("@scopieflows/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
+
guild_id: import("@scopieflows/pieces-framework").DropdownProperty<string, true, import("@scopieflows/pieces-framework").SecretTextProperty<true>>;
|
|
3
|
+
role_name: import("@scopieflows/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
role_color: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
display_separated: import("@scopieflows/pieces-framework").CheckboxProperty<false>;
|
|
6
|
+
role_mentionable: import("@scopieflows/pieces-framework").CheckboxProperty<false>;
|
|
7
|
+
creation_reason: import("@scopieflows/pieces-framework").ShortTextProperty<false>;
|
|
8
|
+
}>;
|