Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import random
- from discord.ext import commands
- from discord.ext.commands import Bot
- bot = commands.Bot(command_prefix='!')
- bot.remove_command('help')
- @bot.command(pass_context=True)
- async def cos(ctx):
- cosine = ctx.message.author
- await bot.send_message(cosine,"```angle or side```")
- await angle(message)
- @bot.command(pass_context=True)
- async def echod(ctx,*, msg):
- await bot.say(msg)
- await bot.delete_message(ctx.message)
- @bot.command()
- async def echo(*,message: str):
- await bot.say(message)
- @bot.command()
- async def math(*,message: str):
- message = message.split(' ')
- message = "".join(message)
- if "+" in message:
- message = message.split("+")
- try:
- await bot.say(int(message[0]) + int(message[1]))
- except:
- await bot.say("```fuck off```")
- if "*" in message:
- message = message.split("*")
- try:
- await bot.say(int(message[0]) * int(message[1]))
- except:
- await bot.say("```fuck off```")
- if "x" in message:
- message = message.split("x")
- try:
- await bot.say(int(message[0]) * int(message[1]))
- except:
- await bot.say("```fuck off```")
- if "-" in message:
- message = message.split("-")
- try:
- await bot.say(int(message[0]) - int(message[1]))
- except:
- await bot.say("```fuck off```")
- if "/" in message:
- message = message.split("/")
- if float(int(message[0])) / float(int(message[1])) == int(message[0]) / int(message[1]):
- try:
- await bot.say(int(message[0]) / int(message[1]))
- except:
- await bot.say("```fuck off```")
- @bot.command(pass_context=True)
- async def game(ctx,*,msg):
- member = ctx.message.author.id
- print (member)
- if member == '177165144193892352':
- print (msg)
- if msg == 'stop':
- await bot.change_presence()
- else:
- await bot.change_presence(game=discord.Game(name=msg))
- else:
- await bot.say("```no```")
- @bot.command(pass_context=True)
- async def kick(ctx,msg):
- member = ctx.message.author.id
- if member == '177165144193892352':
- print (msg)
- msg = msg.split('@')
- msg = "".join(msg)
- msg = msg.split('<')
- msg = "".join(msg)
- msg = msg.split('>')
- msg = "".join(msg)
- msg = msg.split(' ')
- msg = "".join(msg)
- msg = msg.split('!')
- msg = "".join(msg)
- print (msg)
- kick = ctx.message.server.get_member(msg)
- await bot.kick(kick)
- else:
- await bot.say("```fuck off```")
- @bot.command(pass_context=True)
- async def help(ctx):
- helper = ctx.message.author
- await bot.send_message(helper,"```!echo - will echo what you say```")
- await bot.send_message(helper,"```!echod - is like echo but deletes the original message```")
- await bot.send_message(helper,"```!math - will help you do simple math```")
- await bot.send_message(helper,"```you can say hello and hello bot will respond```")
- @bot.event
- async def on_message(message):
- await bot.process_commands(message)
- if message.author == bot.user:
- return
- if message.content.startswith('hello') or message.content.startswith('hi'):
- msg = 'Hello, {0.author.mention} :peanuts:'.format(message)
- await bot.send_message(message.channel,msg)
- if message.content.startswith('help'):
- msg = '```no, use !help```'
- await bot.send_message(message.channel,msg)
- if message.content == 'h' or message.content == 'H':
- await bot.send_message(message.channel,'h')
- async def angle(message):
- if message.content.startswith('1'):
- bot.send_message(message.channel,'h')
- @bot.event
- async def on_ready():
- print('Logged in as')
- print(bot.user.name)
- print(bot.user.id)
- print('------')
- bot.run('NDQ5MjQzNDA3ODQ4NTcwODgw.Deh2Rg.5qWzj6E7pEfOU3FCWLmRx16bM14')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement