Skip to content

Commit

Permalink
Build fundamental parts of new bot
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSlui committed Jul 30, 2024
1 parent 078b22a commit 3ec7ba3
Show file tree
Hide file tree
Showing 25 changed files with 380 additions and 552 deletions.
25 changes: 0 additions & 25 deletions cogs/blacklist.py

This file was deleted.

37 changes: 0 additions & 37 deletions cogs/checkip.py

This file was deleted.

55 changes: 0 additions & 55 deletions cogs/cogs.py

This file was deleted.

34 changes: 0 additions & 34 deletions cogs/error.py

This file was deleted.

40 changes: 0 additions & 40 deletions cogs/info.py

This file was deleted.

52 changes: 0 additions & 52 deletions cogs/internallogs.py

This file was deleted.

30 changes: 0 additions & 30 deletions cogs/setserver.py

This file was deleted.

66 changes: 0 additions & 66 deletions cogs/status.py

This file was deleted.

41 changes: 41 additions & 0 deletions config/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from config.vault import get_vault

class Settings:
def __init__(self):
self.environment = "development"
self.debug = False
self.seeding = False
self.migrations = True

def get_setting(self, setting):
return self.__getattribute__(setting)

def get_settings(self):
return self

def get_environment(self):
return self.environment

def set_environment(self, environment: str):
allowed_environments = ["prod", "production", "development", "dev", "testing"]
environment = environment.lower()
if any(allowed_environment in environment for allowed_environment in allowed_environments):
self.environment = environment
return {'message': 'Environment successfully set to {}'.format(environment), 'code': 200}

raise ValueError('Environment {} is not valid. Must be one of following values: {}'.format(environment, allowed_environments))

@staticmethod
def get_token():
vault = get_vault()
return vault.token

@staticmethod
def get_hostname():
vault = get_vault()
return vault.hostname

@staticmethod
def get_database():
vault = get_vault()
return vault.database
9 changes: 9 additions & 0 deletions config/directories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Directories:
migrations = f"database/migrations"
seeders = f"database/seeders"

def get_directory(self, directory):
return self.__getattribute__(directory)

def get_directories(self):
return self
Loading

0 comments on commit 3ec7ba3

Please sign in to comment.