discord_bot 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/discord_bot/client.rb +7 -1
- data/lib/discord_bot/client/channels/channel.rb +1 -1
- data/lib/discord_bot/client/channels/create_message.rb +1 -1
- data/lib/discord_bot/client/channels/create_webhook.rb +1 -1
- data/lib/discord_bot/client/gateway/get_gateway.rb +17 -0
- data/lib/discord_bot/client/gateway/get_gateway_bot.rb +17 -0
- data/lib/discord_bot/client/guilds/channels.rb +1 -1
- data/lib/discord_bot/client/users/create_channel.rb +2 -2
- data/lib/discord_bot/client/users/me.rb +17 -0
- data/lib/discord_bot/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22f07e1046ede942c51de185d2e3261c14311e55db9e92c8d9f2274637e1fcc8
|
4
|
+
data.tar.gz: f8caaf10b9769495fd72bc838f58593ab7cec3358b4add1cae663ffe9566c863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a688afed480d794d81a00801ac45057ee67d355214cdda27c6e96a3439fe12d49cabeab6749c1fce91fb0b970448d7e88375a5e323e8c1716088a0b0fec8cf32
|
7
|
+
data.tar.gz: 918a900903b1e2c1a7c593078097dd65e103f871162dd4cdb8507a7af8274a23b1ebea5d584e577cdbc6aa2efff4dad4df42cf0e358909a16941cd9cd1d9190f
|
data/lib/discord_bot/client.rb
CHANGED
@@ -6,6 +6,9 @@ require_relative 'client/channels/create_message'
|
|
6
6
|
require_relative 'client/channels/create_webhook'
|
7
7
|
require_relative 'client/webhooks/execute'
|
8
8
|
require_relative 'client/users/create_channel'
|
9
|
+
require_relative 'client/users/me'
|
10
|
+
require_relative 'client/gateway/get_gateway'
|
11
|
+
require_relative 'client/gateway/get_gateway_bot'
|
9
12
|
|
10
13
|
module DiscordBot
|
11
14
|
# Client library
|
@@ -18,8 +21,11 @@ module DiscordBot
|
|
18
21
|
include DiscordBot::Client::Channels::CreateWebhook
|
19
22
|
include DiscordBot::Client::Webhooks::Execute
|
20
23
|
include DiscordBot::Client::Users::CreateChannel
|
24
|
+
include DiscordBot::Client::Users::Me
|
25
|
+
include DiscordBot::Client::Gateway::GetGateway
|
26
|
+
include DiscordBot::Client::Gateway::GetGatewayBot
|
21
27
|
|
22
|
-
base_uri 'https://discordapp.com/api'
|
28
|
+
base_uri 'https://discordapp.com/api/v6'
|
23
29
|
format :json
|
24
30
|
|
25
31
|
attr_reader :bot_token, :user_agent
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DiscordBot
|
2
|
+
class Client
|
3
|
+
# Gateway module
|
4
|
+
module Gateway
|
5
|
+
# Gateway module
|
6
|
+
module GetGateway
|
7
|
+
# Get gateway
|
8
|
+
def get_gateway
|
9
|
+
# define params for request
|
10
|
+
headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bot #{bot_token}", 'User-Agent' => user_agent }
|
11
|
+
# make request
|
12
|
+
self.class.get('/gateway', query: {}, headers: headers).parsed_response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DiscordBot
|
2
|
+
class Client
|
3
|
+
# Gateway module
|
4
|
+
module Gateway
|
5
|
+
# Gateway module
|
6
|
+
module GetGatewayBot
|
7
|
+
# Get gateway bot
|
8
|
+
def get_gateway_bot
|
9
|
+
# define params for request
|
10
|
+
headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bot #{bot_token}", 'User-Agent' => user_agent }
|
11
|
+
# make request
|
12
|
+
self.class.get('/gateway/bot', query: {}, headers: headers).parsed_response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DiscordBot
|
2
|
+
class Client
|
3
|
+
# Users module
|
4
|
+
module Users
|
5
|
+
# Get user info module
|
6
|
+
module Me
|
7
|
+
# Returns user
|
8
|
+
def me
|
9
|
+
# define params for request
|
10
|
+
headers = { 'Content-Type' => 'application/json', 'Authorization' => "Bot #{bot_token}", 'User-Agent' => user_agent }
|
11
|
+
# make request
|
12
|
+
self.class.get('/users/@me', query: {}, headers: headers).parsed_response
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/discord_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discord_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Bogdanov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,9 +91,12 @@ files:
|
|
91
91
|
- lib/discord_bot/client/channels/channel.rb
|
92
92
|
- lib/discord_bot/client/channels/create_message.rb
|
93
93
|
- lib/discord_bot/client/channels/create_webhook.rb
|
94
|
+
- lib/discord_bot/client/gateway/get_gateway.rb
|
95
|
+
- lib/discord_bot/client/gateway/get_gateway_bot.rb
|
94
96
|
- lib/discord_bot/client/guilds/channels.rb
|
95
97
|
- lib/discord_bot/client/guilds/members.rb
|
96
98
|
- lib/discord_bot/client/users/create_channel.rb
|
99
|
+
- lib/discord_bot/client/users/me.rb
|
97
100
|
- lib/discord_bot/client/webhooks/execute.rb
|
98
101
|
- lib/discord_bot/version.rb
|
99
102
|
homepage: https://github.com/kortirso/discord_bot
|