FEATURE: Ticketing & API improvements#116
Open
Minus-hates-school wants to merge 69 commits into
Open
Conversation
os.environ['TOKEN'] raised a KeyError instead of falling through to the else branch
setup_logger called with bool(os.getenv("STREAM_LOGS"))
-- bool("false") is True since any non-empty string is truthy
int(os.getenv("BOT_LOG_LEVEL")) will crash if env var is missing
If BOT_LOG_LEVEL is unset, os.getenv() raises TypeError
Using VS to commit changes.
…few more things to the .gitignore
Ticket development
Ticket development
Fix KeyError in logging and clean up debug statements
Fix Setttings from [0] as well as some debugging
Fix response formatting and update setting retrieval
Reworked the ticket system to allow for database to track open threads.
Planned Features:
Auto Delete
Show Open Tickets
There is a few bugs with it currently.
Im tracking most of them
…chool/Eos into Ticket-Development
Ticket development
Rework of the json returns, image logging, ticket rework and error handling.
Xarlos89
requested changes
May 22, 2026
| return {"status": "ok", "message": f"role with ID {role_id} deleted successfully"} | ||
| except OperationalError as err: | ||
| logger.error(f"Error deleting role: {err}") | ||
| self.conn.rollback() |
Owner
There was a problem hiding this comment.
pyscopg is autocommit=True, so this should automatically happen if the execute fails
| logger.error(f"Error sending followup message: {e}") | ||
|
|
||
| async def on_error(self, interaction: discord.Interaction, error: Exception): | ||
| await interaction.followup.send("An error occurred while creating your ticket. Please try again later.", ephemeral=True) |
Owner
There was a problem hiding this comment.
without confirming the interaction was already deferred/responded — if on_submit errored before send_message, this raises the exception here and you swallow the original exception, losing it to the void
| await thread.send( | ||
| f'<@&{staff_role}>\n## {interaction.user.mention} has created a ticket\n' | ||
| f'** Type: ** {option}\n' | ||
| f'"{self.description.value}" - {interaction.user.nick}\n\n' |
Owner
There was a problem hiding this comment.
Is the user has no nickname set, this will show as "None". Prefer a ternary that uses the name if nick is none
| async def sync_users_command_error(self, ctx, error): | ||
| if isinstance(error, commands.CheckFailure): | ||
| logger.warning(f"{ctx.author.name} has attempted to use the {ctx.invoked_with} command, and was not allowed to do so.") | ||
| await ctx.send('For one reason, or another, YOU cannot use this command.') |
| await ctx.reply(embed=embed_info("Error!", "You must provide a required argument.", discord.Color.dark_gray())) | ||
| elif isinstance(error, commands.MissingPermissions): | ||
| logger.warning(f"{ctx.author.name} has attempted to use the {ctx.invoked_with} command, and was not allowed to do so.") | ||
| await ctx.send('For one reason, or another, YOU cannot use this command.') |
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new ticket management feature to the API, including routes and database helper methods for handling tickets. Additionally, it improves consistency in HTTP response handling and enhances error logging and transaction management across several endpoints.
[Ai Generated summary]