v0.5.0
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_allfunction 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.includeshould replaced with@client.include. Plugins are now loaded withclient.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.botproperty has been renamed toplugin.app. crescent.ext.cooldownsnow usesdatetime.timedeltainstead 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.modelHere is an example project using the new system: https://github.com/magpie-dev/crescent-template
Full Changelog: v0.4.0...v0.5.0