reject.rb 1.7 KB

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