Advertisement
plytalent

main.py

Sep 8th, 2019
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. from discord.utils import get
  4. import asyncio
  5. class main (commands.Cog):
  6.  def _init_(self,client):
  7.   self.client = client
  8.  @commands.command(pass_context = True)
  9.  async def clear(self,ctx, number):
  10.    number = int(number)+1 #Converting the amount of messages to delete to an integer
  11.    counter = 0
  12.    async for x in ctx.message.channel.history(limit=number):
  13.     if counter < number:
  14.      await x.delete()
  15.      counter += 1
  16.      await asyncio.sleep(0.5) #1.2 second timer so the deleting process can be even
  17.  @commands.command(pass_context=True)
  18.  async def spamping(self,ctx,TIME,*,TARGET):
  19.   for i in range(0,int(TIME)):
  20.    await ctx.send("{}".format(TARGET))
  21.  @commands.command(pass_context=True)
  22.  async def ping(self,ctx):
  23.    await ctx.send('pong')
  24.  @commands.command(pass_context=True)
  25.  async def get_guild_list(self,ctx):
  26.    for guild in client.fetch_guilds(limit=150):
  27.     print(guild.name)
  28.  
  29. def setup(client):
  30.  client.add_cog(main(client))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement