Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import random
- import urllib3
- import asyncio
- from itertools import cycle
- #id = 527109606422347807
- TOKEN = 'NzAxMTM4NTA2MTg1MTc5Mjcw.Xptivg.1x9TN826eUr_PgjdOQKfFddn47M'
- client = commands.Bot(command_prefix='.')
- async def remove_role(user):
- await asyncio.sleep(15 * 60)
- id = client.get_guild(527109606422347807)
- role = discord.utils.get(id.roles, name='👨❤️👨Gay')
- await user.remove_roles(role)
- print('Success!')
- @client.event
- async def on_ready():
- id = client.get_guild(527109606422347807)
- await client.change_presence(status=discord.Status.online, activity=discord.CustomActivity(name=''))
- print('Bot is ready.')
- await id.text_channels[0].send('*bip-boop* Ready to go. *bip-boop*')
- @client.event
- async def on_message(message):
- print(f'{message.author.name} has sent a message')
- if message.content == '.whosucks':
- await message.delete()
- await client.process_commands(message)
- @client.command()
- async def test(ctx):
- await ctx.send('test')
- @client.command()
- async def whosucks(ctx):
- def randomUser():
- return client.users[random.randint(0, len(client.users)-1)]
- allowedNames = ['YorKnEz', 'Moog', 'ÆŇĐŘĒŪČÆ', 'InsertNameHere', 'SHUTY14', 'Costin', 'genesisxyz']
- userThatSucks = randomUser()
- while userThatSucks.name not in allowedNames or userThatSucks.name == ctx.message.author.name:
- userThatSucks = randomUser()
- await ctx.send(f'{userThatSucks.mention} sucks.')
- @client.command()
- async def fact(ctx):
- http = urllib3.PoolManager()
- r = http.request('GET', 'http://randomfactgenerator.net/')
- #index = r.data.index('<div id=\'z\'>') + len('<div id=\'z\'>')
- fact = str(r.data)[2162:]
- fact = fact[:fact.index('<')]
- superFact = 'Pala e gay'
- factChance = random.randint(0, 100000)
- if factChance == 1403:
- await ctx.send(superFact)
- else:
- await ctx.send(fact)
- @client.command()
- async def guessnumber(ctx, min = 1, max = 100):
- number = random.randint(int(min), int(max))
- turnCount = 5
- await ctx.send(f'Your game started! Pick a number between {min} and {max}!!! (Lose if you\'re gay)')
- while turnCount:
- guess = await client.wait_for('message')
- if guess.author.name != ctx.author.name:
- await ctx.send(f'Let {ctx.author.name} play!')
- elif guess.author.name == ctx.author.name and not guess.content.isnumeric():
- await ctx.send(f'Invalid format! Choose a number between {min} and {max}.')
- elif guess.author.name == ctx.author.name and int(min) <= int(guess.content) <= int(max):
- if str(number) == guess.content:
- if 6 - turnCount == 1:
- await ctx.send(f'You guessed the number! In only 1 try! Damn!')
- else:
- await ctx.send(f'You guessed the number! In only {6 - turnCount} tries!')
- turnCount = 1
- else:
- if turnCount == 1:
- id = client.get_guild(527109606422347807)
- role = discord.utils.get(id.roles, name = '👨❤️👨Gay')
- await ctx.author.add_roles(role)
- client.loop.create_task(remove_role(ctx.author))
- await ctx.send(f'Ha! You lost, you\'re gay now! The number was {number}!')
- elif number > int(guess.content):
- await ctx.send('Too low!')
- else:
- await ctx.send('Too high!')
- turnCount -= 1
- elif guess.author.name == ctx.author.name and int(min) > int(guess.content) or int(max) < int(guess.content):
- await ctx.send(f'Your number is out of range! Choose a number between {min} and {max}.')
- @client.command()
- async def logout(ctx):
- await ctx.send('Shutting down...')
- await client.change_presence(status=discord.Status.offline)
- await client.close()
- client.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment