Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

0.4.0

Compare
Choose a tag to compare
@Kenny2github Kenny2github released this 21 Feb 16:25

New Stuff

  • Support new API "resolved" object
    • USER, CHANNEL, and ROLE options are now passed as types Union[discord.<type>, discord.ext.slash.Partial<type>, discord.Object] (exception: USER arguments can also be of type discord.User)
    • Context.author is now Union[discord.Member, discord.ext.slash.PartialMember, None] - second thanks to new changes, third because slash commands can be run in DMs with no member context
    • If SlashBot kwarg resolve_not_fetch=True (the default), no fetching or getting is attempted if the object can be resolved
    • If SlashBot kwarg fetch_if_not_get=True (default False), no API fetching is attempted if getting from bot cache fails
  • Command.created_at is now available

Changes

  • Context.author is now no longer guaranteed to be a discord.Member (it is now Optional[discord.Member]) because slash commands can be run in DMs now which have no member context
  • Context.guild is now Union[discord.Guild, discord.Object, None] instead of a guaranteed Object for the same reason
  • Context.me is now Union[discord.Member, discord.Object] instead of Optional[discord.Member] to be consistent
  • Parameters to command coroutines that are required by the coro now automatically have their Option.required set to True regardless of the previous value
  • Parameters to command coros that are required by the coro but cannot have values passed to them by the library/API (i.e. not annotated with a Context subclass or Option instance) now cause a TypeError on declaration of the command