Skip to content

Commit

Permalink
Remove rest client functionality
Browse files Browse the repository at this point in the history
Minor change to remove deprecated top.gg rest API server check
  • Loading branch information
Humblemonk committed Mar 29, 2024
1 parent a082e72 commit afb9934
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ gem 'base64', '~> 0.1.0'
gem 'dicebag', git: 'https://github.com/Humblemonk/Dice-Bag.git', branch: 'pre-3.3'
gem 'discordrb', github: 'shardlab/discordrb', branch: 'main'
gem 'dotenv', '~> 2.5'
gem 'rest-client', '~> 2.0', '>= 2.0.2'
gem 'rubocop', require: false
gem 'sqlite3', '~> 1.3', '>= 1.3.11'
10 changes: 1 addition & 9 deletions dice_maiden.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dice bot for Discord
# Author: Humblemonk
# Version: 8.7.0
# Version: 8.7.1
# Copyright (c) 2017. All rights reserved.
# !/usr/bin/ruby
# If you wish to run a single instance of this bot, please follow the "Manual Install" section of the readme!
Expand Down Expand Up @@ -32,8 +32,6 @@
$db.busy_timeout = (10_000)
end

require 'rest-client' if @shard == 0

mutex = Mutex.new

if @shard == 0
Expand Down Expand Up @@ -206,11 +204,5 @@
# Bot died and cant connect to Discord. Kill the bot and have eye restart it
exit!
end
# Limit HTTP POST to shard 0. We do not need every shard hitting the discordbots API
next unless @shard == 0

servers = $db.execute 'select sum(server_count) from shard_stats;'
RestClient.post('https://top.gg/api/bots/377701707943116800/stats',
{ "shard_count": @total_shards, "server_count": servers.join.to_i }, 'Authorization': ENV['API'], 'Content-Type': :json)
end
end
4 changes: 4 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 8.7.1 - 2024-03-28
### Added
- Removed rest client API functionality

## 8.7.0 - 2024-03-25
### Added
- Refactored Gemfile
Expand Down

0 comments on commit afb9934

Please sign in to comment.