· last year · Jul 07, 2024, 10:05 AM
1$nomention
2
3$c[ Visit -> https://dadocs.rickyjs.xyz/ for more information about api key ]
4
5$onlyIf[$isSlash==true;]
6$ephemeral
7
8$var[time.emoji;⏱️]
9$var[tick.emoji;✅]
10$var[cross.emoji;❌]
11$var[warning.emoji;⚠️]
12$var[next-arrow.emoji;▶️]
13
14$try
15 $onlyIf[$guildID!=;]
16$catch
17 $var[cross.emoji] You can't use this here!
18 $stop
19$endtry
20
21$var[users.emoji;<:VA_Users:1254749214437675120>]
22$var[upvote.emoji;<:VN_UpVoteGreen:1251030884304556043>]
23$var[downvote.emoji;<:VN_DownVoteRed:1251030851337191424>]
24$var[neutral.emoji;<:VA_NeutralVote:1250672230094868582>]
25
26$var[\n;$url[decode;%0A]]
27$var[\n.space;$url[decode;%0A+]]
28
29$try
30 $httpAddHeader[apikey;$getVar[ApiKey]]
31 $httpPost[https://bdfddata.rickyjs.xyz/release/db/get;{
32 "name": "Suggestions_System-$guildID"
33 }]
34
35 $var[correct.json;$replaceText[$replaceText[$replaceText[$replaceText[$replaceText[$httpResult[entries];"{;{];}";}];$url[decode;%5C];];"";"];"}";"}]]
36 $jsonParse[$var[correct.json]]
37$catch
38 There was an error! Please try again later
39 $stop
40$endtry
41
42$if[$json[suggestion-channel]==]
43 - $var[warning.emoji] This server hasn't set a suggestion channel yet!$var[\n]- $var[next-arrow.emoji] Contact the Server Owner or an Admin to set it up via `/suggestion-config` command!
44 $stop
45$else
46 $if[$serverChannelExists[$json[suggestion-channel]]==false]
47 - $var[cross.emoji] Couldn't find the suggestions channel!$var[\n]- $var[next-arrow.emoji] Report this to an Admin or Server Owner to Re-Config the suggestion channel!
48 $stop
49 $endif
50$endif
51
52$if[$json[blacklist-role]!=]
53 $if[$roleExists[$json[blacklist-role]]==false]
54 - $var[cross.emoji] Couldn't find the set Blacklisted Role!$var[\n]- $var[next-arrow.emoji] Report this to an Admin or Server Owner to Re-add the Blacklisted Role!
55 $stop
56 $else
57 $if[$hasRole[$authorID;$json[blacklist-role]]==true]
58 - $var[cross.emoji] You can not suggest since you have blacklist Role!
59 $stop
60 $endif
61 $endif
62$endif
63
64$if[$charCount[$message[suggestion]]>=4035]
65 - $var[warning.emoji] Your suggestion's character count exceeded 4035 of character limit!
66 $stop
67$endif
68
69$if[$message[image]!=]
70 $async[fetch.content.type]
71 $httpAddHeader[Range;bytes=0-0]
72 $httpGet[$message[image]]
73
74 $var[content_type;$httpGetHeader[Content-Type]]
75 $endasync $await[fetch.content.type]
76
77 $if[$checkContains[$var[content_type];image]==false]
78 $var[cross.emoji] Please select only an Image/GIF.
79 $stop
80 $endif
81$endif
82
83$if[$json[cooldown-time]==]
84 $var[cooldownTime;45s]
85$else
86 $var[cooldownTime;$json[cooldown-time]]
87$endif
88
89$if[$json[embed-color]==]
90 $var[embed.color;0df2f4]
91$else
92 $var[embed.color;$json[embed-color;hex]]
93$endif
94
95$cooldown[$var[cooldownTime];- $var[time.emoji] You are on cooldown! Try again <t:$sum[$getTimestamp;$getCooldown[normal]]:R>]
96
97$var[channel;$json[suggestion-channel]]
98
99$try
100 $jsonSetString[total-suggestions;$sum[0$json[total-suggestions];1]]
101 $var[embed.id;$sendEmbedMessage[$var[channel];;New Suggestion! (#$json[total-suggestions]);;$message[suggestion];$var[embed.color];$c[author];$c[author icon];Suggested by $username[$authorID] ($authorID);$authorAvatar;$c[thumbnail];$message[image];$c[timestamp];true]]
102
103 $if[$json[create-threads]==true]
104 $try
105 $startThread[Discussion about $username[$authorID]'s suggestion;$var[channel];$var[embed.id];10080;false]
106 $endtry
107 $endif
108
109 $jsonArray[message-ids;$var[embed.id];upvote-users]
110 $jsonArray[message-ids;$var[embed.id];downvote-users]
111 $jsonArray[message-ids;$var[embed.id];neutral-users]
112
113 $var[json.dat;$jsonStringify]
114 $jsonClear
115
116 $jsonSetString[name;Suggestions_System-$guildID]
117 $jsonSetString[value;$var[json.dat]]
118
119 $httpAddHeader[apikey;$getVar[ApiKey]]
120 $httpPost[https://bdfddata.rickyjs.xyz/release/db/set;$jsonStringify]
121$catch
122 $if[$checkContains[$error[message];Failed to send the message]==true]
123 - $var[cross.emoji] Failed to send the suggestion!$var[\n]- $var[warning.emoji] Permissions Required:$var[\n.space]- `Send Messages:` **To send messages**$var[\n.space]- `Read Message History:` **To be able to attach buttons to suggestions**
124 $else
125 There was an error! Please try again later
126 $endif
127 $stop
128$endtry
129
130$async[attach.buttons]
131 $useChannel[$var[channel]]
132
133 $addButton[false;suggestion.Voting-upvote-$authorID;0;success;false;$var[upvote.emoji];$var[embed.id]]
134 $addButton[false;suggestion.Voting-downvote-$authorID;0;danger;false;$var[downvote.emoji];$var[embed.id]]
135 $addButton[false;suggestion.Voting-neutral-$authorID;0;secondary;false;$var[neutral.emoji];$var[embed.id]]
136 $addButton[false;suggestion.VotersList;;secondary;false;$var[users.emoji];$var[embed.id]]
137$endasync
138
139$async[] $var[tick.emoji] Succesfully Sent Your Suggestion! $endasync $await[]
140