-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
70 lines (55 loc) · 1.98 KB
/
Main.py
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
68
69
70
import discord
from discord.ext import commands
import json
import pymongo
from diffusers import AutoPipelineForText2Image
import torch
# Here I proceed to read the token
def readToken():
with open("Token.txt", 'r') as File:
lines = File.readlines()
return lines[0].strip()
token = readToken()
intents = discord.Intents.all()
intents.members = True
client2 = pymongo.MongoClient("mongodb+srv://Quatara:[email protected]/Quatara?retryWrites=true&w=majority")
def get_prefix(client, message):
#Loading the DB to read the prefix through the guild id
prefixes = dict(client2["Quatara"]["Data"].find_one({"_id": "Prefixes"}))
return prefixes[str(message.guild.id)]
class YeetBot (commands.Bot):
def __init__(self):
super().__init__(
command_prefix = get_prefix,
intents = intents,
case_insensitive = True,
self_bot = False,
activity = discord.Activity(type=discord.ActivityType.competing, name = "Yolo!!!!!!"),
)
self.pipe = AutoPipelineForText2Image.from_pretrained(
"runwayml/stable-diffusion-v1-5", torch_dtype=torch.float32, use_safetensors=True
)
self.db = client2["Quatara"]
self.col = self.db["Data"]
self.version = "v2.2.1"
self.author = 305403872438910977
Client = YeetBot()
@Client.event
async def on_ready():
print("Da return of da yeeeeet!!!")
await Client.load_extension("Misc")
await Client.load_extension("Moderation")
await Client.load_extension("Fun")
await Client.load_extension("Math")
await Client.load_extension("Logging")
await Client.load_extension("Utility")
await Client.load_extension("Conversions")
await Client.load_extension("ML")
await Client.tree.sync()
@Client.command(hidden= True)
async def reload(ctx, Cog):
await Client.reload_extension(Cog)
await Client.tree.sync()
await ctx.send("Cog reloaded!")
if __name__ == "__main__":
Client.run(token)