瀏覽代碼

only search non-deleted apps unless specified, also compact footers to exclude nil values

Kylie Jo Swistak 5 年之前
父節點
當前提交
393c1d89d9
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 5 1
      app/commands/member.rb
  2. 1 1
      app/embeds/global.rb

+ 5 - 1
app/commands/member.rb

@@ -72,8 +72,12 @@ class MemberCommand < BaseCommand
         # Find Character
         if name.to_i > 0
           character = Character.find(name)
+        elsif section&.match(/deleted?/i)
+          character = Character.where(active: 'Deleted')
+            .where('name ilike ?', name)
         else
-          character = Character.where('name ilike ?', name)
+          character = Character.where.not(active: 'Deleted')
+            .where('name ilike ?', name)
           raise 'Character not found!' if character.empty?
         end
 

+ 1 - 1
app/embeds/global.rb

@@ -21,7 +21,7 @@ def author_footer(embed, author, info=[])
 
   # Update the footer with the appropriate information
   embed.footer = {
-    text: info.join(" | "),
+    text: info.compact.join(" | "),
     icon_url: img
   }