reject.rb 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. REJECT_RED = "#a41e1f"
  2. def reject_char_embed(app)
  3. image_url = /\*\*URL to the Character\'s Appearance\*\*\:\s(.*)/.match(app)
  4. fields = []
  5. CharAppResponses::REJECT_MESSAGES.map do |emoji, message|
  6. fields.push({ name: emoji, value: "#{message}\n#{CharAppResponses::INLINE_SPACE}", inline: true })
  7. end
  8. fields.push({ name: "Submitting", value: "#{Emoji::CHECK} : Indicates you are ready to send the corresponding messages to the user\n#{Emoji::CROSS} : Indicates you want to dismiss this message and not send a message to the user\n#{Emoji::CRAYON} : Indicates you want to edit the users form for them, and resubmit on their behalf" })
  9. Embed.new(
  10. title: "**_APPLICATION REJECTED_**",
  11. description: "Please indicate what message to forward to the user!",
  12. color: REJECT_RED,
  13. thumbnail: {
  14. url: image_url[1]
  15. },
  16. fields: fields
  17. )
  18. end
  19. def message_user_embed(event)
  20. reactions = event.message.reactions
  21. content = event.message.content
  22. edit_url = EDIT_URL.match(content)
  23. description = ""
  24. Emoji::APP_SECTIONS.each do |reaction|
  25. if reactions[reaction].count > 1
  26. m = CharAppResponses::REJECT_MESSAGES[reaction].gsub("\n", " ")
  27. description += "\n#{m}"
  28. end
  29. end
  30. embed = Embed.new(
  31. title: "**Your application has been rejected!!**",
  32. color: REJECT_RED,
  33. fields: [
  34. { name: "Listed reasons for rejection:", value: description },
  35. { name: "You can edit your application and resubmit here:", value: "#{APP_FORM}#{edit_url[1]}" }
  36. ]
  37. )
  38. embed
  39. end
  40. def self_edit_embed(content)
  41. edit_url = EDIT_URL.match(content)
  42. Embed.new(
  43. title: "Please edit the user's application and resubmit!",
  44. color: REJECT_RED,
  45. description: "#{APP_FORM}#{edit_url[1]}"
  46. )
  47. end