ShadowsNemesis

BDFD Giveaway + Auto End + Auto Winner + Rerollgiveaway + Claim For any time length

Mar 22nd, 2022 (edited)
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 8.76 KB | None | 0 0
  1. =============================
  2. Giveaway + Auto End + Auto Winner + Rerollgiveaway + Claim For any time length
  3. =============================
  4. __Variables Needed__
  5.  
  6. setupg - value:
  7. giveaway - value:
  8. giveawayauthor - value:
  9. giveawayr - value:
  10. giveawayset - value:
  11. giveawaycount - value: 0
  12. Timer - value:
  13. joinedgiveaway - value:no
  14. giveawayon - value:no
  15. localtime - value:
  16.  
  17. =============================
  18. All codes are BDScript2
  19. =============================
  20. Code 1 Trigger: (prefix)setgiveaway
  21.  
  22. $onlyIf[$getUserVar[localtime;$authorID]!=;please set your timezone first]
  23. $allowMention
  24. $nomention
  25. $deletecommand
  26. $onlyIf[$getServerVar[giveawayauthor]==;Theres a giveaway in progress]
  27. $title[__**Setup Giveaway**__]
  28. $description[Hello <@$authorID>,
  29.  
  30. What would you like the item to be for the giveaway?]
  31. $color[1700fb]
  32. $thumbnail[$userAvatar[$botID]]
  33. $awaitFunc[giveaway;$authorID]
  34. $setUserVar[setupg;1;$authorID]
  35.  
  36. =============================
  37. Code 2 Trigger: $awaitedCommand[giveaway;]
  38.  
  39. $nomention
  40. $deletecommand
  41. $color[1700fb]
  42. $thumbnail[$userAvatar[$botID]]
  43. $if[$getUserVar[setupg;$authorID]==1]
  44. $setServerVar[giveawayset;$message|]
  45. $description[Your item has been set as: $message
  46.  
  47. Now when would you like this giveaway to end? Format:
  48. `year/month/day hour:minute:second`
  49. **Example:**
  50. 2022/04/13 14:22:30]
  51. $setUserVar[setupg;2;$authorID]
  52. $awaitFunc[giveaway;$authorID]
  53. $else
  54. $if[$getUserVar[setupg;$authorID]==2]
  55. $time[$getUserVar[localtime;$authorID]]
  56. $textSplit[$message; ]
  57. $var[a;$splitText[1]]
  58. $var[num;$textSplit[$splitText[2];:]$sum[$splitText[1];4]:$splitText[2]:$splitText[3]]
  59. $httpGet[https://showcase.api.linx.twenty57.net/UnixTime/tounixtimestamp?datetime=$var[a]%20$var[num]]
  60. $setServerVar[giveawayset;$getServerVar[giveawayset]$httpResult[UnixTimeStamp]|]
  61. $description[The giveaway has been set to end on: $message
  62.  
  63. That is all. Use !giveaway now]
  64. $setUserVar[setupg;0;$authorID]
  65. $setServerVar[giveawayauthor;$authorID]
  66. $if[$channelExists[$findChannel[Giveaway]]!=true]
  67. $createChannel[Giveaway;category]
  68. $async[1]
  69. $replyIn[5]
  70. $createChannel[givaways;text;$findChannel[Giveaway]]
  71. $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
  72. $endasync
  73. $elseif[$channelExists[$findChannel[Giveaway]]==true]
  74. $if[$channelExists[$findChannel[giveaways]]!=true]
  75. $createChannel[giveaways;text;$findChannel[Giveaway]]
  76. $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
  77. $elseif[$channelExists[$findChannel[giveaways]]==true]
  78. $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
  79.  
  80. $endif
  81. $endif
  82.  
  83. $endif
  84. $endif
  85.  
  86. ==========================
  87. Code 3 Trigger: (prefix)giveaway
  88.  
  89. $onlyIf[$getServerVar[giveawayauthor]==$authorID;you need to set your own or wait till the one in progress ends]
  90. $onlyIf[$channelID==$findChannel[giveaways];You can only use this in the giveaways channel]
  91. $time[$getUserVar[localtime;$authorID]]
  92. $setServerVar[giveawayr;]
  93. $setServerVar[giveawaycount;0]
  94.  
  95. $textSplit[$getServerVar[giveawayset];|]
  96.  
  97. $setServerVar[giveaway;$sendEmbedMessage[$channelID;;__**Giveaway!!**__;;<@$authorID> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
  98.  
  99. __Winners:__ **1**
  100.  
  101. __**Giveaway Ends:**__
  102. <t:$splitText[2]:R>;1700fb;;;;;;;no;yes]]
  103.  
  104. $deletecommand
  105. $nomention
  106. $allowMention
  107. $addButton[no;giveaway;$getServerVar[giveawaycount];success;no;🎉;$getServerVar[giveaway]]
  108. $setServerVar[giveawayon;yes]
  109.  
  110. ==============================
  111. Code 4 Non-Premium Trigger: (prefix)
  112.        Premium Trigger: $messageContains[a;e;i;o;u]
  113.  
  114. $suppressErrors
  115. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  116. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  117. $time[$getUserVar[localtime;$authorID]]
  118. $textSplit[$getServerVar[giveawayset];|]
  119. $if[$getTimestamp>=$splitText[2]]
  120. $onlyIf[$getServerVar[giveawayon]==yes;]
  121. $disableSpecialEscaping
  122.  
  123. $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**This Giveaway has ended!!**__;please wait for the winner to be announced!;1700fb;]
  124. $nomention
  125. $allowMention
  126. $if[$channelID==$findChannel[giveaways]]
  127. $removeButtons[$getServerVar[giveaway]]
  128.  
  129.  
  130. $async[1]
  131. $disableSpecialEscaping
  132. $textSplit[$getServerVar[giveawayr];-]
  133. $replyIn[10s]
  134.  
  135. $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway Winner:**__;$splitText[$random[1;$getTextSplitLength]]
  136.  
  137. To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
  138. $endasync
  139. $async[2]
  140. $replyIn[11]
  141. $addButton[no;giveawayclaim-$getServerVar[giveawayauthor];claimed;success;no;;$getServerVar[giveaway]]
  142. $endasync
  143. $setServerVar[giveawayon;no]
  144. $nomention
  145. $allowMention
  146. $endif
  147. $endif
  148.  
  149. =============================
  150. Code 5 Non-Premium Trigger: (prefix)
  151.        Premium Trigger: $messageContains[a;e;i;o;u]
  152.  
  153. $suppressErrors
  154. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  155. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  156. $onlyIf[$getServerVar[giveawayon]==yes;]
  157. $time[$getUserVar[localtime;$authorID]]
  158. $textSplit[$getServerVar[giveawayset];|]
  159. $if[$getTimestamp>=$splitText[2]]
  160.  
  161. $dm[$getServerVar[giveawayauthor]]
  162. $description[$nickname the giveaway has ended in $serverName[$guildID]. Please wait for the winner to contact you]
  163. $endif
  164.  
  165. ================================
  166. Code 6 Trigger: $onInteraction[giveaway]
  167.  
  168. $if[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true]
  169. $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true;]
  170. $ephemeral
  171. $description[you already joined this giveaway]
  172. $removeButtons
  173. $elseif[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true]
  174. $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true;]
  175. $setServerVar[giveawayr;$getServerVar[giveawayr]-$nickname[$authorID]]
  176. $setServerVar[giveawaycount;$sum[$getServerVar[giveawaycount];1]]
  177. $editButton[giveaway;$getServerVar[giveawaycount];success;no;🎉;]
  178. $nomention
  179. $allowMention
  180. $textSplit[$getServerVar[giveawayset];|]
  181. $title[__**Giveaway!!**__]
  182. $description[<@$getServerVar[giveawayauthor]> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
  183.  
  184. __Winners:__ **1**
  185.  
  186. __**Giveaway Ends:**__
  187. <t:$splitText[2]:R>]
  188. $color[1700fb]
  189. $async[1]
  190. $replyIn[5s]
  191. $setUserVar[joinedgiveaway;yes;$authorID]
  192. $endasync
  193. $endif
  194.  
  195. =============================
  196. Code 7 Trigger: $onInteraction
  197.  
  198. $c[This is only for the one who created the giveaway to use once the winner has contacted them and claimed their prize. This completely ends the giveaway]
  199.  
  200. $onlyIf[$checkContains[$customID;giveawayclaim]==true;]
  201. $nomention
  202. $deletecommand
  203.  
  204. $if[$getServerVar[giveawayauthor]!=$authorID]
  205. $ephemeral
  206. $description[This is only for the giveaway creator to use]
  207. $removeButtons
  208. $elseif[$getServerVar[giveawayauthor]==$authorID]
  209. $removeButtons[$getServerVar[giveaway]]
  210. $editMessage[$channelID;$getServerVar[giveaway];;__**Giveaway Ended**__;This Giveaway has been claimed
  211.  
  212. Giveaway provider: $username[$getServerVar[giveawayauthor]];1700fb;]
  213. $setServerVar[giveawayauthor;]
  214. $endif
  215.  
  216. ===============================
  217. Code 8 Trigger: (prefix)rerollgiveaway
  218.  
  219. $c[if this reroll shows no one as a winner just repeat using until it does]
  220.  
  221.  
  222. $disableSpecialEscaping
  223. $textSplit[$getServerVar[giveawayr];-]
  224.  
  225.  
  226. $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway Reroll Winner:**__;$splitText[$random[1;$getTextSplitLength]]
  227.  
  228. To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
  229.  
  230.  
  231. $nomention
  232. $allowMention
  233. $deletecommand
  234.  
  235. ===============================
  236. Code 9 Trigger: (prefix)cancelgiveaway
  237.  
  238. $c[if something goes wrong such as your bot goes offline during the giveaway or some other error use this in the same channel as the giveaway]
  239.  
  240. $onlyAdmin[no]
  241. $nomention
  242. $deletecommand
  243. $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway has Ended:**__;for reasons beyond our control this giveaway was canceled;1700fb;Apologies from Management]
  244. $removeButtons[$getServerVar[giveaway]]
  245. $setServerVar[giveawayauthor;]
  246. $setServerVar[giveawayr;]
  247. $setServerVar[giveawaycount;0]
  248. $setServerVar[giveaway;]
  249.  
  250. ===============================
  251. Code 10 Trigger: (prefix)localtime set
  252.  
  253. $nomention
  254. $if[$message==]
  255. $description[**Step 1**
  256. Visit this website :
  257. https://en.m.wikipedia.org/wiki/List_of_tz_database_time_zones
  258.  
  259. **Step 2**
  260. Click on "List".
  261.  
  262. **Step 3**
  263. Search for your timezone in the "TZ database name" column
  264.  
  265. **Step 4**
  266. Type it just like it is with this command :
  267. `(prefix)localtime set <timezone>`
  268. Example :
  269. `(prefix)localtime set America/New_York`
  270. (Caps and underscores matter)
  271.  
  272. You're good to go!]
  273. $color[$getRoleColor[$highestRole[$authorID]]]
  274. $addTimestamp
  275. $thumbnail[$authorAvatar]
  276. $elseif[$message!=]
  277. $setUserVar[localtime;$message;$mentioned[1;yes]]
  278. $endif
Advertisement
Add Comment
Please, Sign In to add comment