This snippet prompts the user to vote for the bot on topgg and then claim in
order to be able to run custom voter only commands that only work for voters.
How to Use?
Add all three commands in your app with the correct triggers:
- !vote – Prompts the user to go vote for the bot.
- !claim – Claim the reward after voting for the bot.
- !speical – After claiming the reward you'll be able to use special commands.
Avoid editing unless you know what you’re doing.
Get a Api Key from top.gg's offical website.
Make sure to add the required variables in your app.
Variables
- voter (value = false)
- voter-timestamp (value = empty)
Credits
Inspired by a random idea that poped up in my head.
$nomention
$reply
$title[__Vote For $username[$botID]__]
$description[Vote for $username[$botID] on [top.gg!\](https://top.gg/bot/$botID/vote).
You can unlock the following commands after voting and using `!claim`:
1. `!special` -> The special command.
2. go on as you like
]
$color[#36393e]
$footer[$username[$botID] | Vote]
$footerIcon[$userAvatar[$botID]]
$nomention
$reply
$var[apikey;YOUR_API_KEY_HERE]
$var[fail_color;#FF0000]
$var[success_color;#00FF00]
$httpAddHeader[Authorization;$var[apikey]]
$httpGet[https://top.gg/api/bots/$botID/check?userId=$authorID]
$if[$checkContains[$httpResult[voted];1]==true]
$var[voted;true]
$else
$var[voted;false]
$endif
$if[$var[voted]==true]
$title[ Reward claimed!]
$description[You have successfully claimed your reward and unlocked many different commands.]
$footer[Thank you for the vote 🤍]
$color[$var[success_color]]
$image[https://top.gg/api/widget/$botID.png]
$setVar[voter;true;$authorID]
$setVar[voter-timestamp;$getTimestamp[s];$authorID]
$globalCooldown[12h;This command has a cooldown: `%time%`.]
$else
$title[__Vote to claim!__]
$description[To claim your reward, please cast your **vote** by clicking [here\](https://top.gg/bot/$botID/vote) or on the button below this message.
You can vote for the bot and claim your reward every **12** hours.]
$addButton[no;https://top.gg/bot/$botID/vote;Vote for me!;link;;]
$color[$var[fail_color]]
$image[https://top.gg/api/widget/$botID.png]
$endif
$nomention
$onlyIf[$getVar[voter;$authorID]==true;You need to be a voter to use this command. Use `!vote` and then `!claim`.]
$var[current-timestamp;$sub[$getTimestamp;43200]]
$if[$getVar[voter-timestamp;$authorID]>=$var[current-timestamp]]
$c[The Premium Command Goes Here]
$httpGet[https://nekos.best/api/v2/kiss]
$description[<@$authorID>, kissed <@985626439179194428> (Cat That Ears The O/ Catearo)]
$image[$httpResult[results;0;url]]
$color[#36393e]
$footer[Why are you kissing a random person man wtf?]
$footerIcon[$userAvatar[$botID]]
$else
$description[You need to be a voter to use this command. Use `!vote` and then `!claim`.]
$color[#36393e]
$setVar[voter;false;$authorID]
$setVar[voter-timestamp;;$authorID]
$endif
$nomention
$onlyIf[$guildID!=;]
$allowUserMentions[]
$reply
$if[$message==]
Usage: !buy {item} {amount}
$else
$var[price1;$multi[1000;$message[2;amount]]]
$var[price2;$multi[5000;$message[2;amount]]]
$var[price3;$multi[10000;$message[2;amount]]]
$c[add more price variables as you add more items and the number inside multi is the actual price btw]
$if[$toLowercase[$message[1;item]==item1]]
$onlyIf[$getVar[clicker;$authorID]>=$var[price1];You don't have enough clicks to buy this item.]
$description[Successfully bought `$message[2;amount]` Item 1(s).]
$color[#2F3136]
$setVar[item1;$sum[$getVar[item1;$authorID];$message[2;amount]];$authorID]
$setVar[clicker;$sub[$getVar[clicker;$authorID];$var[price1]];$authorID]
$elseif[$toLowercase[$message[1;item]==item2]]
$onlyIf[$getVar[clicker;$authorID]>=$var[price2];You don't have enough clicks to buy this item.]
$description[Successfully bought `$message[2;amount]` Item2(s).]
$color[#2F3136]
$var[temp-item2;$multi[$message[2;amount];2]]
$c[The 2 at the end here is because this item gives a +2 multiplier]
$setVar[item2;$sum[$getVar[item2;$authorID];$var[temp-item2]];$authorID]
$setVar[clicker;$sub[$getVar[clicker;$authorID];$var[price2]];$authorID]
$elseif[$toLowercase[$message[1;item]==item3]]
$onlyIf[$getVar[clicker;$authorID]>=$var[price3];You don't have enough clicks to buy this item.]
$description[Successfully bought `$message[2;amount]` Item3(s).]
$color[#2F3136]
$var[temp-item3;$multi[$message[2;amount];3]]
$c[The 3 at the end here is because this item gives a +2 multiplier]
$setVar[item3;$sum[$getVar[item3;$authorID];$var[temp-item3]];$authorID]
$setVar[clicker;$sub[$getVar[clicker;$authorID];$var[price3]];$authorID]
$endif
$endif