dblista 0.5.0 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c39d8fe14ad93cfc84137e860ecb152039179ff8f72621e2b1ebc0ae0bc72b12
4
- data.tar.gz: a20e7197c4ac2bc5dc92aab67a64c1df1770094c319375922e9b8716c6c333d2
3
+ metadata.gz: b662a5b156e72ac37ec051e1bffb77587db382a8ded509544cd0fd67b56242b0
4
+ data.tar.gz: 1622b294e66a1977e63b7f60b758643b961907d895ec2884781ab3780a8b9076
5
5
  SHA512:
6
- metadata.gz: f38b5ed0959c732dec05bcc85a2f74790ad42d3999659ed9bc5a49d25a8846b223864207bea327ede6151037fab857759c3ab10021ee34b102a348c3e12ae553
7
- data.tar.gz: c5214e909e8a5e962d770357cd0084803ef945b0a0b3a22617d8463f275035298a701a85772e9f9ebb741a08f85d0c094f16ce678160c86361e1857598fda0ad
6
+ metadata.gz: 26852865ee9ac0534f350da349872f5ab6f97329017b0c34eec7779e7aa5a87242829dfba29cb14aff6240f1d779c3051eba962792372f52141c52c99a51dcaa
7
+ data.tar.gz: 02cdea3a50877b4f53c112648a40df8b35db33e4a6c5263d7fd9a9bf70b10fdcd8f897caf92c8f170385fe5bc79b485585c6ad3ed89286daeaf2dcfef9743314
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dblista (0.5.0)
4
+ dblista (0.6.2)
5
5
  zache
6
6
 
7
7
  GEM
@@ -25,6 +25,7 @@ GEM
25
25
  zache (0.12.0)
26
26
 
27
27
  PLATFORMS
28
+ ruby
28
29
  x86-mingw32
29
30
 
30
31
  DEPENDENCIES
data/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # DBLista Ruby wrapper [![Gem Version](https://badge.fury.io/rb/dblista.svg)](https://badge.fury.io/rb/dblista)
1
+ # DList (kiedyś DBLista) Ruby wrapper [![Gem Version](https://badge.fury.io/rb/dblista.svg)](https://badge.fury.io/rb/dblista)
2
2
 
3
3
  [Dokumentacja](https://www.rubydoc.info/github/marek12306/dblista-wrapper-ruby)
4
4
 
5
- Gem pozwalający na komunikację z API DBListy.
5
+ Gem pozwalający na komunikację z API DList.
6
6
 
7
7
  Pozwala na:
8
8
 
9
9
  - Automatyczne/ręczne wysyłanie statystyk
10
10
  - Kontrolowanie kontem użytkownika
11
- - Pobieranie różnych list botów oraz serwerów oraz wyszukiwanie
11
+ - Pobieranie różnych list botów, serwerów oraz ich wyszukiwanie
12
12
  - Pobieranie informacji o botach, serwerach oraz użytkownikach
13
13
 
14
14
  ## Instalacja
@@ -21,7 +21,7 @@ module DBLista
21
21
  # DBLista error class
22
22
  class Error < StandardError; end
23
23
  # API path prefix
24
- API_PATH = 'https://api.dblista.pl/v1'
24
+ API_PATH = 'https://api.dlist.top/v1'
25
25
  # Regexp for checking if string is a number
26
26
  IS_NUMBER = /^\d+$/.freeze
27
27
 
@@ -61,7 +61,7 @@ module DBLista::List
61
61
  # @return [Array] array of raw bot data from DBLista
62
62
  def self.all
63
63
  DBLista._cache(:botsall) do
64
- DBLista._get("/bots/list/top/0?limit=1000000")
64
+ DBLista._get('/bots/list/top/0?limit=1000000')
65
65
  end
66
66
  end
67
67
 
@@ -36,7 +36,7 @@ module DBLista::List
36
36
  # @return [Array] array of raw server data from DBLista
37
37
  def self.all
38
38
  DBLista._cache(:serversall) do
39
- DBLista._get("/servers/list/top/0?limit=1000000")
39
+ DBLista._get('/servers/list/top/0?limit=1000000')
40
40
  end
41
41
  end
42
42
 
@@ -58,6 +58,7 @@ module DBLista::User
58
58
  }, @token)
59
59
  true
60
60
  end
61
+
61
62
  # Generates token for bot
62
63
  #
63
64
  # @param id [Integer] bot ID
@@ -66,5 +67,14 @@ module DBLista::User
66
67
  DBLista._validate_id id
67
68
  DBLista._get("/bots/stats/#{id}?token=#{@token}")
68
69
  end
70
+
71
+ # Resets token for bot
72
+ #
73
+ # @param id [Integer] bot ID
74
+ # @return [Hash] raw data from DBLista
75
+ def reset_token(id)
76
+ DBLista._validate_id id
77
+ DBLista._post("/bots/stats/#{id}/reset", nil, @token)
78
+ end
69
79
  end
70
80
  end
@@ -56,7 +56,7 @@ module DBLista::User
56
56
  # Fetches current user guilds
57
57
  #
58
58
  # @return [Hash] raw data from DBLista
59
- def guilds
59
+ def joined_guilds
60
60
  @cache.get(:guilds, lifetime: DBLista::CACHE_LIFETIME) do
61
61
  DBLista._get('/users/me/guilds', @token)
62
62
  end
@@ -7,13 +7,14 @@ module DBLista::User
7
7
  #
8
8
  # @return [Hash] raw data from DBLista
9
9
  def servers
10
- DBLista._get("/servers/user/me", nil, @token)
10
+ DBLista._get('/servers/user/me', @token)
11
11
  end
12
+
12
13
  # Fetches your bots
13
14
  #
14
15
  # @return [Hash] raw data from DBLista
15
16
  def bots
16
- DBLista._get("/bots/user/me", nil, @token)
17
+ DBLista._get('/bots/user/me', @token)
17
18
  end
18
19
  end
19
20
  end
@@ -20,6 +20,7 @@ module DBLista::User
20
20
  }, @token)
21
21
  true
22
22
  end
23
+
23
24
  # Removes rate for a selected bot/server
24
25
  #
25
26
  # @param id [Integer] entity ID
@@ -33,6 +34,7 @@ module DBLista::User
33
34
  DBLista._delete("/#{type}s/#{id}/rate/#{target_id}", nil, @token)
34
35
  true
35
36
  end
37
+
36
38
  # Reports rate of a selected bot/server
37
39
  #
38
40
  # @param id [Integer] ID
@@ -49,12 +51,14 @@ module DBLista::User
49
51
  }, @token)
50
52
  true
51
53
  end
54
+
52
55
  # Fetches all rate reports
53
56
  #
54
57
  # @return [Hash] raw data from DBLista
55
58
  def reports
56
59
  DBLista._get('/reports')
57
60
  end
61
+
58
62
  # Deletes rate report
59
63
  #
60
64
  # @param id [Integer] report ID
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DBLista
4
4
  # Wrapper version
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.4'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblista
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - deepivin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2020-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zache
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.0.3
127
+ rubygems_version: 3.1.2
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Wrapper for dblista.pl API