Pre-Deployment Still bugged as hell.

This commit is contained in:
2021-07-26 18:54:28 +01:00
parent e30e89e7e3
commit 7916b1fca6
15 changed files with 76 additions and 186 deletions

View File

@ -1,4 +1,4 @@
FROM python:3.8.6-buster
FROM python:3.9.6-alpine
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN pip install --upgrade pip

View File

@ -60,13 +60,12 @@ if len(set(l)) != len(l): raise Exception('Config Error: there is a clash betwee
# Locate Cogs Directory
cogsDir = 'cogs'
# --> Temporary disable logging because of verboseness.
# ## Logging configuration imported boilerplate from Discord Py Docs
# logger = logging.getLogger('discord')
# logger.setLevel(logging.DEBUG)
# handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
# handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
# logger.addHandler(handler)
## Logging configuration imported boilerplate from Discord Py Docs
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)
#### Dynamic Prefixes
def getPrefix(client, message):
@ -285,4 +284,4 @@ if yaml_load(configFile):
if any([len(yaml_load(configFile)[x]['membership']) > 0 for x in yaml_load(configFile)]):
loadCog(f'./{cogsDir}/slashcommands/secondary/edit_membership.py')
client.run(os.getenv('TEST_3_TOKEN'))
client.run(os.getenv('BOT_TOKEN'))

View File

@ -69,7 +69,7 @@ class Migrate(commands.Cog, name='Migrate Command'):
await r.edit(
reason=f'`migrate` command issued by {ctx.author.display_name}',
mentionable=True,
colour=discord.Colour.green
colour=discord.Colour.green()
)
c = discord.utils.get(ctx.guild.categories, name=r.name)
if c is None:

View File

@ -97,7 +97,7 @@ class Configuration(commands.Cog, name='Configuration Commands'):
permissions=discord.Permissions(administrator=True) if key == 'committee' else discord.Permissions().none(),
reason=f'`/config roles` command issued by {ctx.author.display_name}',
colour = discord.Colour.orange() if key == 'bot' else discord.Colour.blue() if key == 'committee' else discord.Colour.default(),
hoist=True if key == 'committee' else None,
hoist=True if key == 'committee' or key == 'bot' else None,
)
conf = yaml_load(configFile)
guildStr = str(ctx.guild.id)

View File

@ -1,4 +0,0 @@
'864651943820525609':
'868506573700468787': 868506572421234718
'868506638720577586': 868506637252583494
'868506722187227166': 868506720375300137

View File

@ -1,26 +0,0 @@
'864651943820525609':
channels:
help: 866645822472454206
mod: 865348933022515220
signup: 868523157680693278
configured: true
membership:
- 866795009121714207
name: Test
notifications:
help: true
signup: true
owner: 493694762210033664
prefix: '-'
restrict: false
roles:
admin:
- 866642278529368095
bot: 866639184121954305
committee: 866642278529368095
newcomer: 866645308091138060
returning_player: 866645365524660224
student: 866645394699714570
timeslots:
avatar: Avatar Time
shera: She Ra Time

View File

@ -1,38 +0,0 @@
'864651943820525609':
avatar:
'868506572421234718':
category: 868506573700468787
current_players: 1
game_title: Kyoshi
gm: 864649599671205914
header_message: 868506578934976543
max_players: 5
min_players: null
platform: null
role: 868506572421234718
system: null
text_channel: 868506576695230534
'868506637252583494':
category: 868506638720577586
current_players: 0
game_title: Roku
gm: 864649599671205914
header_message: 868506642545795142
max_players: 5
min_players: null
platform: null
role: 868506637252583494
system: null
text_channel: 868506640347971655
'868506720375300137':
category: 868506722187227166
current_players: 0
game_title: Aang
gm: 864649599671205914
header_message: 868506726029197312
max_players: 5
min_players: null
platform: null
role: 868506720375300137
system: null
text_channel: 868506724045303878

View File

@ -1,5 +0,0 @@
'864651943820525609':
'864649599671205914':
- 868506572421234718
- 868506637252583494
- 868506720375300137

View File

@ -1,19 +0,0 @@
'864651943820525609':
'868506572421234718':
category: 868506573700468787
game_title: Kyoshi
gm: 864649599671205914
text_channel: 868506576695230534
time: avatar
'868506637252583494':
category: 868506638720577586
game_title: Roku
gm: 864649599671205914
text_channel: 868506640347971655
time: avatar
'868506720375300137':
category: 868506722187227166
game_title: Aang
gm: 864649599671205914
text_channel: 868506724045303878
time: avatar

View File

@ -1 +0,0 @@
{}

View File

@ -8,7 +8,7 @@ from discord_slash import SlashCommand, SlashContext, cog_ext, utils # Slash C
from discord_slash.utils.manage_commands import create_choice, create_option # Slash Command features
from pprint import pprint
from bot import clearConfig, configFile, loadCog, loadCogs, setConfig, unloadCog, unloadCogs, yaml_dump, yaml_load, reloadCog, reloadCogs
from bot import clearConfig, configFile, loadCog, loadCogs, setConfig, unloadCog, unloadCogs, yaml_dump, yaml_load, reloadCog, reloadCogs, pitchesFile, cogsDir
##### Debug Cog
class Debug(commands.Cog, name='Debug Commands'):
@ -152,5 +152,17 @@ class Debug(commands.Cog, name='Debug Commands'):
await self.client.slash.sync_all_commands()
await ctx.reply(f'```All slash commands have been synced with the Server.```')
@commands.command(
name='pitchreset',
description='Debug feature that resets the pitches in case of any error. Clears pitch disables Pitch listeners.',
brief='Reset running pitches.',
aliases=['resetpitches', 'resetpitch']
)
async def _pitchreset(self, ctx:commands.Context):
yaml_dump({}, pitchesFile)
if self.client.get_cog('Pitch Listener') is not None:
unloadCog(f'./{cogsDir}/events/secondary/pitch_listener.py')
await ctx.reply('```Pitches have been hard reset.```')
def setup(client):
client.add_cog(Debug(client))