add basic bot
This commit is contained in:
parent
661c7c1c37
commit
a75f0c4bbc
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -56,3 +56,5 @@ build-iPhoneSimulator/
|
|||
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
||||
# .rubocop-https?--*
|
||||
|
||||
# emacs
|
||||
*~
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require "discord-r9k/bot"
|
||||
|
||||
Bot.run
|
3
lib/auth.rb
Normal file
3
lib/auth.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
TOKEN = "YOUR_TOKEN_HERE"
|
|
@ -1 +1,25 @@
|
|||
require "discord-r9k/bot"
|
||||
#!/usr/bin/ruby
|
||||
|
||||
require 'discordrb'
|
||||
require 'set'
|
||||
require './auth'
|
||||
|
||||
bot = Discordrb::Bot.new token: TOKEN
|
||||
|
||||
$messages = Set.new
|
||||
|
||||
bot.message do |event|
|
||||
if $messages.include? event.content then
|
||||
event.message.delete "ROBOT9000 strikes again!"
|
||||
else
|
||||
$messages << event.content
|
||||
end
|
||||
end
|
||||
|
||||
def init_messages
|
||||
$messages << "this is a placeholder method"
|
||||
$messages << "i will load/store things in a \"\"\"database\"\"\" later"
|
||||
end
|
||||
|
||||
init_messages
|
||||
bot.run
|
||||
|
|
Loading…
Reference in a new issue