qwtf_discord_bot 5.5.6 → 5.5.11

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/VERSION +1 -1
  4. data/lib/dashboard.rb +18 -5
  5. data/lib/pug.rb +1 -0
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b23056513d2164179b74059da9679cad97749b7b541a72c3cfc5dd5f4cf7f8e
4
- data.tar.gz: cdea90ab6a7539a83aa4cb80a8c3766d0931c78ece2d197905b351b53b0a3540
3
+ metadata.gz: d80c495a035630d38507c5cb5f1d523a40b92f6e0bb7be6703e60124657d9eaf
4
+ data.tar.gz: d56c1c31f43fee69628d0ad10a631213a35f854a1109d0148c8b32486253254d
5
5
  SHA512:
6
- metadata.gz: 0ae5e3ab1a227bfe61805e53ffdcdb5ceeb90b541eb693a7bb17f45cf510185a0efc004f3f8b6aabc11192aaf413ed5e0510d1720992efcf62d456baeda00169
7
- data.tar.gz: 9c012e37ca4c35697513e5ff082d7ab5d6060b05280f9daa01e8aa156848a8cebb3594130e86b1fc3bfcdf148096c3c39ea024b1f01461e6d034aa618a79fb3f
6
+ metadata.gz: 9c99d3227ae01315b829469e9cb14c28041917506e331a75de7773ec48241ae40ba8985ae3a12eb8437e57e944c6561b2d26373bcb7cecc584798842337cc3ab
7
+ data.tar.gz: 35dde220e2248935dd8e0f96bff722a35d9aecfc7b93f3c72dbba6bb0cd5fbfa3afb2943c36f18975c416fd763c505aa54903118ce60a372e6d5b67bd80d2053
data/README.md CHANGED
@@ -56,6 +56,13 @@ A Discord bot for checking the status of QuakeWorld Team Fortress servers
56
56
  hwguy: "<:hwguy_blue:456062063190736926>"
57
57
  spy: "<:spy_blue:456062062032846849>"
58
58
  engineer: "<:engineer_blue:456062031125020683>"
59
+ dashboards:
60
+ - server_id: 744911007859736616
61
+ name: "active-servers"
62
+ endpoints:
63
+ - "sydney.fortressone.org"
64
+ - "sydney.fortressone.org:27510"
65
+ - "dallas.fortressone.org"
59
66
  ```
60
67
 
61
68
  - Use the `QWTF_DISCORD_BOT_CONFIG_FILE` environment variable to specify an
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.5.6
1
+ 5.5.11
@@ -4,15 +4,28 @@ class Dashboard
4
4
  @endpoints = dashboard_config["endpoints"]
5
5
  @messages = {}
6
6
 
7
+ channel_name = dashboard_config["name"]
8
+
7
9
  old_dashboard_channel = @server.channels.find do |chan|
8
- chan.name == "dashboard" && chan.topic = "QWTF Bot Dashboard"
10
+ chan.name == channel_name
9
11
  end
10
12
 
11
- old_dashboard_channel && old_dashboard_channel.delete
13
+ @channel = if old_dashboard_channel
14
+ position = old_dashboard_channel.position
15
+ topic = old_dashboard_channel.topic
16
+ category = old_dashboard_channel.category
17
+ old_dashboard_channel.delete
12
18
 
13
- @channel = @server.create_channel("dashboard")
14
- @channel.topic = "QWTF Bot Dashboard"
15
- @channel.position = dashboard_config["position"]
19
+ @server.create_channel(channel_name).tap do |channel|
20
+ channel.position = position
21
+ channel.topic = topic if topic
22
+ channel.category = category if category
23
+ end
24
+ else
25
+ @server.create_channel(channel_name).tap do |channel|
26
+ channel.topic = "QWTF Bot Dashboard"
27
+ end
28
+ end
16
29
  end
17
30
 
18
31
  def update
data/lib/pug.rb CHANGED
@@ -16,6 +16,7 @@ class Pug
16
16
  end
17
17
 
18
18
  def join_team(team_no:, player_id:)
19
+ redis.setnx(pug_key, Time.now.to_i)
19
20
  leave_teams(player_id)
20
21
  redis.sadd(team_key(team_no), player_id)
21
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qwtf_discord_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.6
4
+ version: 5.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheldon Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-29 00:00:00.000000000 Z
11
+ date: 2020-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb