app.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. def new_app_embed(event)
  2. name = event.author.nickname || event.author.name
  3. chat_embed = Embed.new(
  4. title: "New Application!",
  5. description: "Hi, #{name},\nI see you'd like to start a new character application!\nI'll send you instructions in a dm!",
  6. color: event.author.color.combined
  7. )
  8. embed = Embed.new(
  9. title: "Hi, #{name}",
  10. description: "If you have any questions, please feel free to ask a Guildmaster!",
  11. color: event.author.color.combined,
  12. fields: [
  13. { name: "Please start your application here:", value: APP_FORM },
  14. { name: "Your key is:", value: event.author.id }
  15. ]
  16. )
  17. event.send_embed("", chat_embed)
  18. embed
  19. end
  20. def edit_app_embed(event, edit_url, char_name)
  21. name = event.author.nickname || event.author.name
  22. chat_embed = Embed.new(
  23. title: "You want to edit #{char_name}?",
  24. description: "Good news, #{name}! I'll dm you a link",
  25. color: event.author.color.combined
  26. )
  27. embed = Embed.new(
  28. title: "You may edit #{char_name} here:",
  29. description: edit_url,
  30. color: event.author.color.combined
  31. )
  32. event.send_embed("", chat_embed)
  33. embed
  34. end
  35. def app_not_found_embed(event, char_name)
  36. name = event.author.nickname || event.author.name
  37. embed = Embed.new(
  38. title: "I'm sorry, #{name}",
  39. description: "I can't seem to find your character named, #{char_name}",
  40. color: "#a41e1f",
  41. fields: [
  42. { name: "Want to start a new application?", value: "You can start one with this command:\n```pkmn-app```"}
  43. ]
  44. )
  45. event.send_embed("", embed)
  46. end