Sfoglia il codice sorgente

add new office, attempt to fix archiving chars with teams

Kylie Jo Swistak 5 anni fa
parent
commit
f4e497d46f
3 ha cambiato i file con 16 aggiunte e 1 eliminazioni
  1. 6 0
      app/app_forms/app_form.rb
  2. 7 1
      app/app_forms/confirm_archive.rb
  3. 3 0
      lib/emoji.rb

+ 6 - 0
app/app_forms/app_form.rb

@@ -26,6 +26,12 @@ class ApplicationForm
       to_office(event, ENV['MIZU_CH'])
     elsif reactions[Emoji::FISH]&.count.to_i > 0
       to_office(event, ENV['NEIRO_CH'])
+    elsif reactions[Emoji::CABINET]&.count.to_i > 0
+      to_office(event, ENV['R0RY_CH'])
+    elsif reactions[Emoji::COW]&.count.to_i > 0
+      to_office(event, ENV['R0RY_CH'])
+    elsif reactions[Emoji::CAT]&.count.to_i > 0
+      to_office(event, ENV['R0RY_CH'])
     end
   end
 

+ 7 - 1
app/app_forms/confirm_archive.rb

@@ -4,7 +4,13 @@ class ConfirmArchive < ApplicationForm
   def self.process
     @process ||= Application.new('Team Alert') do |event|
       # Check votes
-      check_votes(event, 1)
+      reactions = event.message.reactions
+
+      if reactions[Emoji::Y]&.count.to_i > 1
+        approve(event)
+      elsif reactions[Emoji::N]&.count.to_i > 1
+        deny(event)
+      end
 
     rescue StandardError => e
       error_embed(e.message)

+ 3 - 0
lib/emoji.rb

@@ -84,6 +84,9 @@ module Emoji
 
   GHOST = "👻"
   FISH = "🐟"
+  COW = "🐮"
+  CAT = "🐱"
+  CABINET = "🗄️"
 
 
   LETTERS = [A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z]