Skip to content

Commit

Permalink
Create __main__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vasusen-code authored Dec 9, 2021
1 parent 769e66f commit 1d4de2d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions main/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import glob
from pathlib import Path
from main.utils import load_plugins
import logging
from . import bot

logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
level=logging.WARNING)

path = "main/plugins/*.py"
files = glob.glob(path)
for name in files:
with open(name) as a:
patt = Path(a.name)
plugin_name = patt.stem
load_plugins(plugin_name.replace(".py", ""))

print("Successfully deployed!")

if __name__ == "__main__":
bot.run_until_disconnected()

0 comments on commit 1d4de2d

Please sign in to comment.