requests.rb 685 B

1234567891011121314151617181920212223242526272829
  1. def create_request(name, desc)
  2. Embed.new(
  3. title: name,
  4. description: desc,
  5. author:{
  6. name: 'Team Application'
  7. }
  8. )
  9. end
  10. def join_request(char, user)
  11. # Grab the character's default image
  12. img = CharImage.where(char_id: char.id).find_by(keyword: 'Default')
  13. embed = Embed.new(
  14. title: "#{char.name} would like to join your team!",
  15. description: "Please react to indicate if you'd like them to join!",
  16. author: { name: 'Team Join Request' }
  17. )
  18. # Build footer to show the character's user, and id
  19. # Attatch character image, if it exists
  20. author_footer(embed, user, [char.id])
  21. embed.thumbnail = { url: img.url } if img
  22. # Return
  23. embed
  24. end