ShadowsNemesis

Bdfd Giveaway with auto end, auto winner selection and any time frame

Mar 6th, 2022 (edited)
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Giveaway which auto ends, auto selects a winner, and can be set for any amount of time.
  2. ===================================================
  3. BEFORE YOU USE THE GIVEAWAY COMMAND YOU MUST ALWAYS USE THE SETGIVEAWAY FIRST!!!!!
  4. ===================================================
  5.  
  6. __Variables:__
  7. setupg - value:
  8. giveaway - value:
  9. giveawayauthor - value:
  10. giveawayr - value:
  11. giveawayset - value:
  12. giveawaycount - value: 0
  13. Timer - value:
  14. joinedgiveaway - value:no
  15.  
  16. ====================
  17. All Codes are BDSCRIPT2
  18. ====================
  19. 1) Trigger: (prefix)setgiveaway
  20.  
  21.  
  22. $c[always use this command first before you use the (prefix)giveaway command. this is the one that sets the giveaway up]
  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. 2) Trigger: $awaitedCommand[giveaway;]
  37.  
  38. $nomention
  39. $deletecommand
  40. $color[1700fb]
  41. $thumbnail[$userAvatar[$botID]]
  42. $if[$getUserVar[setupg;$authorID]==1]
  43. $setServerVar[giveawayset;$message|]
  44. $description[Your item has been set as: $message
  45.  
  46. Now for how long is this giveaway? You can say for example:
  47. 5s for 5 seconds
  48. 20m for 20 minutes
  49. 1440m for one day]
  50. $setUserVar[setupg;2;$authorID]
  51. $awaitFunc[giveaway;$authorID]
  52. $else
  53. $if[$getUserVar[setupg;$authorID]==2]
  54. $setServerVar[giveawayset;$getServerVar[giveawayset]$message|]
  55. $description[The giveaway has been set for: $message
  56.  
  57. That is all. Use !giveaway now]
  58. $setUserVar[setupg;0;$authorID]
  59. $setServerVar[giveawayauthor;$authorID]
  60. $endif
  61. $endif
  62. ========================
  63. 3) Trigger: (prefix)giveaway
  64.  
  65. $onlyIf[$getServerVar[giveawayauthor]==$authorID;you need to set your own or wait till the one in progress ends]
  66. $setServerVar[giveawaycount;0]
  67. $textSplit[$getServerVar[giveawayset];|]
  68. $setServerVar[giveaway;$sendEmbedMessage[$channelID;;__**Giveaway!!**__;;<@$authorID> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
  69.  
  70. __Winners:__ **1**
  71.  
  72. __**Giveaway Ends:**__ <t:$calculate[$getTimestamp+($replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]*60)]:R>
  73.  
  74. This Giveaway is for: $splitText[2];1700fb;;;;;;;no;yes]]
  75.  
  76. $deletecommand
  77. $nomention
  78. $allowMention
  79. $addButton[no;giveaway;$getServerVar[giveawaycount];success;no;🎉;$getServerVar[giveaway]]
  80. =======================
  81. 4) Trigger: (prefix)giveaway
  82.  
  83. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  84.  
  85. $textSplit[$getServerVar[giveawayset];|]
  86. $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]<40]
  87. $replyIn[$splitText[2]]
  88. $endif
  89. $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]>40]
  90. $replyIn[$getUserVar[Timer;$authorID]]
  91. $endif
  92. $disableSpecialEscaping
  93.  
  94. $editMessage[$channelID;$getServerVar[giveaway];;__**This Giveaway has ended!!**__;please wait for the winner to be announced!;1700fb;]
  95. $nomention
  96. $allowMention
  97. $removeButtons[$getServerVar[giveaway]]
  98.  
  99. $async[1]
  100. $disableSpecialEscaping
  101. $textSplit[$getServerVar[giveawayr];-]
  102. $replyIn[10s]
  103.  
  104. $editMessage[$channelID;$getServerVar[giveaway];;__**The Giveaway Winner:**__;$splitText[$random[1;$getTextSplitLength]]
  105.  
  106. To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
  107. $setServerVar[giveawayr;]
  108. $setServerVar[giveawayauthor;]
  109.  
  110. $nomention
  111. $allowMention
  112. $deletecommand
  113.  
  114.  
  115.  
  116. $setServerVar[giveawayr;]
  117. $setServerVar[giveawaycount;0]
  118. $endasync
  119. ======================
  120. 5) Trigger: (prefix)giveaway
  121.  
  122. $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
  123.  
  124. $textSplit[$getServerVar[giveawayset];|]
  125. $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]<40]
  126. $replyIn[$splitText[2]]
  127. $endif
  128. $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]>40]
  129. $replyIn[$getUserVar[Timer;$authorID]]
  130. $endif
  131. $dm
  132. $description[$nickname the giveaway has ended in $serverName[$guildID]. Please wait for the winner to contact you]
  133. =====================
  134. 6) Trigger: $onInteraction[giveaway]
  135.  
  136. $if[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true]
  137. $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true;]
  138. $ephemeral
  139. $description[you already joined this giveaway]
  140. $removeButtons
  141. $elseif[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true]
  142. $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true;]
  143. $setServerVar[giveawayr;$getServerVar[giveawayr]-$nickname[$authorID]]
  144. $setServerVar[giveawaycount;$sum[$getServerVar[giveawaycount];1]]
  145. $editButton[giveaway;$getServerVar[giveawaycount];success;no;🎉;]
  146. $nomention
  147. $allowMention
  148. $textSplit[$getServerVar[giveawayset];|]
  149. $title[__**Giveaway!!**__]
  150. $description[<@$getServerVar[giveawayauthor]> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
  151.  
  152. __Winners:__ **1**
  153.  
  154. __**Giveaway Ends:**__ <t:$calculate[$getTimestamp+($replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]*60)]:R>
  155.  
  156. This Giveaway is for: $splitText[2]]
  157. $color[1700fb]
  158. $async[1]
  159. $replyIn[5s]
  160. $setUserVar[joinedgiveaway;yes;$authorID]
  161. $endasync
  162. $endif
  163. ======================
Add Comment
Please, Sign In to add comment