Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.74 KB | None | 0 0
  1. import discord
  2. import string
  3. import re
  4. import random
  5. from discord.ext import commands
  6.  
  7. # Your bot
  8. bot = commands.Bot(command_prefix='$')
  9. insults = ['Fuck you too, ',
  10.            'Go kill yourself ',
  11.            'Go commit die ',
  12.            'No u, ',
  13.            'You\'re on timeout, ',
  14.            'If I had a face like yours I’d sue my parents, ',
  15.            'Don’t think, it might sprain your brain, ',
  16.            'Don’t feel bad, there are many people who have no talent, ',
  17.            'Keep talking – someday you’ll say something intelligent, ',
  18.            'I\'d slap you, but that would be animal abuse, ',
  19.            'Shock me, say something intelligent, ',
  20.            'Don\'t you need a license to be that stupid ',
  21.            'I know you are, but what am I, ']
  22. @bot.event
  23. # When the bot is ready this will be called.
  24. async def on_ready():
  25.     print('Logged in as')
  26.     print(bot.user.name)
  27.     print(bot.user.id)
  28.     print('------')
  29.  
  30. @bot.command()
  31. async def clear(ctx, *args):
  32.     print("ffs")
  33.     mgs = [] #Empty list to put all the messages in the log
  34.     number = int(args[0]) #Converting the amount of messages to delete to an integer
  35.     async for x in Client.logs_from(ctx.message.channel, limit = number):
  36.         mgs.append(x)
  37.     await Client.delete_messages(mgs)
  38.    
  39. @bot.event
  40. # When the bot receives a message this will be called.
  41. async def on_message(message):
  42.    
  43.     # If the message's author is a bot (bot is a boolean variable)
  44.     if message.author.bot:
  45.         return
  46.  
  47.     # An array of words from the message.
  48.     name = ""
  49.     isSuccessful = False
  50.     words = message.content;
  51.     words = ''.join(x for x in words if x.isalnum() or x == ' ')
  52.     words = words.lower()
  53.     a = re.search(r'\b(im)\b', words)
  54.     if (a is None):
  55.         a = re.search(r'\b(i am)\b', words)
  56.     if (a is None):
  57.         a = re.search(r'\b(l am)\b', words)
  58.     if (a is None):
  59.         a = re.search(r'\b(lm)\b', words)
  60.     if (a is not None):
  61.         name = words[a.end():]
  62.         isSuccesful = True
  63.         if (''.join(name).endswith("and")):
  64.             await message.channel.send(random.choice(insults) + message.author.name + ".")
  65.         else:
  66.             await message.channel.send("Hi" + ''.join(name) + ", I'm dad.")
  67.         return
  68.    
  69.     a = re.search(r'\b(i is)\b', words)
  70.     if (a is not None):
  71.         name = words[a.end():]
  72.         await message.channel.send("Hi" + ''.join(name) + ", I is dad.")
  73.         return
  74.    
  75.     a = re.search(r'\b(dad)\b', words)
  76.     if (a is None):
  77.         a = re.search(r'\b(dads)\b', words)
  78.     if (a is None):
  79.         a = re.search(r'\b(dad\'s)\b', words)
  80.     if (a is not None):
  81.         await message.channel.send(random.choice(insults) + message.author.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement