Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/EnArvy/Discord-Gemini-Chatbot
/ functions
Functions
34 in github.com/EnArvy/Discord-Gemini-Chatbot
⨍
Functions
34
◇
Types & classes
4
↳
Endpoints
1
↓ 2 callers
Function
get_attachment_data
Download and process attachments from Discord. Args: attachments: List of Discord attachments Returns: List
attachments.py:55
↓ 2 callers
Method
get_history
Get the chat history for a channel. Args: channel_id: Discord channel ID Returns:
ai_service.py:115
↓ 2 callers
Method
load_tracked_threads
Load list of tracked threads from persistent storage.
storage.py:24
↓ 2 callers
Method
save
Save tracked threads to persistent storage.
commands.py:131
↓ 2 callers
Method
save_chat_history
Save chat history for a specific channel.
storage.py:32
↓ 1 callers
Function
_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 callers
Method
_load_persisted_data
Load previously saved data from storage.
main.py:49
↓ 1 callers
Method
_register_event_handlers
Register bot event handlers.
main.py:58
↓ 1 callers
Method
add_thread
Add a thread to tracked threads. Args: thread_id: The Discord thread ID
commands.py:105
↓ 1 callers
Function
construct_query
Construct the query string from a Discord message. Args: message: The Discord message attachments: Processed attachment
message_handler.py:11
↓ 1 callers
Method
delete_channel_history
Delete chat history for a channel. Args: channel_id: Discord channel ID
ai_service.py:105
↓ 1 callers
Method
delete_chat_history
Delete chat history for a specific channel.
storage.py:44
↓ 1 callers
Method
generate_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 callers
Function
handle_message
Main message handler orchestrating the processing pipeline. Args: message: The Discord message ai_service: The AI servic
message_handler.py:122
↓ 1 callers
Method
load_chat_history
Load chat history from persistent storage.
storage.py:14
↓ 1 callers
Method
load_history
Load previously saved chat history. Args: history_data: Dictionary mapping channel IDs to chat histories
ai_service.py:30
↓ 1 callers
Function
log_error
Log errors to file for debugging.
storage.py:52
↓ 1 callers
Function
main
Main entry point.
main.py:82
↓ 1 callers
Function
process_message_attachments
Process attachments from a message. Args: message: The Discord message Returns: Tuple of (attachments_list,
message_handler.py:49
↓ 1 callers
Method
reset_channel_history
Reset the chat history for a channel. Args: channel_id: Discord channel ID custom_template: Optional
ai_service.py:92
↓ 1 callers
Method
run
Start the bot.
main.py:74
↓ 1 callers
Method
save_tracked_threads
Save list of tracked threads.
storage.py:38
↓ 1 callers
Function
setup_commands
Register all bot commands. Args: bot: The Discord bot instance ai_service: The AI service instance tracked_threa
commands.py:11
↓ 1 callers
Function
should_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 callers
Function
split_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
Function
create_thread
Create a new thread and add it to tracked threads. Args: interaction: The slash command interaction
commands.py:67
Function
forget
Clear the conversation history for the current channel. Optionally set a new persona for the bot. Args:
commands.py:23
Method
get_all_threads
Get all tracked thread IDs.
commands.py:127
Method
on_message
Called when a message is sent in a channel the bot can see.
main.py:70
Method
on_ready
Called when the bot has successfully connected to Discord.
main.py:62
Method
remove_thread
Remove a thread from tracked threads. Args: thread_id: The Discord thread ID
commands.py:116