Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import string
- import re
- import random
- from discord.ext import commands
- # Your bot
- bot = commands.Bot(command_prefix='$')
- insults = ['Fuck you too, ',
- 'Go kill yourself ',
- 'Go commit die ',
- 'No u, ',
- 'You\'re on timeout, ',
- 'If I had a face like yours I’d sue my parents, ',
- 'Don’t think, it might sprain your brain, ',
- 'Don’t feel bad, there are many people who have no talent, ',
- 'Keep talking – someday you’ll say something intelligent, ',
- 'I\'d slap you, but that would be animal abuse, ',
- 'Shock me, say something intelligent, ',
- 'Don\'t you need a license to be that stupid ',
- 'I know you are, but what am I, ']
- @bot.event
- # When the bot is ready this will be called.
- async def on_ready():
- print('Logged in as')
- print(bot.user.name)
- print(bot.user.id)
- print('------')
- @bot.command()
- async def clear(ctx, *args):
- print("ffs")
- mgs = [] #Empty list to put all the messages in the log
- number = int(args[0]) #Converting the amount of messages to delete to an integer
- async for x in Client.logs_from(ctx.message.channel, limit = number):
- mgs.append(x)
- await Client.delete_messages(mgs)
- @bot.event
- # When the bot receives a message this will be called.
- async def on_message(message):
- # If the message's author is a bot (bot is a boolean variable)
- if message.author.bot:
- return
- # An array of words from the message.
- name = ""
- isSuccessful = False
- words = message.content;
- words = ''.join(x for x in words if x.isalnum() or x == ' ')
- words = words.lower()
- a = re.search(r'\b(im)\b', words)
- if (a is None):
- a = re.search(r'\b(i am)\b', words)
- if (a is None):
- a = re.search(r'\b(l am)\b', words)
- if (a is None):
- a = re.search(r'\b(lm)\b', words)
- if (a is not None):
- name = words[a.end():]
- isSuccesful = True
- if (''.join(name).endswith("and")):
- await message.channel.send(random.choice(insults) + message.author.name + ".")
- else:
- await message.channel.send("Hi" + ''.join(name) + ", I'm dad.")
- return
- a = re.search(r'\b(i is)\b', words)
- if (a is not None):
- name = words[a.end():]
- await message.channel.send("Hi" + ''.join(name) + ", I is dad.")
- return
- a = re.search(r'\b(dad)\b', words)
- if (a is None):
- a = re.search(r'\b(dads)\b', words)
- if (a is None):
- a = re.search(r'\b(dad\'s)\b', words)
- if (a is not None):
- await message.channel.send(random.choice(insults) + message.author.name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement