Skip to content

0.3.0

Compare
Choose a tag to compare
@kangalio kangalio released this 28 Jul 22:46

New features:

  • Custom arbitrary data associated with commands via custom_data command attribute and Command struct field
  • Make it easier to run a custom event loop by exposing important setup functions
    • set_qualified_names()
    • insert_owners_from_http()
    • This code is run under the hood in the framework setup code and is now accessible to custom event loops too
  • The time crate can now be used in place of chrono (#83)
  • You can now use the check command attribute multiple times to add multiple checks
  • Support for Discord's localization API (#82)
  • Framework::client() method to get the underlying serenity::Client

API updates:

  • Framework::shard_manager() now returns &Arc instead of Arc
  • Context::author_member() return type changed from Member to Cow<'_, Member> to avoid needless cloning (#81)
    • Use .into_owned() to convert Cow<'_, Member> back to Member
  • fn message(self) -> Message method on ReplyHandle split into fn message(&self) -> Cow<'_, Message> and fn into_message(self) -> Message (#84)
    • Reduces cloning if you just need a reference to the message
    • Allows using the ReplyHandle after retrieving the message
  • Framework::build() renamed to Framework::builder() (#96)
  • Framework::start_with() now takes impl FnOnce instead of fn
    • To be usable with with serenity::Client's start_shard, start_shard_range, and start_shards methods
  • Removed serenity re-export at crate root (serenity_prelude still exists!)
  • Command fields renamed: inline_help => description, multiline_help => help_text
  • Command and parameter name and description fields changed from &'static str to String
    • To make them overrideable at runtime
  • Autocomplete functions' partial input parameter is now always &str
    • Was previously String, [i/u][8/16/32/64], f[32/64], depending on parameter type

Behavior changes:

  • Fix identifying_name command attribute not being applied
  • Built-in register commands now report command count correctly
    • Prefix-only commands aren't included anymore
  • ReplyHandle::edit() now keeps parts of the message as before if not specified
  • Fix number autocomplete (was completely borked)
  • Code block parsing is now more precise
    • With ```textwithspecialcharacters, textwithspecialcharacters is no longer recognized as the programming language, but as part of the code (mirroring Discord's behavior)
  • ReplyHandle::edit() now works on ephemeral followup responses

Detailed changelog: v0.2.2...v0.3.0