Advertisement
Guest User

Untitled

a guest
May 27th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.13 KB | None | 0 0
  1. import discord
  2.  
  3. import random
  4.  
  5. from discord.ext import commands
  6.  
  7. from discord.ext.commands import Bot
  8.  
  9.  
  10.  
  11. bot = commands.Bot(command_prefix='!')
  12.  
  13. bot.remove_command('help')
  14.  
  15.  
  16.  
  17.  
  18. @bot.command(pass_context=True)
  19. async def cos(ctx):
  20. cosine = ctx.message.author
  21. await bot.send_message(cosine,"```angle or side```")
  22. await angle(message)
  23.  
  24.  
  25. @bot.command(pass_context=True)
  26. async def echod(ctx,*, msg):
  27. await bot.say(msg)
  28. await bot.delete_message(ctx.message)
  29.  
  30.  
  31.  
  32. @bot.command()
  33. async def echo(*,message: str):
  34. await bot.say(message)
  35.  
  36. @bot.command()
  37. async def math(*,message: str):
  38. message = message.split(' ')
  39. message = "".join(message)
  40. if "+" in message:
  41. message = message.split("+")
  42. try:
  43. await bot.say(int(message[0]) + int(message[1]))
  44. except:
  45. await bot.say("```fuck off```")
  46. if "*" in message:
  47. message = message.split("*")
  48. try:
  49. await bot.say(int(message[0]) * int(message[1]))
  50. except:
  51. await bot.say("```fuck off```")
  52. if "x" in message:
  53. message = message.split("x")
  54. try:
  55. await bot.say(int(message[0]) * int(message[1]))
  56. except:
  57. await bot.say("```fuck off```")
  58. if "-" in message:
  59. message = message.split("-")
  60. try:
  61. await bot.say(int(message[0]) - int(message[1]))
  62. except:
  63. await bot.say("```fuck off```")
  64. if "/" in message:
  65. message = message.split("/")
  66. if float(int(message[0])) / float(int(message[1])) == int(message[0]) / int(message[1]):
  67. try:
  68. await bot.say(int(message[0]) / int(message[1]))
  69. except:
  70. await bot.say("```fuck off```")
  71.  
  72.  
  73. @bot.command(pass_context=True)
  74. async def game(ctx,*,msg):
  75. member = ctx.message.author.id
  76. print (member)
  77. if member == '177165144193892352':
  78. print (msg)
  79. if msg == 'stop':
  80. await bot.change_presence()
  81. else:
  82. await bot.change_presence(game=discord.Game(name=msg))
  83. else:
  84. await bot.say("```no```")
  85.  
  86.  
  87. @bot.command(pass_context=True)
  88. async def kick(ctx,msg):
  89. member = ctx.message.author.id
  90. if member == '177165144193892352':
  91. print (msg)
  92. msg = msg.split('@')
  93. msg = "".join(msg)
  94. msg = msg.split('<')
  95. msg = "".join(msg)
  96. msg = msg.split('>')
  97. msg = "".join(msg)
  98. msg = msg.split(' ')
  99. msg = "".join(msg)
  100. msg = msg.split('!')
  101. msg = "".join(msg)
  102. print (msg)
  103. kick = ctx.message.server.get_member(msg)
  104. await bot.kick(kick)
  105. else:
  106. await bot.say("```fuck off```")
  107.  
  108.  
  109.  
  110. @bot.command(pass_context=True)
  111. async def help(ctx):
  112. helper = ctx.message.author
  113. await bot.send_message(helper,"```!echo - will echo what you say```")
  114. await bot.send_message(helper,"```!echod - is like echo but deletes the original message```")
  115. await bot.send_message(helper,"```!math - will help you do simple math```")
  116. await bot.send_message(helper,"```you can say hello and hello bot will respond```")
  117.  
  118.  
  119. @bot.event
  120. async def on_message(message):
  121. await bot.process_commands(message)
  122. if message.author == bot.user:
  123. return
  124. if message.content.startswith('hello') or message.content.startswith('hi'):
  125. msg = 'Hello, {0.author.mention} :peanuts:'.format(message)
  126. await bot.send_message(message.channel,msg)
  127. if message.content.startswith('help'):
  128. msg = '```no, use !help```'
  129. await bot.send_message(message.channel,msg)
  130. if message.content == 'h' or message.content == 'H':
  131. await bot.send_message(message.channel,'h')
  132. async def angle(message):
  133. if message.content.startswith('1'):
  134. bot.send_message(message.channel,'h')
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. @bot.event
  144. async def on_ready():
  145. print('Logged in as')
  146. print(bot.user.name)
  147. print(bot.user.id)
  148. print('------')
  149.  
  150. bot.run('NDQ5MjQzNDA3ODQ4NTcwODgw.Deh2Rg.5qWzj6E7pEfOU3FCWLmRx16bM14')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement