discordcdn 0.0.1 copy "discordcdn: ^0.0.1" to clipboard
discordcdn: ^0.0.1 copied to clipboard

Discord as a CDN! Upload images with ease to Discord and serve them in your applications!

example/README.md

example #

There are two examples you can use to try discordcdn. The easiest one is yet to arrive, a Flutter web application that prompts you the needed credentials (bot token and channel id) and the URL of an image to upload. The other example is a standalone Dart application, found in the cli folder.

final botToken = '<bot_token>';

final channelId = '<channel_id>';

// Create discord client that interacts as a bot
final discordClient = withBotToken(botToken);

// Upload image
final uploadImageResult = await discordClient.uploadImage(
    image: DiscordUploadableImage(
        bytes: dart_logo_bytes,
        format: 'jpeg',
        name: 'my super cool image',
    ),
    channelId: channelId,
);

// Tadaaaam!
print(uploadImageResult);

exit(0);
3
likes
130
points
30
downloads

Publisher

verified publisheroshanu.art

Weekly Downloads

Discord as a CDN! Upload images with ease to Discord and serve them in your applications!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dartz, http

More

Packages that depend on discordcdn