Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Trigger: !giveaway
- $nomention
- $onlyIf[$guildID!=;this code only works in a server]
- $onlyIf[$scriptLanguage==BDScript 2;❌ Dieser Code funktioniert nur mit BDScript 2!]
- $argsCheck[>0;❌ Bitte gib einen Preis an! Beispiel: !giveaway Nitro Basic]
- $c[Variablen prüfen]
- $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
- $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
- $c[Dummy-Wert festlegen, damit es nie leer ist]
- $setVar[giveawayParticipants;]
- $c[Speichere den Preis]
- $setVar[giveawayPrice;$message]
- $c[Teilnehmerliste splitten mit ; Separator]
- $textSplit[$getVar[giveawayParticipants];\;]
- $c[Zähle Teilnehmer abzüglich Dummy-Eintrag]
- $var[participantCount;$sub[$getTextSplitLength;1]]
- $title[🎉 Giveaway gestartet!]
- $description[
- 🎁 **Preis:** $getVar[giveawayPrice]
- 👤 $var[participantCount] Teilnehmer
- Klicke auf den Button, um teilzunehmen!
- Der Gewinner wird später per Knopfdruck ausgelost.]
- $footer[Veranstaltet von $username]
- $color[#3498db]
- $addButton[yes;join_giveaway;🎟️ Teilnehmen;primary]
- $addButton[yes;pick_winner;🎉 Gewinner ziehen;success]
- $thumbnail[https://cdn.discordapp.com/attachments/1014172909448732774/1350428514746241054/NA_TadaIcon.png?ex=67d6b40f&is=67d5628f&hm=9375a70ca4e858d512092d0cd77024c17677c2f82dc3c10809055e1c72c14155&]
- _____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
- Trigger: $onInteraction
- $nomention
- $onlyIf[$guildID!=;this code only works in a server]
- $onlyIf[$scriptLanguage==BDScript 2;❌ Dieser Code funktioniert nur mit BDScript 2!]
- $c[Variablen prüfen]
- $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
- $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
- $c[Interaktionskontrolle]
- $if[$customID==join_giveaway]
- $removeButtons
- $ephemeral
- $c[Prüfe, ob User bereits teilgenommen hat]
- $if[$checkContains[$getServerVar[giveawayParticipants];$authorID]==false]
- $c[Füge User zur Teilnehmerliste hinzu]
- $setServerVar[giveawayParticipants;$getServerVar[giveawayParticipants]$authorID\;]
- $c[Splitte die neue Teilnehmerliste und zähle]
- $textSplit[$getServerVar[giveawayParticipants];\;]
- $title[🎉 Teilnahme bestätigt!]
- $description[
- ✅ **$username** hat erfolgreich teilgenommen!
- 🎁 **Preis:** $getServerVar[giveawayPrice]
- 👤 $getTextSplitLength Teilnehmer]
- $footer[Veranstaltet von $username]
- $color[#2ecc71]
- $else
- $c[Entferne User aus Teilnehmerliste]
- $setServerVar[giveawayParticipants;$replaceText[$getServerVar[giveawayParticipants];$authorID\;;]]
- $c[Splitte die neue Teilnehmerliste und zähle]
- $textSplit[$getServerVar[giveawayParticipants];\;]
- $title[🚫 Teilnahme zurückgezogen!]
- $description[
- ❌ **$username** wurde vom Giveaway entfernt!
- 🎁 **Preis:** $getServerVar[giveawayPrice]
- 👤 $getTextSplitLength Teilnehmer]
- $footer[Veranstaltet von $username]
- $color[#e74c3c]
- $endif
- $else
- $if[$customID==pick_winner]
- $removeButtons
- $varExistError[giveawayParticipants;❌ Bitte erstelle die Variable giveawayParticipants]
- $varExistError[giveawayPrice;❌ Bitte erstelle die Variable giveawayPrice]
- $c[Splitte Teilnehmerliste]
- $textSplit[$getServerVar[giveawayParticipants];\;]
- $c[Prüfe ob Teilnehmer vorhanden sind]
- $if[$getTextSplitLength>0]
- $c[Ziehe zufälligen Index für Gewinner]
- $var[winnerIndex;$random[1;$getTextSplitLength]]
- $c[Hole UserID aus splitText mit Index]
- $var[winner;$splitText[$var[winnerIndex]]]
- $title[🎊 Giveaway Gewinner!]
- $description[
- Herzlichen Glückwunsch <@$var[winner]>!
- Du hast $getServerVar[giveawayPrice] gewonnen! 🎉]
- $footer[Veranstaltet von $username]
- $color[#f1c40f]
- $c[Prüfe, ob der Gewinner existiert, bevor eine DM gesendet wird]
- $if[$var[winner]!=]
- $channelSendMessage[$dmChannelID[$var[winner]];🎉 Glückwunsch! Du hast **$getServerVar[giveawayPrice]** im Giveaway gewonnen! Bitte kontaktiere das Team für weitere Infos.]
- $else
- $c[Kein Gewinner wurde gezogen]
- $title[Fehler]
- $description[❌ Es wurde kein Gewinner gefunden!]
- $footer[Veranstaltet von $username]
- $color[#e74c3c]
- $endif
- $setServerVar[giveawayParticipants;]
- $else
- $title[🎉 Giveaway gestartet!]
- $description[
- ❌ **Es gibt keine Teilnehmer!**
- 🎁 **Preis:** $getServerVar[giveawayPrice]]
- $footer[Veranstaltet von $username]
- $color[#3498db]
- $endif
- $endif
- $endif
Advertisement
Add Comment
Please, Sign In to add comment