Module: ChatgptAssistant::Bots::Discord::Bot
- Included in:
- DiscordBot
- Defined in:
- lib/chatgpt_assistant/bots/discord/bot.rb
Instance Method Summary collapse
Instance Method Details
#bot ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/chatgpt_assistant/bots/discord/bot.rb', line 7 def bot @bot ||= Discordrb::Commands::CommandBot.new( token: discord_token, client_id: discord_client_id, prefix: discord_prefix ) end |
#bot_init ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/chatgpt_assistant/bots/discord/bot.rb', line 19 def bot_init at_exit { bot.stop } bot.run rescue StandardError => e Error.create(message: e., backtrace: e.backtrace) retry end |
#user ⇒ Object
15 16 17 |
# File 'lib/chatgpt_assistant/bots/discord/bot.rb', line 15 def user @user = find_user(discord_id: evnt.user.id) end |