MCPcopy Create free account

hub / github.com/EnArvy/Discord-Gemini-Chatbot / functions

Functions34 in github.com/EnArvy/Discord-Gemini-Chatbot

↓ 2 callersFunctionget_attachment_data
Download and process attachments from Discord. Args: attachments: List of Discord attachments Returns: List
attachments.py:55
↓ 2 callersMethodget_history
Get the chat history for a channel. Args: channel_id: Discord channel ID Returns:
ai_service.py:115
↓ 2 callersMethodload_tracked_threads
Load list of tracked threads from persistent storage.
storage.py:24
↓ 2 callersMethodsave
Save tracked threads to persistent storage.
commands.py:131
↓ 2 callersMethodsave_chat_history
Save chat history for a specific channel.
storage.py:32
↓ 1 callersFunction_get_mime_type
Determine the MIME type based on file extension. Args: filename: The name of the file Returns: The MIME typ
attachments.py:23
↓ 1 callersMethod_load_persisted_data
Load previously saved data from storage.
main.py:49
↓ 1 callersMethod_register_event_handlers
Register bot event handlers.
main.py:58
↓ 1 callersMethodadd_thread
Add a thread to tracked threads. Args: thread_id: The Discord thread ID
commands.py:105
↓ 1 callersFunctionconstruct_query
Construct the query string from a Discord message. Args: message: The Discord message attachments: Processed attachment
message_handler.py:11
↓ 1 callersMethoddelete_channel_history
Delete chat history for a channel. Args: channel_id: Discord channel ID
ai_service.py:105
↓ 1 callersMethoddelete_chat_history
Delete chat history for a specific channel.
storage.py:44
↓ 1 callersMethodgenerate_response
Generate a response from the AI model for the given input. Args: channel_id: Discord channel ID for context
ai_service.py:40
↓ 1 callersFunctionhandle_message
Main message handler orchestrating the processing pipeline. Args: message: The Discord message ai_service: The AI servic
message_handler.py:122
↓ 1 callersMethodload_chat_history
Load chat history from persistent storage.
storage.py:14
↓ 1 callersMethodload_history
Load previously saved chat history. Args: history_data: Dictionary mapping channel IDs to chat histories
ai_service.py:30
↓ 1 callersFunctionlog_error
Log errors to file for debugging.
storage.py:52
↓ 1 callersFunctionmain
Main entry point.
main.py:82
↓ 1 callersFunctionprocess_message_attachments
Process attachments from a message. Args: message: The Discord message Returns: Tuple of (attachments_list,
message_handler.py:49
↓ 1 callersMethodreset_channel_history
Reset the chat history for a channel. Args: channel_id: Discord channel ID custom_template: Optional
ai_service.py:92
↓ 1 callersMethodrun
Start the bot.
main.py:74
↓ 1 callersMethodsave_tracked_threads
Save list of tracked threads.
storage.py:38
↓ 1 callersFunctionsetup_commands
Register all bot commands. Args: bot: The Discord bot instance ai_service: The AI service instance tracked_threa
commands.py:11
↓ 1 callersFunctionshould_respond_to_message
Determine if the bot should respond to a message. Args: message: The Discord message Returns: True if bot s
message_handler.py:73
↓ 1 callersFunctionsplit_and_send_messages
Split a long message into chunks and send them as replies. Args: message: The original Discord message to reply to text:
message_handler.py:102
Method__init__
Initialize and load tracked threads.
commands.py:101
Method__init__
Initialize the AI service with configuration.
ai_service.py:20
Method__init__
Initialize the bot and all services.
main.py:22
Functioncreate_thread
Create a new thread and add it to tracked threads. Args: interaction: The slash command interaction
commands.py:67
Functionforget
Clear the conversation history for the current channel. Optionally set a new persona for the bot. Args:
commands.py:23
Methodget_all_threads
Get all tracked thread IDs.
commands.py:127
Methodon_message
Called when a message is sent in a channel the bot can see.
main.py:70
Methodon_ready
Called when the bot has successfully connected to Discord.
main.py:62
Methodremove_thread
Remove a thread from tracked threads. Args: thread_id: The Discord thread ID
commands.py:116