-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.py
67 lines (39 loc) · 1.46 KB
/
bot.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
63
64
65
66
import discord
from discord.ext import commands
import random
import pandas as pd
import os
intents = discord.Intents(messages = True, guilds = True, reactions = True, members = True, presences = True)
client = commands.Bot(command_prefix = '!', intents = intents)
@client.event
async def on_member_join(member):
print(f'{member} has joined a server' )
@client.event
async def on_member_remove(member):
print(f'{member} has left')
@client.command()
@commands.has_role('Leaders')
async def load (ctx, extention):
client.load_extension(f'cogs.{extention}')
await ctx.send(f'{extention} was loaded')
@client.command()
@commands.has_role('Leaders')
async def unload (ctx, extention):
client.unload_extension(f'cogs.{extention}')
await ctx.send(f'{extention} was unloaded')
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
print(filename)
client.load_extension(f'cogs.{filename[:-3]}')
@client.command()
@commands.has_role('Leaders')
async def reload(ctx):
for filename in os.listdir('./cogs'):
if filename.endswith('.py'):
client.unload_extension(f'cogs.{filename[:-3]}')
if filename.endswith('.py'):
client.load_extension(f'cogs.{filename[:-3]}')
print('cogs reloaded!')
await ctx.send('Cogs Reloaded!')
Token = open("botkey.txt","r") #haha security, yall thought you could steal my bot key XD
client.run(Token.read())