Releases: Pincer-org/Pincer
0.7.2 ~ Argument choices + bugfixes
Changes
- Implemented argument choices
- Bugfix for
Optional
and descriptions
Example
You can add choices to arguments through the pincer.Choices
(which is an alias for typing.Literal
).
Choice values must consist of the same type, and there can only be a maximum of 25 choices.
@command()
async def choose(self, choice: Choices["Test", "Sample lol", "Geheh"]):
return f"You chose: `{choice}`"
Example with custom name/value
You can manually override the default name (which is set to the value) of a choice.
This is done through a tuple, where the first value is the choice name and the second one is the value. These can be combined with default choices. (so no tuple, as seen in the example)
@command()
async def choose(
self,
choice: Choices[
("This will be the test value", "Test"),
"Sample lol",
"Geheh"
]
):
return f"You chose: `{choice}`"
(So when This will be the test value
is selected the bot will return You chose: 'Test'
)
Argument descriptions
This version implement the support for argument descriptions.
Examples
before
0.7.1
still suppported
@command(description="Add two numbers!")
async def add(
first: int,
second: int
):
return f"The addition of `{first}` and `{second}` is `{first + second}`"
argument descriptions
@command(description="Add two numbers!")
async def add(
first: (int, "The first number"),
second: (int, "The second number")
):
return f"The addition of `{first}` and `{second}` is `{first + second}`"
Result within discord
Cooldown commands & BugFixes
- Command Context
- Added a customizable cooldown system for commands
Quick Example can be found withint
/examples/cooldown.py
0.6.10 Yieldable command - Fix
Fixing sub packages for 0.6.9
0.6.9 - Yieldable commands
Introducing yieldable command (thx to Endercheif)
Example
@command(guild=881531065859190804)
async def lottery(self, numbers: int, guess: int):
if numbers < 1:
yield 'Please try again with 2 or more numbers'
return
elif numbers > 100:
yield 'Please try again with 100 or less numbers'
return
yield f'Your {numbers} lucky numbers for today are:'
has_won = False
for _ in range(numbers):
num = random.randint(0, 100)
yield f'{num}'
if num == guess:
has_won = True
if has_won:
yield f'Congratulations! {guess} was a winning number.'
else:
yield f'You tried your best'
Pincer - 0.6.8 Bug Fixe
Fixed missing event
package
Pincer - 0.6.7 Core HTTP changes, Gateway Intents and bug fixes
❗ | The package is currently within the planning phase |
---|
Core HTTP changes, Gateway Intents and bug fixes
Changes
- General code refactoring
- Changed the way how the HttpClient is used
- Implemented Discord Gateway events (Note: No extra middle-ware has been added, so unknown events will raise an exception)
- Refactored the way library event middle-ware will be created
Bug fixes
- Some messages not being sent because of embed checks
- Per guild command registration endpoints not being reset
Special thanks
We would like to thank @Maneren for improving the HttpClient module and the way it is being used!
Pincer - 0.6.5 Embed Fixes & Improvements
❗ | The package is currently within the planning phase |
---|
- Fixed
set_thumbnail
&set_image
setters - Added mass field adder
- Added Embed return within commands.
Example
Basic embed
@command(description="How to make embed!")
async def embed_test(self):
return Embed(
title="Pincer - 0.6.4",
color=16768339,
description=(
"🚀 An asynchronous python API wrapper meant to replace"
" discord.py\n> Snappy discord api wrapper written "
"with aiohttp & websockets"
),
).add_field(
name="**Github Repository**",
value="> https://github.com/Pincer-org/Pincer"
).set_thumbnail(
url="https://pincer.dev/img/icon.png"
).set_image(
url=(
"https://repository-images.githubusercontent.com"
"/400871418/045ebf39-7c6e-4c3a-b744-0c3122374203"
)
)
Pincer - 0.6.4 Command guild registration bugfix
❗ | The package is currently within the planning phase |
---|
Bugfix for the command guild registration and added some more objects.
Pincer - 0.6.3 PyPi desc fixes
❗ | The package is currently within the planning phase |
---|
Just fixes issues with the PyPi readme.