Browse Source

fix polls

Kylie Jo Swistak 6 năm trước cách đây
mục cha
commit
c6f4c99776
2 tập tin đã thay đổi với 8 bổ sung4 xóa
  1. 7 3
      app/responses/poll.rb
  2. 1 1
      lib/char_app.rb

+ 7 - 3
app/responses/poll.rb

@@ -5,17 +5,21 @@ def new_poll_embed(event, question, options)
   options.map.with_index do |option, index|
     fields.push({
       name: "#{Emoji::LETTERS[index]} #{option}",
-      value: CharApp::INLINE_SPACE, inline: true
+      value: CharApp::INLINE_SPACE,
+      inline: true
     })
   end
 
   chat_embed = Embed.new(
     title:  question,
-    description: "Created by : #{name}",
+    author: {
+      name: name,
+      icon_url: event.author.avatar_url
+    },
     fields: fields
   )
 
-  chat_embed.color = event.author.color.combined
+  chat_embed.color = event.author.color.combined if event.author.color
 
   poll = event.send_embed("", chat_embed)
   options.each.with_index do |_, index|

+ 1 - 1
lib/char_app.rb

@@ -10,7 +10,7 @@ module CharApp
   INVALID = "One or more responses are\ninvalid"
   VULGAR = "Your application is too vulgar,\nor conflicts with server rules"
   DM_NOTES = "Please elaborate on your\nDM Notes"
-  INLINE_SPACE = "------------------------------------"
+  INLINE_SPACE = "------------------------------"
 
   REJECT_MESSAGES = {
     Emoji::SPEECH_BUBBLE => GRAMMAR,