Skip to content

Commit 429e2fb

Browse files
committed
cleanup readme
1 parent a33ba85 commit 429e2fb

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
## Usage
55
```ts
6-
import { RestClient, CDN, DiscordRestError, DiscordAPIError, RatelimitError } from '@wumpcord/rest';
7-
import { createReadStream } from 'fs';
6+
import { RestClient, CDN, DiscordRestError, DiscordAPIError } from '@wumpcord/rest';
7+
import { readFileSync } from 'fs';
88

99
// CDN
1010
CDN.getDefaultAvatar('5820'); //=> 'https://cdn.discordapp.com/embed/avatars/0.png'
@@ -22,7 +22,7 @@ rest.dispatch({
2222
content: 'Hello, world!'
2323
},
2424
file: {
25-
buffer: createReadStream('./path/to/some/file.png'),
25+
file: readFileSync('./path/to/some/file.png'),
2626
name: 'file.png'
2727
}
2828
}).then(message => {
@@ -40,11 +40,6 @@ rest.dispatch({
4040
// `error` => DiscordAPIError
4141
}
4242

43-
// How about we were ratelimited?
44-
if (error instanceof RatelimitError) {
45-
// `error` => RatelimitError
46-
}
47-
4843
// I guess it's none of those 3, how can it happen?
4944
console.error(error);
5045
});

0 commit comments

Comments
 (0)