Skip to content

Instantly share code, notes, and snippets.

@IAmJSD
Created December 5, 2017 17:21
Show Gist options
  • Save IAmJSD/b905755c1f8ce09f1dfd698c44732a09 to your computer and use it in GitHub Desktop.
Save IAmJSD/b905755c1f8ce09f1dfd698c44732a09 to your computer and use it in GitHub Desktop.
A quick botch of a selfbot to add christmas trees to everyone's names in a server you have permission to do it in. (The commands are !addtrees and !removetrees)
token = ""
# Insert your user token here.
prefix = "!"
# Here is the prefix. Feel free to change if you want.
tree = "🎄"
# A unicode christmas tree.
import discord
import logging
# Imports discord and logging.
logging.basicConfig(level=logging.INFO)
# Sets the logging level.
dclient = discord.Client()
# Imports the discord client.
@dclient.event
async def on_ready():
logging.info("Successfully signed into Discord.")
# Defines on_ready
@dclient.event
async def on_message(message):
if message.author == dclient.user and message.content.startswith(prefix):
cmd = message.content.lstrip(prefix).split(' ')[0].lower()
if cmd == "addtrees":
x = 0
message = await dclient.edit_message(message, "We have started! This might take a while!")
for user in message.server.members:
if not user.display_name.endswith(tree):
try:
await dclient.change_nickname(user, user.display_name + " " + tree)
x = x + 1
except:
pass
await dclient.edit_message(message, str(x) + " nickname(s) changed!")
if cmd == "removetrees":
x = 0
message = await dclient.edit_message(message, "We have started! This might take a while!")
for user in message.server.members:
if user.display_name.endswith(tree):
try:
await dclient.change_nickname(user, user.display_name.rstrip(tree).rstrip(' '))
x = x + 1
except:
pass
await dclient.edit_message(message, str(x) + " nickname(s) changed!")
# Defines on_message.
dclient.run(token, bot=False)
# Starts the selfbot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment