qwtf_discord_bot 5.1.11 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f929cda85f6a53ffc63d04e3a85b6ca4bcbcadf72b2c0ab70eab8a1a549843a
4
- data.tar.gz: 45b0e4b9bba67fdfb8139d3904176ce3443d43ea7cb74c750588f4eb6ea1fb8d
3
+ metadata.gz: 9b630f0be26ff93132f961550613e3616dc423b53662e7cb44646746bb0126fc
4
+ data.tar.gz: 6dff05acbd136b65db0e0dac8958addd0b8113e51b9e1a68b00b278cfaf3f383
5
5
  SHA512:
6
- metadata.gz: cca2b1392fbbdca102e22ea27e79774da07478e5cfa2a9a2ee14c4b6ae48ae1ea3c8e4c8906461d123a1f32f3e2e0cef519f107a3b7abf42d1853a5e870bf342
7
- data.tar.gz: d29bd7a09c9ffed879429965497118d0f63332bac8084c83ea498601d924d11227adad67694de73f97658b73ed9c7c90236fc855bb8c82a809a522fe0ecb78f6
6
+ metadata.gz: 5ccd8a77077495ec21e40047315d1e97f353978a0812ee87a9c6293505eb4064906651daa9d9a4e9fde6877039284d7fc606cf45815b75922aa682ec00ddce95
7
+ data.tar.gz: 69aa0ccde8912a548fd5bd57d244c82945c9adc05b6da50939899946bdc98fc8f50a055c477ca3a938d72aed1682d2b92ba355c1f6eabc7fbf47f1a4cfdfcfea
data/Gemfile CHANGED
@@ -12,6 +12,6 @@ group :development do
12
12
  end
13
13
 
14
14
  group :test do
15
- gem 'rspec'
16
15
  gem 'factory_bot'
16
+ gem 'rspec'
17
17
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qwtf_discord_bot (5.0.4)
4
+ qwtf_discord_bot (5.1.12)
5
5
  discordrb (~> 3.3)
6
6
  redis (~> 4.1)
7
7
  thor (~> 0.20)
data/README.md CHANGED
@@ -86,12 +86,20 @@ This responds to discord messages:
86
86
  qwtf-discord-bot pug
87
87
 
88
88
  This responds to discord messages:
89
+ - `!status`
89
90
  - `!join`
90
91
  - `!leave`
91
- - `!status`
92
- - `!kick <@player>`
93
92
  - `!teamsize <no_of_players>`
94
- - `!notify <@role @role2>`
93
+ - `!kick <@player>`
94
+ - `!team <team_no>`
95
+ - `!unteam`
96
+ - `!addmap <map_name>`
97
+ - `!removemap <map_name>`
98
+ - `!maps`
99
+ - `!map <map_name>`
100
+ - `!win <team_no>`
101
+ - `!draw`
102
+ - `!notify <@role>`
95
103
  - `!end`
96
104
 
97
105
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.11
1
+ 5.3.2
data/bin/bundle CHANGED
@@ -8,46 +8,46 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "rubygems"
11
+ require 'rubygems'
12
12
 
13
13
  m = Module.new do
14
- module_function
14
+ module_function
15
15
 
16
16
  def invoked_as_script?
17
17
  File.expand_path($0) == File.expand_path(__FILE__)
18
18
  end
19
19
 
20
20
  def env_var_version
21
- ENV["BUNDLER_VERSION"]
21
+ ENV['BUNDLER_VERSION']
22
22
  end
23
23
 
24
24
  def cli_arg_version
25
25
  return unless invoked_as_script? # don't want to hijack other binstubs
26
- return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
26
+ return unless 'update'.start_with?(ARGV.first || ' ') # must be running `bundle update`
27
+
27
28
  bundler_version = nil
28
29
  update_index = nil
29
30
  ARGV.each_with_index do |a, i|
30
- if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
31
- bundler_version = a
32
- end
31
+ bundler_version = a if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
33
32
  next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
34
- bundler_version = $1 || ">= 0.a"
33
+
34
+ bundler_version = Regexp.last_match(1) || '>= 0.a'
35
35
  update_index = i
36
36
  end
37
37
  bundler_version
38
38
  end
39
39
 
40
40
  def gemfile
41
- gemfile = ENV["BUNDLE_GEMFILE"]
41
+ gemfile = ENV['BUNDLE_GEMFILE']
42
42
  return gemfile if gemfile && !gemfile.empty?
43
43
 
44
- File.expand_path("../../Gemfile", __FILE__)
44
+ File.expand_path('../Gemfile', __dir__)
45
45
  end
46
46
 
47
47
  def lockfile
48
48
  lockfile =
49
49
  case File.basename(gemfile)
50
- when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
50
+ when 'gems.rb' then gemfile.sub(/\.rb$/, gemfile)
51
51
  else "#{gemfile}.lock"
52
52
  end
53
53
  File.expand_path(lockfile)
@@ -55,8 +55,10 @@ m = Module.new do
55
55
 
56
56
  def lockfile_version
57
57
  return unless File.file?(lockfile)
58
+
58
59
  lockfile_contents = File.read(lockfile)
59
60
  return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
61
+
60
62
  Regexp.last_match(1)
61
63
  end
62
64
 
@@ -68,24 +70,28 @@ m = Module.new do
68
70
  end
69
71
 
70
72
  def load_bundler!
71
- ENV["BUNDLE_GEMFILE"] ||= gemfile
73
+ ENV['BUNDLE_GEMFILE'] ||= gemfile
72
74
 
73
75
  # must dup string for RG < 1.8 compatibility
74
76
  activate_bundler(bundler_version.dup)
75
77
  end
76
78
 
77
79
  def activate_bundler(bundler_version)
78
- if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
79
- bundler_version = "< 2"
80
+ if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new('2.0')
81
+ bundler_version = '< 2'
80
82
  end
81
83
  gem_error = activation_error_handling do
82
- gem "bundler", bundler_version
84
+ gem 'bundler', bundler_version
83
85
  end
84
86
  return if gem_error.nil?
87
+
85
88
  require_error = activation_error_handling do
86
- require "bundler/version"
89
+ require 'bundler/version'
90
+ end
91
+ if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
92
+ return
87
93
  end
88
- return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
94
+
89
95
  warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
90
96
  exit 42
91
97
  end
@@ -100,6 +106,4 @@ end
100
106
 
101
107
  m.load_bundler!
102
108
 
103
- if m.invoked_as_script?
104
- load Gem.bin_path("bundler", "bundle")
105
- end
109
+ load Gem.bin_path('bundler', 'bundle') if m.invoked_as_script?
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("coderay", "coderay")
29
+ load Gem.bin_path('coderay', 'coderay')
File without changes
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("diff-lcs", "htmldiff")
29
+ load Gem.bin_path('diff-lcs', 'htmldiff')
data/bin/ldiff CHANGED
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("diff-lcs", "ldiff")
29
+ load Gem.bin_path('diff-lcs', 'ldiff')
data/bin/pry CHANGED
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("pry", "pry")
29
+ load Gem.bin_path('pry', 'pry')
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("qwtf_discord_bot", "qwtf_discord_bot")
29
+ load Gem.bin_path('qwtf_discord_bot', 'qwtf_discord_bot')
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("rest-client", "restclient")
29
+ load Gem.bin_path('rest-client', 'restclient')
data/bin/rspec CHANGED
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("rspec-core", "rspec")
29
+ load Gem.bin_path('rspec-core', 'rspec')
data/bin/thor CHANGED
@@ -8,11 +8,11 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- require "pathname"
12
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
13
- Pathname.new(__FILE__).realpath)
11
+ require 'pathname'
12
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
13
+ Pathname.new(__FILE__).realpath)
14
14
 
15
- bundle_binstub = File.expand_path("../bundle", __FILE__)
15
+ bundle_binstub = File.expand_path('bundle', __dir__)
16
16
 
17
17
  if File.file?(bundle_binstub)
18
18
  if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
@@ -23,7 +23,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
23
23
  end
24
24
  end
25
25
 
26
- require "rubygems"
27
- require "bundler/setup"
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
28
 
29
- load Gem.bin_path("thor", "thor")
29
+ load Gem.bin_path('thor', 'thor')
@@ -34,6 +34,7 @@ services:
34
34
  - redis
35
35
  environment:
36
36
  - REDIS_URL=redis://redis
37
+ - RATINGS_API_URL
37
38
  volumes:
38
39
  - type: bind
39
40
  source: "/home/ubuntu/.config/qwtf_discord_bot/config.yaml"
@@ -12,7 +12,7 @@ class Endpoint
12
12
 
13
13
  @config.values.each do |settings|
14
14
  settings.each do |setting|
15
- setting["channel_ids"].each do |channel_id|
15
+ setting['channel_ids'].each do |channel_id|
16
16
  channel_ids << channel_id
17
17
  end
18
18
  end
@@ -19,22 +19,28 @@ class EventDecorator
19
19
  user.id
20
20
  end
21
21
 
22
+ def mention
23
+ user.mention
24
+ end
25
+
22
26
  def users
23
27
  server.users
24
28
  end
25
29
 
26
- def mentions_for(user_ids)
27
- find_users(user_ids).map do |user|
28
- user&.mention
29
- end
30
+ def mention_for(user_id)
31
+ find_user(user_id)&.mention
30
32
  end
31
33
 
32
- def display_names_for(user_ids)
33
- find_users(user_ids).map(&:display_name)
34
+ def mentions_for(user_ids)
35
+ find_users(user_ids).map(&:mention)
34
36
  end
35
37
 
36
38
  def display_name_for(user_id)
37
- find_user(user_id) && find_user(user_id).display_name
39
+ find_user(user_id)&.display_name
40
+ end
41
+
42
+ def display_names_for(user_ids)
43
+ find_users(user_ids).map(&:display_name)
38
44
  end
39
45
 
40
46
  private
@@ -57,4 +63,3 @@ class EventDecorator
57
63
  @event.user
58
64
  end
59
65
  end
60
-