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
110
pub points
23%
popularity

Publisher

verified publisheroshanu.art

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