Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord, string, random
- from discord.ext import commands
- from PIL import Image, ImageDraw, ImageFont
- bot = commands.Bot(command_prefix="..")
- @bot.event
- async def on_ready():
- print('Logged on as {0}!'.format(bot.user))
- @bot.command()
- async def verify(ctx):
- messages = []
- messages.append(ctx.message)
- await ctx.message.channel.delete_messages(messages)
- msg = await ctx.send(f"Hey {ctx.message.author.mention}, Remember to check your DM's!")
- messages.append(msg)
- member = ctx.message.author
- dm = bot.get_user(int(ctx.message.author.id))
- all_verification = discord.Embed(title="All verification types:", description="1.) Captcha\n2.) React\n3.) Math\n4.) Question\n5.) Verify Link")
- all_verification.set_footer(text="Supporter link: https://discord.gg/es8ctcA")
- await dm.send(embed=all_verification)
- msg = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=30)
- if msg.content == "1":
- text = []
- for i in range(15):
- num = random.randint(0, len(string.ascii_letters))
- text.append(string.ascii_letters[num-1])
- img = Image.new('RGB', (150, 35), color=(0, 0, 0))
- d = ImageDraw.Draw(img)
- fnt = ImageFont.truetype('Roboto-Regular.ttf', 15)
- d = ImageDraw.Draw(img)
- d.text((10, 10), "".join(text), font=fnt, fill=(255, 255, 255))
- img.save('captcha.png')
- embed = discord.Embed(title="CAPTCHA! YOU HAVE 30 SECONDS", description="HERE IS THE CODE:", color=discord.colour.Color.gold())
- await dm.send(embed=embed)
- await dm.send(file=discord.File('captcha.png'))
- msg = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=30)
- if str(msg.content) == str("".join(text)):
- channel = bot.get_channel(686472295471906816)
- role = discord.utils.get(ctx.channel.guild.roles, name="Verified")
- await member.add_roles(role)
- await dm.send(f"{ctx.message.author.mention}, You have been verified!")
- else:
- await dm.send("Please try again")
- if msg.content == "2":
- all_reactions = ["😀", "😁", "😂", "😃", "😄", "😅", "😆", "😉", "😊", "😋", "😎", "😍", "😘", "🥰"]
- num = random.randint(0, len(all_reactions)-1)
- random_reaction = all_reactions[num]
- insert = random.randint(1, 5)
- reaction_captcha = discord.Embed(title="React with the correct emoji", description=f"Your emoji is {random_reaction}")
- msg = await dm.send(embed=reaction_captcha)
- all_reactions.pop(num)
- for i in range(5):
- if insert == i:
- await msg.add_reaction(random_reaction)
- else:
- await msg.add_reaction(all_reactions[random.randint(0, len(all_reactions))-1])
- def check(reaction, user):
- return user == ctx.message.author and str(reaction.emoji) == str(random_reaction)
- emj, user = await bot.wait_for('reaction_add', timeout=30, check=check)
- if emj.emoji == str(random_reaction):
- channel = bot.get_channel(686472295471906816)
- role = discord.utils.get(ctx.channel.guild.roles, name="Verified")
- await member.add_roles(role)
- await dm.send(f"{ctx.message.author.mention}, You have been verified!")
- else:
- await dm.send("Please try again")
- elif msg.content == "3":
- first = random.randint(1, 10)
- second = random.randint(1, 10)
- math_embed = discord.Embed(title="This is your math question:", description=f"What is {first}*{second}?")
- math_embed.set_footer(text="Please answer below")
- await dm.send(embed=math_embed)
- msg = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=30)
- if msg.content == str(first*second):
- channel = bot.get_channel(686472295471906816)
- role = discord.utils.get(ctx.channel.guild.roles, name="Verified")
- await member.add_roles(role)
- await dm.send(f"{ctx.message.author.mention}, You have been verified!")
- else:
- await dm.send("Please try again")
- elif msg.content == "4":
- questions = ["What is the last name of the president of ameirca?", "How many cms are in 1m?",
- "What company makes Iphones?", "How many moons does the earth have?",
- "Which country is shaped like a boot?", "How many suns does our solar system have?"]
- answers = ["Trump", "100", "Apple", "1", "Italy", "1"]
- num = random.randint(0, 5)
- question_embed = discord.Embed(title="Answer this question:", description=f"{questions[num]}")
- await dm.send(embed=question_embed)
- msg = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=30)
- if msg.content.lower() == str(answers[num]).lower():
- channel = bot.get_channel(686472295471906816)
- role = discord.utils.get(ctx.channel.guild.roles, name="Verified")
- await member.add_roles(role)
- await dm.send(f"{ctx.message.author.mention}, You have been verified!")
- else:
- await dm.send("Please try again")
- elif msg.content == "5":
- embed = discord.Embed(title="Please verify by pressing", description="[here!](https://strikebot.co.uk/verify)",
- color=discord.colour.Color.green())
- await dm.send(embed=embed)
- await ctx.channel.delete_messages(messages)
- bot.run("NjkzNDIwNzEyMzkxNzM3Mzg1.Xn80cw.SfrOPL7z47qDPNQng2duf36Mmjg")
- #bot.run("NjkyMTM5MDc5MTQzNTIyMzY4.XnqKyA.0ejmwMCYA3lrU3OfcKCTMphqrxk")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement