Class: OpenAIBot
- Inherits:
-
Rubydium::Bot
- Object
- Rubydium::Bot
- OpenAIBot
- Includes:
- ConfigMenu, OpenAI::ChatGPT, OpenAI::Dalle, OpenAI::Utils, OpenAI::Whisper
- Defined in:
- lib/open_ai_bot.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from ConfigMenu
#config_menu, #handle_config_query, #handle_model_query, included, #model_selection_menu
Methods included from OpenAI::Whisper
#ogg_to_mp3, #send_whisper_error, #send_whisper_request, #send_whisper_response, #transcribe
Methods included from OpenAI::Utils
Methods included from OpenAI::Dalle
Methods included from OpenAI::ChatGPT
#current_thread, #get_tokens_info!, #handle_gpt_command, included, #init_session, #send_chat_gpt_error, #send_chat_gpt_response, #send_request!, #username
Instance Method Details
#allowed_chat? ⇒ Boolean
53 54 55 56 57 58 59 60 |
# File 'lib/open_ai_bot.rb', line 53 def allowed_chat? return true if @user.username == config.owner_username return true if config.open_ai["whitelist"].include?(@chat.id) return true if config.open_ai["allow_all_private_chats"] && @chat.id.positive? return true if config.open_ai["allow_all_group_chats"] && @chat.id.negative? false end |
#chat_not_allowed_message ⇒ Object
62 63 64 65 |
# File 'lib/open_ai_bot.rb', line 62 def # Return false/nil (leave method empty) to ignore # "This chat (`#{@chat.id}`) is not whitelisted for ChatGPT usage. Ask @#{config.owner_username}." end |
#session_restart_message ⇒ Object
67 68 69 |
# File 'lib/open_ai_bot.rb', line 67 def "Bot's context reset." end |