chatgpt_assistant 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfdbae4dc34427a795f312216602a7a7efd52511b39ab5e81a6d87211bf99e1b
4
- data.tar.gz: 3292735303abbad74ff7cd65c0889b8c2939ba66113ed738b7b601829fc1871b
3
+ metadata.gz: 8c2a41c81a5e742715d9b0710ff7c5866ba40d718931c3a6f0caa470613b23cd
4
+ data.tar.gz: 73d6d84ccabd93c017b776083689f799f78e7b81355f02ca33a552fba601cf89
5
5
  SHA512:
6
- metadata.gz: 5f86bbc67fef4385c13db8377bf9eb1208bc43950afbfabe5e7f5af5a706ebdce90e185aacde659c1d0f210b50cb20cbd847391f1ef59c85c5ea9e76102345dc
7
- data.tar.gz: cb96f57300a0c5aaa183df1acbfc116c7bc03c95868a275832c30b0ac6e52702bae8b9b06a4ad9160a08d14e8b80da97d61b3178189755629ff5998825fe8077
6
+ metadata.gz: e55c21e292cc6bb2ee86bf86dca5ed881a02e834e30b5bf982f028dd0e34cf23c6c1978274873a04c50a845f157034cc1132050104d13899dce97d3c62e808cd
7
+ data.tar.gz: ca83c1370beed7b168375ed3f8ecfd168950d0fde50c72a12784e2c28a58660c5838de0c969528bd8a47ddca11b1bc6a121c825f370a20165a09dda5fec0d59e
data/README.md CHANGED
@@ -86,17 +86,20 @@ After starting the Docker Compose services, you can use the features of the gem
86
86
 
87
87
  ## Discord Bot Commands
88
88
 
89
- - !start - shows the welcome message
90
- - !help - shows the help message
91
- - !login email:password - logs in the user
92
- - !register email:password - registers a new user
93
- - !list - lists the user created chatbots
94
- - !sl_chat CHAT TITLE - starts a chat with the chatbot with the given title
95
- - !new_chat CHAT TITLE - creates a new chatbot with the given title
96
- - !ask TEXT - sends a text to the chatbot
97
- - !connect - connects the chat bot to the current channel
98
- - !disconnect - disconnects the chat bot from the current channel
99
- - !speak TEXT - sends a text to the chatbot and gets the response in voice
89
+ The discord commands prefix can be changed in the .env file.
90
+ The default prefix is dgpt!
91
+
92
+ - dgpt!start - shows the welcome message
93
+ - dgpt!help - shows the help message
94
+ - dgpt!login email:password - logs in the user
95
+ - dgpt!register email:password - registers a new user
96
+ - dgpt!list - lists the user created chatbots
97
+ - dgpt!sl_chat CHAT TITLE - starts a chat with the chatbot with the given title
98
+ - dgpt!new_chat CHAT TITLE - creates a new chatbot with the given title
99
+ - dgpt!ask TEXT - sends a text to the chatbot
100
+ - dgpt!connect - connects the chat bot to the current channel
101
+ - dgpt!disconnect - disconnects the chat bot from the current channel
102
+ - dgpt!speak TEXT - sends a text to the chatbot and gets the response in voice
100
103
 
101
104
  ## Telegram Bot Commands
102
105
 
@@ -97,7 +97,7 @@ module ChatgptAssistant
97
97
  end
98
98
 
99
99
  def list_action
100
- chats_title = chats.map(&:title)
100
+ chats_title = user.chats.map(&:title)
101
101
  evnt.respond commom_messages[:chat_list]
102
102
  evnt.respond chats_title.join("\n")
103
103
  end
@@ -148,8 +148,8 @@ module ChatgptAssistant
148
148
  end
149
149
 
150
150
  def create_chat_action
151
- chat_title = event.message.content.split(" ")[1..].join(" ")
152
- chat = Chat.new(user_id: user.id, title: chat_title, status: 0)
151
+ chat_title = evnt.message.content.split(" ")[1..].join(" ")
152
+ @chat = Chat.new(user_id: user.id, title: chat_title, status: 0)
153
153
  chat.save ? respond_with_success : evnt.respond(error_messages[:chat_creation])
154
154
  end
155
155
 
@@ -216,8 +216,8 @@ module ChatgptAssistant
216
216
  end
217
217
 
218
218
  def voice_connection_checker_action
219
- evnt.respond error_messages[:user_not_in_voice_channel] if event.user.voice_channel.nil? && user
220
- evnt.respond error_messages[:bot_already_connected] if event.voice && user
219
+ evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
220
+ evnt.respond error_messages[:bot_already_connected] if evnt.voice && user
221
221
  end
222
222
 
223
223
  def bot_disconnected?
@@ -239,12 +239,12 @@ module ChatgptAssistant
239
239
 
240
240
  def disconnect_checker_action
241
241
  evnt.respond error_messages[:user_not_logged_in] if user.nil?
242
- evnt.respond error_messages[:user_not_in_voice_channel] if event.user.voice_channel.nil? && user
243
- evnt.respond error_messages[:user_not_connected] if !event.voice && user
242
+ evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
243
+ evnt.respond error_messages[:user_not_connected] if !evnt.voice && user
244
244
  end
245
245
 
246
246
  def disconnect_action
247
- bot.voice_destroy(event.user.voice_channel)
247
+ bot.voice_destroy(evnt.user.voice_channel)
248
248
  "Disconnected from voice channel"
249
249
  end
250
250
 
@@ -262,12 +262,12 @@ module ChatgptAssistant
262
262
 
263
263
  def speak_connect_checker_action
264
264
  evnt.respond error_messages[:user_not_logged_in] if user.nil?
265
- evnt.respond error_messages[:chat_not_found] if user && event.user.voice_channel && event.voice && chat.nil?
265
+ evnt.respond error_messages[:chat_not_found] if user && evnt.user.voice_channel && evnt.voice && chat.nil?
266
266
  end
267
267
 
268
268
  def speak_connection_checker_action
269
- evnt.respond error_messages[:user_not_in_voice_channel] if event.user.voice_channel.nil? && user
270
- evnt.respond error_messages[:bot_not_in_voice_channel] if !event.voice && user
269
+ evnt.respond error_messages[:user_not_in_voice_channel] if evnt.user.voice_channel.nil? && user
270
+ evnt.respond error_messages[:bot_not_in_voice_channel] if !evnt.voice && user
271
271
  end
272
272
 
273
273
  def ask_to_speak_action
@@ -81,7 +81,7 @@ module ChatgptAssistant
81
81
  user_not_found_error_message
82
82
  when "wrong password"
83
83
  wrong_password_error_message
84
- when find_usertelegram(email)
84
+ when find_useremail(email)
85
85
  user_logged_in_message
86
86
  end
87
87
  end
@@ -51,6 +51,7 @@ module ChatgptAssistant
51
51
  nil: "Não entendi o que você disse. Tente novamente",
52
52
  email: "O email que você digitou não é válido. Tente novamente",
53
53
  password: "A senha que você digitou não é válida. Tente novamente",
54
+ wrong_password: "A senha que você digitou não é válida. Tente novamente",
54
55
  user: "O usuário que você digitou não existe. Tente novamente",
55
56
  user_creation: "Erro ao criar usuário. Tente novamente",
56
57
  user_already_exists: "O usuário que você digitou já existe. Tente novamente",
@@ -113,6 +114,7 @@ module ChatgptAssistant
113
114
  nil: "I didn't understand what you said. Try again",
114
115
  email: "The email you typed is not valid. Try again",
115
116
  password: "The password you typed is not valid. Try again",
117
+ wrong_password: "The password you typed is not valid. Try again",
116
118
  user: "The user you typed does not exist. Try again",
117
119
  user_creation: "Error creating user. Try again",
118
120
  chat_creation: "Error creating chat. Try again",
@@ -29,7 +29,7 @@ class User < ActiveRecord::Base
29
29
  chats.last
30
30
  end
31
31
 
32
- def chat_by_title
32
+ def chat_by_title(title)
33
33
  chats.find_by(title: title)
34
34
  end
35
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChatgptAssistant
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatgpt_assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JesusGautamah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-03 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  This gem has the intention to facilitate the creation of chatbots with GPT-3.5-turbo,