Skip to content

Commit 2d9c0b5

Browse files
feat: lay foundations move to src
1 parent 13751c3 commit 2d9c0b5

File tree

7 files changed

+61
-1
lines changed

7 files changed

+61
-1
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TOKEN="Replace me with your bot token"

glykon/bot.py

Whitespace-only changes.

main.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
from src import Glykon
3+
4+
if __name__ == "__main__":
5+
6+
if not ".env" in os.listdir():
7+
8+
print("⇒ Running configurations")
9+
10+
token = input("🔴 paste your bot's token 🔴:")
11+
with open(".env", "x") as f:
12+
f.write(f"TOKEN='{token}'")
13+
14+
Glykon().run()

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
disnake
1+
disnake
2+
python-dotenv

src/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .bot import Glykon

src/bot.py

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import os
2+
from disnake import Intents
3+
from disnake.ext.commands import (
4+
Bot
5+
)
6+
7+
from dotenv import load_dotenv
8+
load_dotenv(dotenv_path="./.env")
9+
TOKEN=os.getenv("TOKEN")
10+
11+
class Glykon(Bot):
12+
def __init__(self):
13+
super().__init__(
14+
command_prefix="changeme",
15+
case_insensitive=True,
16+
help_command= None, # type: ignore
17+
intents=Intents.all()
18+
)
19+
20+
def loadCogs(self) -> None:
21+
for file in os.listdir("./src/cogs"):
22+
if file.startswith("_"): continue
23+
if not file.endswith("py"): self.load_extension(f"src.cogs.{file}")
24+
self.load_extension(f"src.cogs.{file[:-3]}")
25+
26+
async def on_ready(self) -> None:
27+
print(
28+
f"""
29+
───── ⋆⋅☆⋅⋆ ─────
30+
WELCOME TO {self.user.display_name}
31+
⤷ Servers 💿: {len(self.guilds)}
32+
⤷ Users 👥: {len(self.users)}
33+
⤷ Cogs ⚙️: {len(self.cogs)}
34+
───── ⋆⋅☆⋅⋆ ─────
35+
36+
Status: Ready 🟢
37+
"""
38+
)
39+
40+
41+
def run(self) -> None:
42+
self.loadCogs()
43+
super().run(TOKEN, reconnect=True)

cogs/help.py renamed to src/src.md

File renamed without changes.

0 commit comments

Comments
 (0)