:spakles: Database and OOP
This commit is contained in:
20
Gwendolyn.py
20
Gwendolyn.py
@ -2,7 +2,7 @@ import discord, os, finnhub, pymongo
|
||||
|
||||
from discord.ext import commands
|
||||
from pymongo import MongoClient
|
||||
from funcs import logThis, makeFiles, transferUsers
|
||||
from funcs import logThis, makeFiles, transferUsers, Money, Funcs, SwChar, SwDestiny, SwRoll, Games
|
||||
|
||||
commandPrefix = "!"
|
||||
|
||||
@ -30,8 +30,22 @@ class Gwendolyn(commands.Bot):
|
||||
self.options = Options()
|
||||
self.credentials = Credentials()
|
||||
self.finnhubClient = finnhub.Client(api_key = self.credentials.finnhubKey)
|
||||
self.MongoClient = MongoClient(f"mongodb+srv://{self.credentials.mongoDBUser}:{self.credentials.mongoDBPassword}@gwendolyn.qkwfy.mongodb.net/Gwendolyn-Test?retryWrites=true&w=majority")
|
||||
self.database = self.MongoClient["Gwendolyn-Test"]
|
||||
self.MongoClient = MongoClient(f"mongodb+srv://{self.credentials.mongoDBUser}:{self.credentials.mongoDBPassword}@gwendolyn.qkwfy.mongodb.net/Gwendolyn?retryWrites=true&w=majority")
|
||||
|
||||
if self.options.testing:
|
||||
self.database = self.MongoClient["Gwendolyn-Test"]
|
||||
else:
|
||||
self.database = self.MongoClient["Gwendolyn"]
|
||||
|
||||
self.swchar = SwChar(self)
|
||||
self.swroll = SwRoll(self)
|
||||
self.swdestiny = SwDestiny(self)
|
||||
|
||||
Games(self)
|
||||
|
||||
self.money = Money(self)
|
||||
self.funcs = Funcs(self)
|
||||
|
||||
super().__init__(command_prefix=commandPrefix, case_insensitive=True)
|
||||
|
||||
# Creates the required files
|
||||
|
Reference in New Issue
Block a user