Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =============================
- Giveaway + Auto End + Auto Winner + Rerollgiveaway + Claim For any time length
- =============================
- __Variables Needed__
- setupg - value:
- giveaway - value:
- giveawayauthor - value:
- giveawayr - value:
- giveawayset - value:
- giveawaycount - value: 0
- Timer - value:
- joinedgiveaway - value:no
- giveawayon - value:no
- localtime - value:
- =============================
- All codes are BDScript2
- =============================
- Code 1 Trigger: (prefix)setgiveaway
- $onlyIf[$getUserVar[localtime;$authorID]!=;please set your timezone first]
- $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]
- =============================
- Code 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 when would you like this giveaway to end? Format:
- `year/month/day hour:minute:second`
- **Example:**
- 2022/04/13 14:22:30]
- $setUserVar[setupg;2;$authorID]
- $awaitFunc[giveaway;$authorID]
- $else
- $if[$getUserVar[setupg;$authorID]==2]
- $time[$getUserVar[localtime;$authorID]]
- $textSplit[$message; ]
- $var[a;$splitText[1]]
- $var[num;$textSplit[$splitText[2];:]$sum[$splitText[1];4]:$splitText[2]:$splitText[3]]
- $httpGet[https://showcase.api.linx.twenty57.net/UnixTime/tounixtimestamp?datetime=$var[a]%20$var[num]]
- $setServerVar[giveawayset;$getServerVar[giveawayset]$httpResult[UnixTimeStamp]|]
- $description[The giveaway has been set to end on: $message
- That is all. Use !giveaway now]
- $setUserVar[setupg;0;$authorID]
- $setServerVar[giveawayauthor;$authorID]
- $if[$channelExists[$findChannel[Giveaway]]!=true]
- $createChannel[Giveaway;category]
- $async[1]
- $replyIn[5]
- $createChannel[givaways;text;$findChannel[Giveaway]]
- $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
- $endasync
- $elseif[$channelExists[$findChannel[Giveaway]]==true]
- $if[$channelExists[$findChannel[giveaways]]!=true]
- $createChannel[giveaways;text;$findChannel[Giveaway]]
- $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
- $elseif[$channelExists[$findChannel[giveaways]]==true]
- $sendMessage[you can now use `!giveaway` in <#$findChannel[giveaways]>]
- $endif
- $endif
- $endif
- $endif
- ==========================
- Code 3 Trigger: (prefix)giveaway
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;you need to set your own or wait till the one in progress ends]
- $onlyIf[$channelID==$findChannel[giveaways];You can only use this in the giveaways channel]
- $time[$getUserVar[localtime;$authorID]]
- $setServerVar[giveawayr;]
- $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:$splitText[2]:R>;1700fb;;;;;;;no;yes]]
- $deletecommand
- $nomention
- $allowMention
- $addButton[no;giveaway;$getServerVar[giveawaycount];success;no;🎉;$getServerVar[giveaway]]
- $setServerVar[giveawayon;yes]
- ==============================
- Code 4 Non-Premium Trigger: (prefix)
- Premium Trigger: $messageContains[a;e;i;o;u]
- $suppressErrors
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $time[$getUserVar[localtime;$authorID]]
- $textSplit[$getServerVar[giveawayset];|]
- $if[$getTimestamp>=$splitText[2]]
- $onlyIf[$getServerVar[giveawayon]==yes;]
- $disableSpecialEscaping
- $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**This Giveaway has ended!!**__;please wait for the winner to be announced!;1700fb;]
- $nomention
- $allowMention
- $if[$channelID==$findChannel[giveaways]]
- $removeButtons[$getServerVar[giveaway]]
- $async[1]
- $disableSpecialEscaping
- $textSplit[$getServerVar[giveawayr];-]
- $replyIn[10s]
- $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway Winner:**__;$splitText[$random[1;$getTextSplitLength]]
- To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
- $endasync
- $async[2]
- $replyIn[11]
- $addButton[no;giveawayclaim-$getServerVar[giveawayauthor];claimed;success;no;;$getServerVar[giveaway]]
- $endasync
- $setServerVar[giveawayon;no]
- $nomention
- $allowMention
- $endif
- $endif
- =============================
- Code 5 Non-Premium Trigger: (prefix)
- Premium Trigger: $messageContains[a;e;i;o;u]
- $suppressErrors
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $onlyIf[$getServerVar[giveawayauthor]==$authorID;]
- $onlyIf[$getServerVar[giveawayon]==yes;]
- $time[$getUserVar[localtime;$authorID]]
- $textSplit[$getServerVar[giveawayset];|]
- $if[$getTimestamp>=$splitText[2]]
- $dm[$getServerVar[giveawayauthor]]
- $description[$nickname the giveaway has ended in $serverName[$guildID]. Please wait for the winner to contact you]
- $endif
- ================================
- Code 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:$splitText[2]:R>]
- $color[1700fb]
- $async[1]
- $replyIn[5s]
- $setUserVar[joinedgiveaway;yes;$authorID]
- $endasync
- $endif
- =============================
- Code 7 Trigger: $onInteraction
- $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]
- $onlyIf[$checkContains[$customID;giveawayclaim]==true;]
- $nomention
- $deletecommand
- $if[$getServerVar[giveawayauthor]!=$authorID]
- $ephemeral
- $description[This is only for the giveaway creator to use]
- $removeButtons
- $elseif[$getServerVar[giveawayauthor]==$authorID]
- $removeButtons[$getServerVar[giveaway]]
- $editMessage[$channelID;$getServerVar[giveaway];;__**Giveaway Ended**__;This Giveaway has been claimed
- Giveaway provider: $username[$getServerVar[giveawayauthor]];1700fb;]
- $setServerVar[giveawayauthor;]
- $endif
- ===============================
- Code 8 Trigger: (prefix)rerollgiveaway
- $c[if this reroll shows no one as a winner just repeat using until it does]
- $disableSpecialEscaping
- $textSplit[$getServerVar[giveawayr];-]
- $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway Reroll Winner:**__;$splitText[$random[1;$getTextSplitLength]]
- To collect your prize please contact $username[$getServerVar[giveawayauthor]];1700fb;]
- $nomention
- $allowMention
- $deletecommand
- ===============================
- Code 9 Trigger: (prefix)cancelgiveaway
- $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]
- $onlyAdmin[no]
- $nomention
- $deletecommand
- $editMessage[$findChannel[giveaways];$getServerVar[giveaway];;__**The Giveaway has Ended:**__;for reasons beyond our control this giveaway was canceled;1700fb;Apologies from Management]
- $removeButtons[$getServerVar[giveaway]]
- $setServerVar[giveawayauthor;]
- $setServerVar[giveawayr;]
- $setServerVar[giveawaycount;0]
- $setServerVar[giveaway;]
- ===============================
- Code 10 Trigger: (prefix)localtime set
- $nomention
- $if[$message==]
- $description[**Step 1**
- Visit this website :
- https://en.m.wikipedia.org/wiki/List_of_tz_database_time_zones
- **Step 2**
- Click on "List".
- **Step 3**
- Search for your timezone in the "TZ database name" column
- **Step 4**
- Type it just like it is with this command :
- `(prefix)localtime set <timezone>`
- Example :
- `(prefix)localtime set America/New_York`
- (Caps and underscores matter)
- You're good to go!]
- $color[$getRoleColor[$highestRole[$authorID]]]
- $addTimestamp
- $thumbnail[$authorAvatar]
- $elseif[$message!=]
- $setUserVar[localtime;$message;$mentioned[1;yes]]
- $endif
Advertisement
Add Comment
Please, Sign In to add comment