-
Notifications
You must be signed in to change notification settings - Fork 0
/
dula_peep_bot.rb
60 lines (52 loc) · 1.52 KB
/
dula_peep_bot.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'dotenv/load'
require 'sinatra'
require 'sinatra/base'
require 'discordrb'
require 'awesome_print'
require_relative 'lib/api'
require_relative 'lib/command_definitions'
TOKEN = ENV.fetch 'DISCORD_API_TOKEN', nil
class DulaPeepBot
def initialize(token:)
@api = Api.new(token)
@bot = Discordrb::Bot.new(
token: token,
intents: [:server_messages]
)
CommandDefinitions.new(@bot, @api)
end
attr_reader :bot, :api
end
APP = DulaPeepBot.new(token: TOKEN)
Thread.new { APP.bot.run }
# # Discord bot event for "Ping!" message
# BOT.message(content: 'Ping!') do |event|
# event.respond 'Pong!'
# end
#
# # Run the Discord bot
# Thread.new { BOT.run }
#
#RT
# class App < Sinatra::Base
# get '/' do
# 'Hello from docker!'
# end
# end
# BOT.register_application_command(:purge, 'Purge last 14 days of messages in the current channel', server_id: ENV.fetch('TEST_SERVER_ID', nil)) do |cmd|
# cmd.subcommand_group(:fun, 'Fun things!') do |group|
# group.subcommand('8ball', 'Shake the magic 8 ball') do |sub|
# sub.string('question', 'Ask a question to receive wisdom', required: true)
# end
#
# group.subcommand('java', 'What if it was java?')
#
# group.subcommand('calculator', 'do math!') do |sub|
# sub.integer('first', 'First number')
# sub.string('operation', 'What to do', choices: { times: '*', divided_by: '/', plus: ' ', minus: '-' })
# sub.integer('second', 'Second number')
# end
#
# group.subcommand('button-test', 'Test a button!')
# end
# end