Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Commit

Permalink
Added command to see how many votes you have.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chew committed Apr 6, 2018
1 parent a77caf3 commit 4d23733
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/plugins/about.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ module About
event.respond "You got it, bucko. I set the server count everywhere to `#{event.bot.servers.count}`"
end

command(:votes) do |event|
votedata = YAML.load_file('../lit/votes.yml')
votes = votedata[event.user.id.to_s]
begin
event.channel.send_embed do |embed|
embed.title = 'Chewbotcca Voting'
embed.colour = 0xd084
embed.url = 'http://bit.ly/Vote4Chewbotcca'

embed.add_field(name: 'Your Vote Count', value: votes.to_s, inline: true)
embed.add_field(name: 'Your Current Vote Perks', value: 'None! (Yet!)', inline: true)
end
rescue Discordrb::Errors::NoPermission
event.respond "SYSTEM ERRor, I CANNot SEND THE EMBED, EEEEE. Can I please have the 'Embed Links' permission? Thanks, appriciate ya."
end
end

command(:stats) do |event|
t = Time.now - Starttime
mm, ss = t.divmod(60)
Expand Down

0 comments on commit 4d23733

Please # to comment.