-
Notifications
You must be signed in to change notification settings - Fork 6
/
gitgud.rb
52 lines (38 loc) · 1011 Bytes
/
gitgud.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
require "optparse"
require "discordrb"
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: gitgud.rb [options]"
opts.on("-d", "--dry-run", "Do a dry run") do |d|
options[:dryrun] = d
end
end.parse!
bots = Array.new
message = ""
server = ""
tokens = [
]
tokens.each { |token|
bots.push(Discordrb::Bot.new(log_mode: :silent, token: token, type: :user, parse_self: true))
bots[bots.size-1].run(true)
puts "Logged into #{bots[bots.size-1].profile.username}!"
if not bots[bots.size-1].servers.has_key? server.to_i then
puts "Account #{bots[bots.size-1].profile.username} is not in the server!"
end
}
puts "#{bots.size} bots online!"
if options[:dryrun] then exit end
puts "Starting spam"
bots.each { |bot|
Thread.new {
loop do
server = bot.server(server)
server.channels.each { |channel|
channel.send_message(message) rescue nil
}
end
}
}
loop do
sleep(1)
end