app.rb 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. def new_app_request(user, app_type)
  2. embed = Embed.new(
  3. title: "New Appliction!",
  4. description: "Hi, #{user.nickname || user.name},\nI see you'd like to " +
  5. "start a new #{app_type.to_s} application!\nI'll DM you instructions!"
  6. )
  7. embed.color = user.color.combined if user.color
  8. embed
  9. end
  10. def new_app_form(user, app_type)
  11. url = case app_type
  12. when :character
  13. Url::CHAR
  14. when :landmark
  15. Url::LM
  16. end
  17. embed = Embed.new(
  18. title: "Hi, #{user.nickname || user.name}",
  19. description: "If you have any questions, feel free to ask a Guildmaster!",
  20. footer: {
  21. text: "If you cannot copy your key, press the #{Emoji::PHONE}"
  22. },
  23. fields: [
  24. { name: "Please start your application here:", value: url },
  25. { name: "Your key is:", value: user.id }
  26. ]
  27. )
  28. embed.color = user.color.combined if user.color
  29. embed
  30. end
  31. def edit_app_request(user, name)
  32. embed = Embed.new(
  33. title: "You want to edit #{name}?",
  34. description: "Good news, #{user.nickname || user.name}! I'll dm you a link"
  35. )
  36. embed.color = user.color.combined if user.color
  37. embed
  38. end
  39. def edit_app_form(user, model)
  40. edit_url = case model
  41. when Character
  42. "#{Url::CHARACTER}#{model.edit_url}"
  43. when Landmark
  44. "#{Url::LANDMARK}#{model.edit_url}"
  45. end
  46. embed = Embed.new(
  47. title: "You may edit #{model.name} here:",
  48. description: edit_url
  49. )
  50. embed.color = user.color.combined if user.color
  51. embed
  52. end