-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (42 loc) · 1.54 KB
/
main.py
File metadata and controls
54 lines (42 loc) · 1.54 KB
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
import discord
from discord.ext import commands
import os
from dotenv import load_dotenv
import asyncio
load_dotenv()
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix=os.getenv('prefix'), case_insensitive=True, intents=intents)
bot.remove_command('help')
@bot.event
async def on_ready():
print('@================@')
print(' BOT ONLINE ')
print('@================@')
for i in os.listdir('./cogs'):
for e in os.listdir(f'./cogs/{i}'):
if str(e).startswith('__py'):
pass
else:
print('loaded ', e)
bot.load_extension(f'cogs.{i}.{e[:-3]}')
while True:
await bot.change_presence(status=discord.Status.online, activity=discord.Game(name="Codify Community", type=3))
await asyncio.sleep(30)
await bot.change_presence(status=discord.Status.online, activity=discord.Game(name=".help | discord.gg/codify", type=3))
await asyncio.sleep(30)
await bot.change_presence(status=discord.Status.online, activity=discord.Game(name="Beta 0.0.1", type=3))
await asyncio.sleep(30)
def _reload():
for i in os.listdir('./cogs'):
for e in os.listdir(f'./cogs/{i}'):
if str(e).startswith('__py'):
pass
else:
bot.unload_extension(f'cogs.{i}.{e[:-3]}')
bot.load_extension(f'cogs.{i}.{e[:-3]}')
print('reloaded ', e)
@bot.command()
async def reload(ctx):
_reload()
bot.run(os.getenv('token'))