🐛 fix(main.py): handle on_application_command_error with proper error handling and response

 feat(main.py): add ChatProcess module for handling chat-related functionality
🔧 refactor(main.py): import necessary modules and update bot.add_cog calls
🔧 refactor(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 refactor(cogs/__init__.py): import ChannelSetup cog
 feat(cogs/channelSetup.py): add ChannelSetup cog for setting up channels and server-wide settings
🔧 refactor(cogs/setup.py): import SlashCommandGroup and guild_only from discord module
 feat(cogs/setup.py): add setup_channel command for adding and removing channels
 feat(cogs/setup.py): add api command for setting API keys
 feat(cogs/setup.py): add premium command for setting guild to premium
🔧 refactor(cogs/settings.py): temporarily disable images command due to maintenance
🔧 refactor(config.py): remove unnecessary code related to moderation table
 feat(guild.py): add Guild class for managing guild-specific data and settings
 feat(SqlConnector.py): add SQLConnection and _sql classes for managing SQLite connections
 feat(variousclasses.py): add models, characters, and apis classes for autocomplete functionality in slash commands
This commit is contained in:
2023-08-19 14:16:30 +02:00
parent f5e5145b14
commit 3a955d4379
10 changed files with 366 additions and 32 deletions

View File

@@ -13,6 +13,7 @@ bot.add_cog(cogs.Help(bot))
bot.add_cog(cogs.Chat(bot))
bot.add_cog(cogs.ManageChat(bot))
bot.add_cog(cogs.Moderation(bot))
bot.add_cog(cogs.ChannelSetup(bot))
# set the bot's watching status to watcing your messages to answer you
@@ -36,9 +37,9 @@ async def on_guild_join(guild):
@bot.event
async def on_application_command_error(ctx, error):
debug(error)
async def on_application_command_error(ctx, error: discord.DiscordException):
await ctx.respond(error, ephemeral=True)
raise error
bot.run(discord_token) # run the bot