Skip to content

Commit

Permalink
cleanup readme
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Apr 25, 2021
1 parent a33ba85 commit 429e2fb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Usage
```ts
import { RestClient, CDN, DiscordRestError, DiscordAPIError, RatelimitError } from '@wumpcord/rest';
import { createReadStream } from 'fs';
import { RestClient, CDN, DiscordRestError, DiscordAPIError } from '@wumpcord/rest';
import { readFileSync } from 'fs';

// CDN
CDN.getDefaultAvatar('5820'); //=> 'https://cdn.discordapp.com/embed/avatars/0.png'
Expand All @@ -22,7 +22,7 @@ rest.dispatch({
content: 'Hello, world!'
},
file: {
buffer: createReadStream('./path/to/some/file.png'),
file: readFileSync('./path/to/some/file.png'),
name: 'file.png'
}
}).then(message => {
Expand All @@ -40,11 +40,6 @@ rest.dispatch({
// `error` => DiscordAPIError
}

// How about we were ratelimited?
if (error instanceof RatelimitError) {
// `error` => RatelimitError
}

// I guess it's none of those 3, how can it happen?
console.error(error);
});
Expand Down

0 comments on commit 429e2fb

Please sign in to comment.