Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 26, 2020. It is now read-only.

HiruNya/dawn-wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

This crate aims to provide an easy way to wait for new messages in a Discord channel. This is meant to be used alongside the crates from the dawn ecosystem.

The equivalent of this in other languages/frameworks would be the awaitMessages method in discord.js and the wait_for function in discord.py.

Examples

To try out the examples in the examples directory, a Discord token needs to be set as the environmental variable DISCORD_TOKEN. This can be done by either creating a .env file or setting it from the shell.

export DISCORD_TOKEN="Discord.Token.Here"
cargo run --example basic

Then type in !example in a Discord channel which the bot has access to.

Preview

Note

This crate uses dashmap underneath for its concurrent data structure which does not provide a way of polling the availability for a lock and therefore the acquiring of a Read or Write lock cannot be asynchronous and must be blocking. I have not seen this cause a problem however on the other hand I haven't tested this out with heavier workloads so please make an issue if you do encounter problems.

About

Wait for messages in Discord.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages