Explorar el Código

fix user_id catch

Kylie Jo Swistak hace 5 años
padre
commit
1e66a3ee09
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. 2 1
      app/app_forms/character_app.rb
  2. 1 1
      bot.rb

+ 2 - 1
app/app_forms/character_app.rb

@@ -24,7 +24,8 @@ class CharacterApplication < ApplicationForm
   def self.approve(event)
     # Save the application, and member if they exist
     app = event.message.embeds.first
-    member = event.server.member(UID.match(app.description)[1])
+    user_id = app.description.match(UID)
+    member = event.server.member(user_id[1])
 
     # Save character and default image
     character = CharacterController.edit_character(app)

+ 1 - 1
bot.rb

@@ -16,7 +16,7 @@ require 'active_record'
 DISCORD = "#36393f"
 ERROR = "#a41e1f"
 
-UID = /<@\!?([0-9]+)>/
+UID = /<@\!?(\w+)>/
 URL = /https?:\/\/[\S]+/
 
 # ---