Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Releases: Pincer-org/Pincer

0.7.2 ~ Argument choices + bugfixes

02 Oct 13:50
fb91140
Compare
Choose a tag to compare
Pre-release

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}`"

image

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}`"

image

(So when This will be the test value is selected the bot will return You chose: 'Test')

Argument descriptions

02 Oct 09:26
008d608
Compare
Choose a tag to compare
Argument descriptions Pre-release
Pre-release

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

image

Cooldown commands & BugFixes

28 Sep 17:48
3a86694
Compare
Choose a tag to compare
Pre-release
  • Command Context
  • Added a customizable cooldown system for commands

Quick Example can be found withint /examples/cooldown.py

0.6.10 Yieldable command - Fix

20 Sep 08:59
Compare
Choose a tag to compare
Pre-release

Fixing sub packages for 0.6.9

0.6.9 - Yieldable commands

19 Sep 21:08
c2e443f
Compare
Choose a tag to compare
Pre-release

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

17 Sep 18:59
Compare
Choose a tag to compare
Pre-release

Fixed missing event package

Pincer - 0.6.7 Core HTTP changes, Gateway Intents and bug fixes

13 Sep 13:49
Compare
Choose a tag to compare
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

11 Sep 13:58
Compare
Choose a tag to compare
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

10 Sep 18:35
Compare
Choose a tag to compare
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

10 Sep 13:44
Compare
Choose a tag to compare
Pre-release
The package is currently within the planning phase

Just fixes issues with the PyPi readme.