Select the types of activity you want to include in your feed.
feat: add feature crash_on_unimplemented
This adds the feature crash_on_unimplemented. Before it would crash on debug builds, but this locks it behind a feature flag for better ease of use and less confusion.
···1111[workspace]
1212members = ["examples/examplebot", "macros"]
13131414+1515+[features]
1616+# This feature causes the bot to crash once it recieves an unimplemented dispatch event, useful for development.
1717+crash_on_unimplemented = []
1818+1419[dependencies]
1520anyhow = "1.0.102"
1621async-trait = "0.1.89"
+5-3
README.md
···6464#[command(PingCommand)]
6565async fn execute(api: &FluxerApiHandler, feedback: &CommandFeedback) {
6666 let data = feedback.data;
6767+ let channel = Channel::new(&data.channel_id, api);
6868+ let message = channel.message(&data.id);
6969+ message.reply("pong").await?;
67706868- send_reply(api, &data.channel_id, &data.id, "pong").await?;
6971 Ok(())
7072}
7173```
···7880# Dispatch events
7981Not all op codes are implemented currently, and not all dispatch events have been registered yet. The reason for the latter is that i choose for the most part to implement data structure myself instead of generating it from a spec. So whenever an unknown dispatch event hits it would print the json that was attempted to be sent, then i implement the structure from it. Which leads to the next paragraph.
80828181-When developing a bot in debug mode, be wary as there is a certain panic that will occur when an unimplemented dispatch event occurs. It's there by design for my own ease of use ( So i have no choice but to implement the event if i don't want constant crashing ;3). While it's not optimal i do advise to use release mode for now while still a bunch of dispatch events are missing as it will only send an error log in the terminal for said dispatch event.
8383+If you want to help implement dispatch events, it would be good to enable the feature flag "crash_on_unimplemented", this will throw a panic the moment an unimplemented dispatch event occurs. It's there for my own ease of use ( So i have no choice but to implement the event if i don't want constant crashing ;3). Without this flag it will only send an error log in the terminal for said dispatch event.
82848385# API
8486As far as API calls go there are very few implemented at the moment but are quite useful ones like:
···176178177179 Ok(result)
178180}
179179-```181181+```