This repository was archived by the owner on Oct 25, 2024. It is now read-only.
forked from imf4ll/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
67 lines (53 loc) · 1.72 KB
/
main.py
File metadata and controls
67 lines (53 loc) · 1.72 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
55
56
57
58
59
60
61
62
63
64
65
66
67
import discord
from discord.ext import commands
from dotenv import load_dotenv
import asyncio
import os
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/MSr8SJfR4H", 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"))