Skip to content

v0.5.0

Choose a tag to compare

@zunda-arrow zunda-arrow released this 25 Jan 19:51
· 52 commits to main since this release
79d78ac

v0.5.0

This is quite a massive release. I have made breaking changes to crescent that make it more opinionated and more functional than object-oriented.

What's Changed

  • v1.0 Client API by @Lunarmagpie in #267
  • Remove dependency on attrs by @Lunarmagpie in #271
  • 💥 Use floodgate for ratelimiting by @Lunarmagpie in #276
  • Support RESTBot by @circuitsacul in #278
  • Support model object to store globals by @Lunarmagpie in #280
  • Add unload_all function for plugin manager by @Lunarmagpie in #281

Breaking Changes

  • You bot now should be created as follows:
bot = hikari.GatewayBot("TOKEN")
client = crescent.Client(bot)
  • All uses of @bot.include should replaced with @client.include. Plugins are now loaded with client.plugins.load().
  • Plugins now have to be declared as crescent.Plugin[YourBotType, ModelType](). These generics will be optional once mypy supports pep 696.
  • The plugin.bot property has been renamed to plugin.app.
  • crescent.ext.cooldowns now uses datetime.timedelta instead of floats.

Model API

Crescent now supports a global model object to store information.

class Model:
    ...

bot = hikari.GatewayBot("TOKEN")
client = crescent.Client(bot, Model())

# In your plugin file
plugin = crescent.Plugin[hikari.GatewayBot, Model]()

# Once the plugin is loaded you can access the model object with `plugin.model`
plugin.model

Here is an example project using the new system: https://github.com/magpie-dev/crescent-template

Full Changelog: v0.4.0...v0.5.0