naman1601

Nor Server Insult Bot

Sep 14th, 2021 (edited)
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.92 KB | None | 0 0
  1. import discord
  2. import random
  3. import os
  4.  
  5. client = discord.Client()
  6.  
  7. @client.event
  8. async def on_ready():
  9.     print('We have logged in as {0.user}'.format(client))
  10.  
  11. @client.event
  12. async def on_message(message):
  13.  
  14.     if message.author == client.user:
  15.         return
  16.  
  17.     # await message.channel.send(message.author)
  18.  
  19.     auth = message.author
  20.  
  21.     generalmessages = ['are you guys listening to this noob!?!?',
  22.                         'if life is a feature then you are a bug',
  23.                         'go back to leetcode',
  24.                         'that\'s what she said',
  25.                         'did you really just say that?',
  26.                         'go rethink your life, noob',
  27.                         'what a clown']
  28.  
  29.     adminmessages = ['omg mr admin hi', 'ask not what the server can do for you, but what you can do for the server']
  30.     redmessages = ['there\'s a reason bricks are painted red', 'i did not know rating inflation made newbies become red', 'Get a life bruh! when she said its not hard enough you tried to solve a 3500 rated problem']
  31.     yellowemssages = ['you\'re not even red, fuck data structures and go learn some binary search', 'you are not red; you are not purple; you are just wasting your time']
  32.     purplemessages = ['thank you for your service as a member of the free fodder of division 1', 'what does it feel like to be at the bottom of the food chain?']
  33.     expertmessages = ['blue blue orz', 'you are not even purple smh my head', 'lmao you in that useless place between div3 and div1', 'did you know that expert is the most common rank on CodeForces? you are so below average smh']
  34.     specialistmessages = ['bruh why tf you still cyan', 'imagine div3s being rated holyfuck', 'you are still at the rank CodeForces gave you when you joined; think about that']
  35.     pupilmessages = ['you are in fooking rating deficit smh my head', 'bruh someone deport these green idiots to CodeForces Junior or something', 'someone ban this greedian already']
  36.     newbiemessages = ['holy shit, just quit CP already', 'bruh someone deport these grey idiots to CodeForces Junior or something', 'lmao who tf asked your opinion, grey noob?', 'how the fuck can someone even be at grey even after their first 6 contests; like how tf is it even possible; how do you fooking do it lmao']
  37.  
  38.     p = random.randint(1, 100)
  39.     prob = 75
  40.     generalprob = 50
  41.  
  42.     if(message.content == "insult me"):
  43.         prob = random.choice([prob - 1, prob + 1, prob + 2])
  44.  
  45.     if p >= 1 and p <= prob:
  46.         return
  47.  
  48.     prob = random.randint(1, 100)
  49.  
  50.     if(prob <= generalprob):
  51.         await message.channel.send(random.choice(generalmessages))
  52.         return
  53.  
  54.     if "admin" in [y.name.lower() for y in auth.roles]:
  55.         await message.channel.send("omg mr admin hi")
  56.  
  57.     elif ("grandmaster" in [y.name.lower() for y in auth.roles]) or ("international grandmaster" in [y.name.lower() for y in auth.roles]):
  58.             await message.channel.send(random.choice(redmessages))
  59.  
  60.     elif ("master" in [y.name.lower() for y in auth.roles]) or ("international master" in [y.name.lower() for y in auth.roles]):
  61.             await message.channel.send(random.choice(yellowemssages))
  62.  
  63.     elif ("candidate master" in [y.name.lower() for y in auth.roles]):
  64.             await message.channel.send(random.choice(purplemessages))
  65.  
  66.     elif "expert" in [y.name.lower() for y in auth.roles]:
  67.         await message.channel.send(random.choice(expertmessages))
  68.  
  69.     elif "specialist" in [y.name.lower() for y in auth.roles]:
  70.         await message.channel.send(random.choice(specialistmessages))
  71.  
  72.     elif "pupil" in [y.name.lower() for y in auth.roles]:
  73.         await message.channel.send(random.choice(pupilmessages))
  74.  
  75.     elif "newbie" in [y.name.lower() for y in auth.roles]:
  76.         await message.channel.send(random.choice(newbiemessages))
  77.  
  78.  
  79. tokenfile = open('lairtoken.txt', 'r')
  80. tokenstring = tokenfile.read()
  81.  
  82. client.run(tokenstring)
Add Comment
Please, Sign In to add comment