๐จ Negligible Changes
- Use f-strings rather than format
- Use NotImplementedError
- Remove MISSING and replace with Optional for Messages
- Using TypedDicts for JSON
โจ New Changes
- Added type-hinting QalibContext, QalibInteraction, and Renderer so binding keys now works
py
from typing import Literal
import discord
from discord.ext.commands import AutoShardedBot
import qalib
bot = AutoShardedBot(intents=discord.Intents.all(), command_prefix="!")
Messages = Literal["balance"]
bot.command()
qalib.qalib_context(formatter.Formatter(), "messages.xml")
async def balance(ctx: qalib.QalibContext[Messages]):
await ctx.rendered_send("balance")
๐งช Tests Changes
- Using mock rather than user-defined MockedClasses when possible
- Added Type Hints binding
- Made util.py in tests to refactor โป๏ธ
๐ Documentation
- Fixed documentation errors, that don't wholly show how to use it, and potential bugs
- Added how to use type-hints to bind to the key
๐ Fixed Bugs
- Pull Request should resolve a lot of bugs, and fix issues with using slash commands
- Fix issues with presenting emojis in components
- pyright passes โ
- mypy passes โ
- pylint passes โ
๐๏ธ Formatter
- Running black formatter, pyproject.toml contains info on how to format
โฌ๏ธ Minor Version Increase
**Full Changelog**: https://github.com/YousefEZ/discord-qalib/compare/2.0.0...2.1.0