Skip to content

fix!: remove serviceClasses #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ module.exports = {
plugins: ['@typescript-eslint', 'jest'],
rules: {
'prettier/prettier': 'warn',
'no-cond-assign': [2, 'except-parens'],
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 1,
'no-cond-assign': ['error', 'except-parens'],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'warn',
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'warn',
'no-empty': [
'error',
{
Expand Down
14 changes: 14 additions & 0 deletions docs/examples/service-class.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const dbots = require('dbots')

// You can get the service class through the Service util, using a service alias
const TopGG = dbots.Service.get('topgg')

// You can craete an instance using your token, that will allow you to access the API
const serviceInstance = new TopGG('your-token')

// You can then use every method listed in the class docs
serviceInstance.getBot('bot-id')
.then(data => {
// ...
})
.catch(console.error)
2 changes: 2 additions & 0 deletions docs/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
path: no-client.js
- name: Custom Services
path: custom-service.js
- name: Using Service classes
path: service-class.js
Loading