Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. local discordia = require('discordia')
  2. local client = discordia.Client()
  3.  
  4. discordia.extensions()
  5.  
  6. client:on('ready', function()
  7. print('Logged in as '.. client.user.username)
  8. end)
  9.  
  10. client:on('messageCreate', function(message)
  11. if message.content == '!ping' then
  12. message.channel:send('Pong')
  13. end
  14. end)
  15.  
  16.  
  17. -- I will figure this out one day, at least I know how to do comments --
  18.  
  19. client:on('messageCreate', function(message)
  20. if message.content == '!rickroll' then
  21. message.channel:send('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
  22. end
  23. end)
  24.  
  25. client:on("messageCreate", function(message)
  26.  
  27. local content = message.content
  28. local author = message.author
  29.  
  30.  
  31. -- below is the wip for a usercount command, --
  32. -- going to build it off of example embed from wiki; just need to figure out how to have the bot respond with users in guild --
  33.  
  34. if content == "!usercount" then
  35. message:reply {
  36. user = {
  37. title = "Server Info",
  38. description = "usercount",
  39. author = {
  40. name = author.username,
  41. icon_url = author.avatarURL
  42. },
  43. fields = { -- array of fields
  44. {
  45. name = "=Count",
  46. value = "This is some information",
  47. inline = true
  48. },
  49. {
  50. name = "unused",
  51. value = "This is some more information",
  52. inline = false
  53. }
  54. },
  55. footer = {
  56. text = "Created with Discordia"
  57. },
  58. color = 0x000000 -- hex color code
  59. }
  60. }
  61. end
  62.  
  63. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement