3 ms·
I did a small discord bot 4-5 months ago with serenity, and while it worked, I found it was a mess. It felt like someone was trying to force functional program
by Luker88 4y ago
I did a small discord bot 4-5 months ago with serenity, and while it worked, I found it was a mess.
It felt like someone was trying to force functional programming on rust, with typenames from java.
Sure it works but the code looked very verbose, and the ridiculous types like 'ApplicationCommandInteractionDataOptionValue' definitely did not help.
Serenity works well, it's just definitely not rust-style.
- surrTurr 4y agoYou might like Twilight[1]. It is a smaller project, but a lot more modular and "rusty". [1]: https://github.com/twilight-rs/twilight https://github.com/twilight-rs/twilight
- nominusllc 4y agoThe word you're looking for is 'idiomatic'
- kangalioo 4y agoThe type in question has since been renamed to CommandDataOption, as well as other such long types (https://github.com/serenity-rs/serenity/pull/1899 https://github.com/serenity-rs/serenity/pull/1899). With forced functional programming, you may be referring to serenity's builders? For example .send_message(|m| m .content("text") .embed(|e| e .description("...") .timestamp("...") ) .components(|c| c .create_action_row(|r| r .create_button(|b| b .style(ButtonStyle::Primary) .label("press me") .custom_id("button1") ) ) ) ).await?; In the next breaking release (`next` branch in git), we have a new by-value builder style which has turned out to be a better design in many ways: .send_message(CreateMessage::new() .content("text") .embed(CreateEmbed::new() .description("...") .timestamp("...") ) .components(CreateComponents::new() .add_action_row(CreateActionRow::new() .add_button( CreateButton::new(ButtonStyle::Primary, "button1").label("press me") ) ) ) ) And a PR is open to make the API even better (replace redundant CreateComponents with Vec<CreateActionRow>) and more will be coming presumably. Does this seem more rusty to you? We're open to more criticism - developmenet on serenity is quite active currently (e.g. 52 PRs merged in the last month)