Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. import discord
  2. import os
  3. from discord.ext import commands, tasks
  4. from itertools import cycle
  5.  
  6. client = commands.Bot(command_prefix = 'c#')
  7. status = cycle(['Visual Studio', 'Random stuff', 'Tablist lmao', 'Minecraft', 'do c#help for help'])
  8.  
  9. @client.command()
  10. async def load(ctx, extension):
  11. client.load_extension(f'cogs.{extension}')
  12.  
  13. @client.command()
  14. async def unload(ctx, extension):
  15. client.unload_extension(f'cogs.{extension}')
  16.  
  17. for filename in os.listdir('./cogs'):
  18. if filename.endswith('.py'):
  19. client.load_extension(f'cogs.{filename[:-3]}')
  20.  
  21. @client.event
  22. async def on_ready():
  23. change_status.start()
  24. print('Bot Ready!')
  25.  
  26. @client.command()
  27. async def kick(ctx, member : discord.Member, *, reason=None):
  28. await member.kick(reason=reason)
  29. print('member was kicked')
  30. await ctx.send(f'kicked {user.mention}')
  31.  
  32. @client.command()
  33. async def ban(ctx, member : discord.Member, *, reason=None):
  34. await member.ban(reason=reason)
  35. print('member was banned')
  36. await ctx.send(f'banned {user.mention}')
  37.  
  38. @client.command()
  39. async def unban(ctx, *, member):
  40. banned.users = await ctx.guild.bans()
  41. member_name, member_discriminator = member.split('#')
  42.  
  43. for ban_entry in banned_users:
  44. user = ban_entry.user
  45.  
  46. if (user.name, user.discriminator) == (member_name, member_discriminator):
  47. await ctx.guild.unban(user)
  48. await ctx.send(f'Unbanned {user.mention}')
  49. return
  50.  
  51. @client.event
  52. async def on_member_join(member):
  53. print(f'{member} has joined {member.guild.name}.')
  54.  
  55. # Commands
  56. @client.command()
  57. async def donate(ctx):
  58. print('link sent')
  59. await ctx.send(" Have to fix. i was an idiot lmao ")
  60.  
  61. @client.command()
  62. async def clean(ctx, amount=1):
  63. print('Cleaning Chat')
  64. await ctx.channel.purge(limit=amount)
  65. print('Done!')
  66.  
  67. @client.command()
  68. async def link(ctx):
  69. await ctx.send("here!")
  70. await ctx.send("https://discordapp.com/api/oauth2/authorize?client_id=586259055652372492&permissions=8&scope=bot")
  71.  
  72. @client.command()
  73. async def develop(ctx):
  74. print ('Fuck.. they know my secrets! ABORT ABORT!')
  75. await ctx.send("I use visual studio community to code my bots! So does JakubPlaus.")
  76. await ctx.send("he told me that i sould make my own bot.")
  77. await ctx.send("JakubPlaus: i use vs code as faster load, i use vs community for bigger projects")
  78. await ctx.send("Codys Development")
  79.  
  80. @tasks.loop(seconds=5)
  81. async def change_status():
  82. await client.change_presence(activity=discord.Game(next(status))
  83.  
  84. client.run('NoPe')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement