Skip to content

Instantly share code, notes, and snippets.

@IAmJSD
Last active October 16, 2017 17:02
Show Gist options
  • Save IAmJSD/b139736aff01c856d75dd7d50230b0b3 to your computer and use it in GitHub Desktop.
Save IAmJSD/b139736aff01c856d75dd7d50230b0b3 to your computer and use it in GitHub Desktop.
A quick botch of a selfbot to add pumpkins to everyone's names in a server you have permission to do it in. (The commands are !addpumpkins and !removepumpkins)
token = ""
# Insert your user token here.
prefix = "!"
# Here is the prefix. Feel free to change if you want.
pumpkin = "🎃"
# A unicode pumpkin.
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 == "addpumpkins":
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(pumpkin):
try:
await dclient.change_nickname(user, user.display_name + " " + pumpkin)
x = x + 1
except:
pass
await dclient.edit_message(message, str(x) + " nickname(s) changed!")
if cmd == "removepumpkins":
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(pumpkin):
try:
await dclient.change_nickname(user, user.display_name.rstrip(pumpkin).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