Advertisement
Guest User

Untitled

a guest
May 26th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.71 KB | None | 0 0
  1. # These are the dependecies. The bot depends on these to function, hence the name. Please do not change these unless your adding to them, because they can break the bot.
  2. import discord
  3. import asyncio
  4. from discord.ext.commands import Bot
  5. from discord.ext import commands
  6. import platform
  7. from modules.cancer import random_string
  8. import random as rng
  9. from modules.nicks import rng_emoji
  10. from os import listdir
  11.  
  12. # Here you can modify the bot's prefix and description and wether it sends help in direct messages or not.
  13. client = Bot(description="ayylmao", command_prefix="[]", pm_help = False)
  14.  
  15. # This is what happens everytime the bot launches. In this case, it prints information like server count, user count the bot is connected to, and the bot id in the console.
  16. # Do not mess with it because the bot can break, if you wish to do so, please consult me or someone trusted.
  17. @client.event
  18. async def on_ready():
  19.     print('Logged in as '+client.user.name+' (ID:'+client.user.id+') | Connected to '+str(len(client.servers))+' servers | Connected to '+str(len(set(client.get_all_members())))+' users')
  20.     print('--------')
  21.     print('Current Discord.py Version: {} | Current Python Version: {}'.format(discord.__version__, platform.python_version()))
  22.     print('--------')
  23.     print('Use this link to invite {}:'.format(client.user.name))
  24.     print('https://discordapp.com/oauth2/authorize?client_id={}&scope=bot&permissions=8'.format(client.user.id))
  25.     print('--------')
  26.     print('Support Discord Server: https://discord.gg/FNNNgqb')
  27.     print('Github Link: https://github.com/Habchy/BasicBot')
  28.     print('--------')
  29.     print('You are running BasicBot v2.1') #Do not change this. This will really help us support you, if you need support.
  30.     print('Created by Habchy#1665')
  31.     return await client.change_presence(game=discord.Game(name='living the good life')) #This is buggy, let us know if it doesn't work.
  32.  
  33. # This is a basic example of a call and response command. You tell it do "this" and it does it.
  34. @client.command('ayylmao')
  35. async def ping(*args):
  36.     await client.say(":alien:")
  37.     await asyncio.sleep(5)
  38.     for i in range(1, 3):
  39.         await asyncio.sleep(10)
  40.         await client.say("this is just a test, please remain calm")
  41.  
  42. @client.command('cancer')
  43. async def cancer():
  44.     await client.say(":alien:")
  45.     for m in client.get_all_members():
  46.         try:
  47.             await client.change_nickname(m, random_string())
  48.         except:
  49.             print("error")
  50.     await client.say(":white_check_mark:")
  51.  
  52. @client.command('resetnicks')
  53. async def resetnicks():
  54.     await client.say(":star:")
  55.     for m in client.get_all_members():
  56.         try:
  57.             await client.change_nickname(m, "")
  58.         except:
  59.             print("error")
  60.     await client.say(":white_check_mark:")
  61.  
  62. @client.command('setnicknames')
  63. async def setnicknames(*args):
  64.     if len(args) == 0:
  65.         await client.say(":x:")
  66.         return
  67.     await client.say(":star:")
  68.     for m in client.get_all_members():
  69.         try:
  70.             await client.change_nickname(m, rng.choice(args))
  71.         except:
  72.             print("error")
  73.     await client.say(":white_check_mark:")
  74.  
  75. @client.command('everyone')
  76. async def everyone(*args):
  77.     message = ""
  78.     if len(args) > 0:
  79.         message = " ".join(args)
  80.     for i in range(1, 3):
  81.         await asyncio.sleep(10)
  82.         await client.say("@everyone {0}".format(message))
  83.  
  84. @client.command('b')
  85. async def b(*args):
  86.     if len(args) == 0:
  87.         await client.say(":x:")
  88.         return
  89.     message = " ".join(args)
  90.     message = message.replace("b", ":b:")
  91.     message = message.replace("B", ":b:")
  92.     await client.say(message)
  93.  
  94. @client.command('bd')
  95. async def bd(*args):
  96.     if len(args) == 0:
  97.         await client.say(":x:")
  98.         return
  99.     message = " ".join(args)
  100.     message = message.replace("b", ":b:")
  101.     message = message.replace("B", ":b:")
  102.     message = message.replace("d", ":b:")
  103.     message = message.replace("D", ":b:")
  104.     await client.say(message)
  105.  
  106. @client.command('thinktank')
  107. async def thinktank():
  108.     await client.say(":thinking:")
  109.     for m in client.get_all_members():
  110.         try:
  111.             await client.change_nickname(m, '🤔')
  112.         except:
  113.             print("error")
  114.     await client.say(":white_check_mark:")
  115.  
  116. @client.command('surrealism')
  117. async def surrealism():
  118.     await client.say(":cancer:")
  119.     for m in client.get_all_members():
  120.         try:
  121.             await client.change_nickname(m, rng_emoji())
  122.         except:
  123.             print("error")
  124.     await client.say(":white_check_mark:")
  125.  
  126. @client.command('ass', pass_context=True)
  127. async def ass(ctx):
  128.     with open("images/car_porn.jpg") as f:
  129.         await client.send_file(ctx.message.channel, "images/car_porn.jpg")
  130.  
  131. @client.command('surrealmeme')
  132. async def surrealmeme():
  133.     with open("files/images.txt", "r") as f:
  134.         await client.say(rng.choice(f.readlines()))
  135.  
  136. @client.command('surrealmemes')
  137. async def surrealmemes(*args):
  138.     if len(args) != 1:
  139.         await client.say(":x:")
  140.         return
  141.     with open("files/images.txt", "r") as f:
  142.         lines = f.readlines()
  143.         for i in range(0, int("".join(args[0]))):
  144.             await client.say(rng.choice(lines))
  145.  
  146. @client.command('programmerhumor')
  147. async def programmerhumor():
  148.     with open("files/programmerhumor.txt", "r") as f:
  149.         await client.say(rng.choice(f.readlines()))
  150.  
  151. @client.command('programmerhumors')
  152. async def programmerhumors(*args):
  153.     if len(args) != 1:
  154.         await client.say(":x:")
  155.         return
  156.     with open("files/programmerhumor.txt", "r") as f:
  157.         lines = f.readlines()
  158.         for i in range(0, int("".join(args[0]))):
  159.             await client.say(rng.choice(lines))
  160.  
  161.  
  162. @client.command('aesthetic')
  163. async def VaporwaveAesthetic():
  164.     with open("files/VaporwaveAesthetics.txt", "r") as f:
  165.         await client.say(rng.choice(f.readlines()))
  166.  
  167. @client.command('aesthetics')
  168. async def VaporwaveAesthetics(*args):
  169.     if len(args) != 1:
  170.         await client.say(":x:")
  171.         return
  172.     with open("files/VaporwaveAesthetics.txt", "r") as f:
  173.         lines = f.readlines()
  174.         for i in range(0, int("".join(args[0]))):
  175.             await client.say(rng.choice(lines))
  176.    
  177. client.run('NDQ5OTc1NTkxNDk2NTgxMTIx.DeshkA.odYIF5YjubUJQ_xV8ds1JaBWDJw')
  178.  
  179. #@client.command('surrender')
  180. #async def surrender():
  181. #   await client.say(":alien:")
  182. #   for c in client.get_all_channels():
  183. #       await client.edit_channel(c, name="ayylmao")
  184. # After you have modified the code, feel free to delete the line above so it does not keep popping up everytime you initiate the ping commmand.
  185.  
  186.  
  187. # Basic Bot was created by Habchy#1665
  188. # Please join this Discord server if you need help: https://discord.gg/FNNNgqb
  189. # Please modify the parts of the code where it asks you to. Example: The Prefix or The Bot Token
  190. # This is by no means a full bot, it's more of a starter to show you what the python language can do in Discord.
  191. # Thank you for using this and don't forget to star my repo on GitHub! [Repo Link: https://github.com/Habchy/BasicBot]
  192.  
  193. # The help command is currently set to be not be Direct Messaged.
  194. # If you would like to change that, change "pm_help = False" to "pm_help = True" on line 9.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement