-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
62 lines (29 loc) · 1.11 KB
/
main.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import discord
from discord.ext import commands
import random
import os
#from keep_alive import keep_alive
intents = discord.Intents().all()
client = commands.Bot(command_prefix = '.',intents = intents)
@client.event
async def on_command_error(ctx,error):
if isinstance(error,commands.CommandNotFound):
await ctx.send('Error:No Such Command Available!')
@client.command()
async def load(ctx, extension):
client.load_extension(f'cogs.{extension}')
await ctx.send ('loading Cogs')
@client.command()
async def unload(ctx, extension):
client.unload_extension(f'cogs.{extension}')
await ctx.send ('Unloading Cogs')
@client.command()
async def reload(ctx, extension):
client.unload_extension(f'cogs.{extension}')
client.load_extension(f'cogs.{extension}')
await ctx.send ('Reloading Cogs')
for filename in os.listdir('D:\Work\Coding\Python\Python Projects\Discord BOT Projects\Discord Bot(python) (jingz BOT)\jingz-BOT\cogs'):
if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}')
#keep_alive()
client.run(os.getenv("TOKEN"))