Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- from discord.utils import get
- import asyncio
- class main (commands.Cog):
- def _init_(self,client):
- self.client = client
- @commands.command(pass_context = True)
- async def clear(self,ctx, number):
- number = int(number)+1 #Converting the amount of messages to delete to an integer
- counter = 0
- async for x in ctx.message.channel.history(limit=number):
- if counter < number:
- await x.delete()
- counter += 1
- await asyncio.sleep(0.5) #1.2 second timer so the deleting process can be even
- @commands.command(pass_context=True)
- async def spamping(self,ctx,TIME,*,TARGET):
- for i in range(0,int(TIME)):
- await ctx.send("{}".format(TARGET))
- @commands.command(pass_context=True)
- async def ping(self,ctx):
- await ctx.send('pong')
- @commands.command(pass_context=True)
- async def get_guild_list(self,ctx):
- for guild in client.fetch_guilds(limit=150):
- print(guild.name)
- def setup(client):
- client.add_cog(main(client))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement