Refactor Discord member statistics handling and remove unused components
- Removed the `guild_member_stats` table and related logic from the database and models, as well as the associated webapp routes and templates. - Cleaned up the Discord bot initialization by eliminating unused imports and functions related to member statistics. - Updated logging configuration in `run-web.py` to streamline the startup process and improve thread management.
This commit is contained in:
@@ -29,13 +29,11 @@ from discordbot.welcome import sendWelcomeMessage, sendLeaveMessage, updateInvit
|
||||
from discordbot.patreon import checkPatreonPosts
|
||||
from discordbot.youtube import checkYouTubeVideos
|
||||
from discordbot.auto_rooms import on_voice_state_update_auto_rooms, on_raw_reaction_add_auto_rooms, on_message_auto_rooms, cleanup_orphaned_auto_rooms
|
||||
from discordbot.member_stats import record_message, on_voice_state_update_track_voice
|
||||
from discordbot.rate_limit_logging import build_discord_http_trace_config
|
||||
from protondb import searhProtonDb
|
||||
|
||||
class DiscordBot(discord.Client):
|
||||
def __init__(self, *, intents: discord.Intents):
|
||||
super().__init__(intents=intents, http_trace=build_discord_http_trace_config())
|
||||
super().__init__(intents=intents)
|
||||
self.tree = app_commands.CommandTree(self)
|
||||
self.synced = False
|
||||
|
||||
@@ -169,10 +167,7 @@ async def on_message(message: Message):
|
||||
|
||||
# Gestion des messages dans les auto rooms (avant le check des commandes !)
|
||||
await on_message_auto_rooms(bot, message)
|
||||
|
||||
if message.guild and not message.author.bot:
|
||||
record_message(message.guild.id, message.author.id)
|
||||
|
||||
|
||||
if not message.content.startswith('!'):
|
||||
return
|
||||
command_name = message.content.split()[0]
|
||||
@@ -336,7 +331,6 @@ async def on_message(message: Message):
|
||||
@bot.event
|
||||
async def on_voice_state_update(member: Member, before, after):
|
||||
await on_voice_state_update_auto_rooms(bot, member, before, after)
|
||||
on_voice_state_update_track_voice(member, before, after)
|
||||
|
||||
@bot.event
|
||||
async def on_raw_reaction_add(payload: discord.RawReactionActionEvent):
|
||||
|
||||
Reference in New Issue
Block a user