-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (21 loc) · 746 Bytes
/
main.py
File metadata and controls
29 lines (21 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = 'h!')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.online, activity=discord.Game('Idk'))
print('Bot is now online')
@client.event
async def on_message_error(ctx, error):
pass
@client.command()
async def delete(ctx, amount : int):
await ctx.channel.purge(limit=amount)
@client.command()
async def ping(ctx):
await ctx.send('Pong! Your ping latency is {0}!'.format(round(client.latency * 1000)))
@delete.error
async def delete_error(ctx, error):
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send('Please specify a amount of messsage to delete')
client.run('Your Token')