Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Giveaway which auto ends, auto selects a winner, and can be set for any amount of time.
- ===================================================
- BEFORE YOU USE THE GIVEAWAY COMMAND YOU MUST ALWAYS USE THE SETGIVEAWAY FIRST!!!!!
- ===================================================
- __Variables:__
- setupg - value:
- giveaway - value:
- giveawayauthor - value:
- giveawayr - value:
- giveawayset - value:
- giveawaycount - value: 0
- Timer - value:
- joinedgiveaway - value:no
- ====================
- All Codes are BDSCRIPT2
- ====================
- 1) Trigger: (prefix)setgiveaway
- $c[always use this command first before you use the (prefix)giveaway command. this is the one that sets the giveaway up]
- $allowMention
- $nomention
- $deletecommand
- $onlyIf[$getServerVar[giveawayauthor]==;Theres a giveaway in progress]
- $title[__**Setup Giveaway**__]
- $description[Hello <@$authorID>,
- What would you like the item to be for the giveaway?]
- $color[1700fb]
- $thumbnail[$userAvatar[$botID]]
- $awaitFunc[giveaway;$authorID]
- $setUserVar[setupg;1;$authorID]
- ==========================
- 2) Trigger: $awaitedCommand[giveaway;]
- $nomention
- $deletecommand
- $color[1700fb]
- $thumbnail[$userAvatar[$botID]]
- $if[$getUserVar[setupg;$authorID]==1]
- $setServerVar[giveawayset;$message|]
- $description[Your item has been set as: $message
- Now for how long is this giveaway? You can say for example:
- 5s for 5 seconds
- 20m for 20 minutes
- 1440m for one day]
- $setUserVar[setupg;2;$authorID]
- $awaitFunc[giveaway;$authorID]
- $else
- $if[$getUserVar[setupg;$authorID]==2]
- $setServerVar[giveawayset;$getServerVar[giveawayset]$message|]
- $description[The giveaway has been set for: $message
- That is all. Use !giveaway now]
- $setUserVar[setupg;0;$authorID]
- $setServerVar[giveawayauthor;$authorID]
- $endif
- $endif
- ========================
- 3) Trigger: (prefix)giveaway
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;you need to set your own or wait till the one in progress ends]
- $setServerVar[giveawaycount;0]
- $textSplit[$getServerVar[giveawayset];|]
- $setServerVar[giveaway;$sendEmbedMessage[$channelID;;__**Giveaway!!**__;;<@$authorID> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
- __Winners:__ **1**
- __**Giveaway Ends:**__ <t:$calculate[$getTimestamp+($replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]*60)]:R>
- This Giveaway is for: $splitText[2];1700fb;;;;;;;no;yes]]
- $deletecommand
- $nomention
- $allowMention
- $addButton[no;giveaway;$getServerVar[giveawaycount];success;no;🎉;$getServerVar[giveaway]]
- =======================
- 4) Trigger: (prefix)giveaway
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $textSplit[$getServerVar[giveawayset];|]
- $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]<40]
- $replyIn[$splitText[2]]
- $endif
- $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]>40]
- $replyIn[$getUserVar[Timer;$authorID]]
- $endif
- $disableSpecialEscaping
- $editMessage[$channelID;$getServerVar[giveaway];;__**This Giveaway has ended!!**__;please wait for the winner to be announced!;1700fb;]
- $nomention
- $allowMention
- $removeButtons[$getServerVar[giveaway]]
- $async[1]
- $disableSpecialEscaping
- $textSplit[$getServerVar[giveawayr];-]
- $replyIn[10s]
- $editMessage[$channelID;$getServerVar[giveaway];;__**The Giveaway Winner:**__;$splitText[$random[1;$getTextSplitLength]]
- To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
- $setServerVar[giveawayr;]
- $setServerVar[giveawayauthor;]
- $nomention
- $allowMention
- $deletecommand
- $setServerVar[giveawayr;]
- $setServerVar[giveawaycount;0]
- $endasync
- ======================
- 5) Trigger: (prefix)giveaway
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $textSplit[$getServerVar[giveawayset];|]
- $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]<40]
- $replyIn[$splitText[2]]
- $endif
- $if[$replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]>40]
- $replyIn[$getUserVar[Timer;$authorID]]
- $endif
- $dm
- $description[$nickname the giveaway has ended in $serverName[$guildID]. Please wait for the winner to contact you]
- =====================
- 6) Trigger: $onInteraction[giveaway]
- $if[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true]
- $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]==true;]
- $ephemeral
- $description[you already joined this giveaway]
- $removeButtons
- $elseif[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true]
- $onlyIf[$checkContains[$getServerVar[giveawayr];$nickname[$authorID]]!=true;]
- $setServerVar[giveawayr;$getServerVar[giveawayr]-$nickname[$authorID]]
- $setServerVar[giveawaycount;$sum[$getServerVar[giveawaycount];1]]
- $editButton[giveaway;$getServerVar[giveawaycount];success;no;🎉;]
- $nomention
- $allowMention
- $textSplit[$getServerVar[giveawayset];|]
- $title[__**Giveaway!!**__]
- $description[<@$getServerVar[giveawayauthor]> is giving away $splitText[1]!!! To participate click the emoji below for your chance to win!!
- __Winners:__ **1**
- __**Giveaway Ends:**__ <t:$calculate[$getTimestamp+($replaceText[$replaceText[$replaceText[$splitText[2];s;;1];m;;1];h;;1]*60)]:R>
- This Giveaway is for: $splitText[2]]
- $color[1700fb]
- $async[1]
- $replyIn[5s]
- $setUserVar[joinedgiveaway;yes;$authorID]
- $endasync
- $endif
- ======================
Add Comment
Please, Sign In to add comment