<commit_before>import sys
import logging

import discord
from discord.ext import commands

from core import speech
from core import message_parser
from core.commands import admin
from core.commands import help_cog
from core.commands import invite_command
from core.commands import speech_config_help_command
from common import utilities
from common import audio_player
from common import privacy_manager
from common.configuration import Configuration
from common.logging import Logging
from common.command_management import invoked_command_handler, command_reconstructor
from common.database import database_manager
from common.database.factories import anonymous_item_factory
from common.database.clients.dynamo_db import dynamo_db_client
from common.module.module_manager import ModuleManager
from common.ui import component_factory
from modules.phrases import phrases

## Config & logging
CONFIG_OPTIONS = Configuration.load_config()
LOGGER = Logging.initialize_logging(logging.getLogger(__name__))


class Hawking:
    ## Initialize the bot, and add base cogs
    def __init__(self, **kwargs):
        ## Make sure there's a Discord token before doing anything else
        self.token = CONFIG_OPTIONS.get("discord_token")
        if (not self.token):
            raise RuntimeError("Unable to get Discord token!")

        sys.path.append(utilities.get_root_path())

        ## Set the current working directory to that of the tts executable ASAP, so there's not weird issues arising
        ## from bot init and speech execution potentially being in different working directories.
        speech.TTSController.set_current_working_dir_to_tts_executable()

        self.name = CONFIG_OPTIONS.get("name", "the bot").capitalize()
        self.version = CONFIG_OPTIONS.get("version")
        self.description = CONFIG_OPTIONS.get("description", ["The retro TTS bot for Discord"])

        ## todo: this will eventually be removed upon the transistion to slash commands
        self.intents = discord.Intents.default();
        self.intents.message_content = True;

        ## Init the bot and module manager
        self.bot = commands.Bot(
            intents=self.intents,
            command_prefix=commands.when_mentioned,
            description='\n'.join(self.description)
        )

        ## Prepare to register modules
        self._module_manager = ModuleManager(self, self.bot)

        ## Register the modules (no circular dependencies!)
        self.module_manager.register_module(message_parser.MessageParser)
        self.module_manager.register_module(
            command_reconstructor.CommandReconstructor,
            dependencies=[message_parser.MessageParser]
        )
        self.module_manager.register_module(
            anonymous_item_factory.AnonymousItemFactory,
            dependencies=[command_reconstructor.CommandReconstructor]
        )
        self.module_manager.register_module(
            database_manager.DatabaseManager,
            dynamo_db_client.DynamoDbClient(),
            dependencies=[command_reconstructor.CommandReconstructor, anonymous_item_factory.AnonymousItemFactory]
        )<commit_msg>Removed message content intent from the bot<commit_after>import sys
import logging

import discord
from discord.ext import commands

from core import speech
from core import message_parser
from core.commands import admin
from core.commands import help_cog
from core.commands import invite_command
from core.commands import speech_config_help_command
from common import utilities
from common import audio_player
from common import privacy_manager
from common.configuration import Configuration
from common.logging import Logging
from common.command_management import invoked_command_handler, command_reconstructor
from common.database import database_manager
from common.database.factories import anonymous_item_factory
from common.database.clients.dynamo_db import dynamo_db_client
from common.module.module_manager import ModuleManager
from common.ui import component_factory
from modules.phrases import phrases

## Config & logging
CONFIG_OPTIONS = Configuration.load_config()
LOGGER = Logging.initialize_logging(logging.getLogger(__name__))


class Hawking:
    ## Initialize the bot, and add base cogs
    def __init__(self, **kwargs):
        ## Make sure there's a Discord token before doing anything else
        self.token = CONFIG_OPTIONS.get("discord_token")
        if (not self.token):
            raise RuntimeError("Unable to get Discord token!")

        sys.path.append(utilities.get_root_path())

        ## Set the current working directory to that of the tts executable ASAP, so there's not weird issues arising
        ## from bot init and speech execution potentially being in different working directories.
        speech.TTSController.set_current_working_dir_to_tts_executable()

        self.name = CONFIG_OPTIONS.get("name", "the bot").capitalize()
        self.version = CONFIG_OPTIONS.get("version")
        self.description = CONFIG_OPTIONS.get("description", ["The retro TTS bot for Discord"])

        ## Init the bot and module manager
        self.bot = commands.Bot(
            intents=discord.Intents.default(),
            command_prefix=commands.when_mentioned,
            description='\n'.join(self.description)
        )

        ## Prepare to register modules
        self._module_manager = ModuleManager(self, self.bot)

        ## Register the modules (no circular dependencies!)
        self.module_manager.register_module(message_parser.MessageParser)
        self.module_manager.register_module(
            command_reconstructor.CommandReconstructor,
            dependencies=[message_parser.MessageParser]
        )
        self.module_manager.register_module(
            anonymous_item_factory.AnonymousItemFactory,
            dependencies=[command_reconstructor.CommandReconstructor]
        )
        self.module_manager.register_module(
            database_manager.DatabaseManager,
            dynamo_db_client.DynamoDbClient(),
            dependencies=[command_reconstructor.CommandReconstructor, anonymous_item_factory.AnonymousItemFactory]
        )
{'fraction_non_alphanumeric': 0.06447945427968166, 'fraction_numerical': 0.0, 'mean_word_length': 3.733282090699462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2796516', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1498, 'n_words': 430}