-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
36 lines (26 loc) · 1.02 KB
/
Copy pathMain.py
File metadata and controls
36 lines (26 loc) · 1.02 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
import os
import discord
import signal
import sys
from discord.ext import commands
from Generic.Accessors.File import File
from Context import Context
from Libraries.Movie.Utilities import Utilities
from discord_slash import SlashCommand
context = Context.instance()
Login to the movie site before logging in.
Utilities().try_login(context.settings["movie_settings"]["username"], context.settings["movie_settings"]["password"])
intents = discord.Intents.default()
intents.members = True
intents.reactions = True
client = commands.Bot(command_prefix = "!", self_bot = True, intents = intents)
slash = SlashCommand(client)
for file_name in os.listdir("{}/{}".format(context.root_path, "Commands")):
if file_name.endswith(".py"):
client.load_extension("Commands.{}".format(file_name[:-3]))
client.joined_members = []
client.run(context.settings["bot_settings"]["token"])
def shutdown_handler(signature, frame):
print("Shutting down webdriver.")
context.webdriver.close()
signal.signal(signal.SIGINT, shutdown_handler)