πŸš€ An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Overview

Pincer Logo Pincer

Scrutinizer Code Quality Build Status GitHub repo size GitHub last commit GitHub commit activity GitHub Code Style Discord

An asynchronous python API wrapper meant to replace discord.py

❗ The package is currently within the planning phase

πŸ“Œ Links

Pincer Logo |Join the discord server: https://discord.gg/8WkYz3fNFm
Pincer Logo |The pypi package: https://pypi.org/project/Pincer
Pincer Logo |Our website: https://pincer.dev

β˜„οΈ Installation

Use the following command to install Pincer into your python environment:

pip install pincer
βš™οΈ Didn't work?

Depending on your python installation, you might need to use one of the following:

  • pip isn't in the path but python is

    python -m pip install pincer
  • Unix system can use pip3/python3 command

    pip3 install pincer
    python3 -m pip install pincer
  • python isn't in the path

    path/to/python.exe -m pip install pincer
  • Using multiple python versions

    py -m pip install pincer

Current Features

  • Dispatcher
  • Logging Improved
  • HTTP Client
  • Client base class
  • Basic events Improved

Client base class example:

from pincer.client import Bot

# Note that both `Bot` and `Client` are valid!
bot = Bot("...")
bot.run()

An example on on_ready event

from time import perf_counter
from pincer.client import Client

client = Client("...")


@client.event
async def on_ready():
    print(f"Logged in as {client.bot} after {perf_counter()} seconds")


client.run()

Inherited client

You have the possibility to use your own class to inherit from the pincer bot base.

class Bot(Client):

    def __init__(self) -> None:
        super(Bot, self).__init__(token='...')

    @Client.event
    async def on_ready(self) -> None:
        ...

See an advanced bot implementation:

https://github.com/Pincer-org/Pincer

Enable the debug mode

If you want to see everything that is happening under the hood, either for curiosity or the implementation of some features, we provide a debug logging!

import logging

logging.basicConfig(level=logging.DEBUG)

Note: A lot of printing can happen, with sensitive information, make sure to be aware or what your doing if your enable it!

🏷️ License

Β© 2021 copyright Pincer

This repository is licensed under the MIT License.

See LICENSE for details.

Comments
  • ⚑Flash | Aiohttp SpeedUp

    ⚑Flash | Aiohttp SpeedUp

    Changes

    • adds: Aiohttp Speedup

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    enhancement 
    opened by VincentRPS 13
  • ✨Type checking imports for all type hints

    ✨Type checking imports for all type hints

    Task

    Only import type hints when TYPE_CHECKING is true.

    Must be present:

    from __future__ import annotations
    
    from typing import TYPE_CHECKING
    

    Example

    from __future__ import annotations
    
    from typing import TYPE_CHECKING
    from dataclasses import dataclass
    
    
    if TYPE_CHECKING:
        from typing import List
    
    
    @dataclass
    class Foo:
        bar: List[int] = None
    
    enhancement easy 
    opened by Arthurdw 12
  • πŸ“ Upgrade docs

    πŸ“ Upgrade docs

    Changes

    • adds: More docstrings
    • fixed: closes #86 and closes #83
    • improvements: Better numpy docstrings with the RestructuredText also changed

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.

    Linted and fixed with autopep8 and flake8, line endings are all LF.

    https://pincer-upgraded-docs.rtfd.io

    documentation enhancement Hacktoberfest 
    opened by ooliver1 11
  • πŸ”¨ Implement command options (subcommands)

    πŸ”¨ Implement command options (subcommands)

    Feature

    Implement subcommands. So that eg the following data gets sent to discord:

    {
        "name": "permissions",
        "description": "Get or edit permissions for a user or a role",
        "options": [
            {
                "name": "user",
                "description": "Get or edit permissions for a user",
                "type": 2, // 2 is type SUB_COMMAND_GROUP
                "options": [
                    {
                        "name": "get",
                        "description": "Get permissions for a user",
                        "type": 1, // 1 is type SUB_COMMAND
                        "options": [
                            {
                                "name": "user",
                                "description": "The user to get",
                                "type": 6, // 6 is type USER
                                "required": true
                            },
                            {
                                "name": "channel",
                                "description": "The channel permissions to get. If omitted, the guild permissions will be returned",
                                "type": 7, // 7 is type CHANNEL
                                "required": false
                            }
                        ]
                    },
                    {
                        "name": "edit",
                        "description": "Edit permissions for a user",
                        "type": 1,
                        "options": [
                            {
                                "name": "user",
                                "description": "The user to edit",
                                "type": 6,
                                "required": true
                            },
                            {
                                "name": "channel",
                                "description": "The channel permissions to edit. If omitted, the guild permissions will be edited",
                                "type": 7,
                                "required": false
                            }
                        ]
                    }
                ]
            },
            {
                "name": "role",
                "description": "Get or edit permissions for a role",
                "type": 2,
                "options": [
                    {
                        "name": "get",
                        "description": "Get permissions for a role",
                        "type": 1,
                        "options": [
                            {
                                "name": "role",
                                "description": "The role to get",
                                "type": 8, // 8 is type ROLE
                                "required": true
                            },
                            {
                                "name": "channel",
                                "description": "The channel permissions to get. If omitted, the guild permissions will be returned",
                                "type": 7,
                                "required": false
                            }
                        ]
                    },
                    {
                        "name": "edit",
                        "description": "Edit permissions for a role",
                        "type": 1,
                        "options": [
                            {
                                "name": "role",
                                "description": "The role to edit",
                                "type": 8,
                                "required": true
                            },
                            {
                                "name": "channel",
                                "description": "The channel permissions to edit. If omitted, the guild permissions will be edited",
                                "type": 7,
                                "required": false
                            }
                        ]
                    }
                ]
            }
        ]
    }
    

    Code implementation

    Open for discussion, please post suggestions on how you'd like to use this in the lib.

    Useful link(s)

    https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

    enhancement 
    opened by Arthurdw 11
  • Proper Shutdown Capabilitiy

    Proper Shutdown Capabilitiy

    Is your feature request related to a problem? Please describe.

    I think pincer needs actual shut-down logic. Something like this on Client:

    def run(self):
        loop = asyncio.get_event_loop()
        self.stop_event = asyncio.Event(loop=loop)
        loop.run_until_complete(self._run())
        loop.run_until_complete(self.stop_event.wait())
        loop.run_until_complete(self._cleanup())
    
    async def _run(self):
        await self.start_shard(0, 1)
    
    async def _cleanup(self):
        if self.session and not self.session.closed:
            await self.session.close()
    
        # self.http is cleaned up be __del__ ???
    
    def stop(self):
        """Tells the bot to shutdown"""
    
        self.stop_event.set()
    

    Describe the solution you would like

    Magic

    Describe alternatives you have considered

    There is no alternative to magic

    Additional context

    magic

    enhancement 
    opened by CircuitSacul 9
  • Audio

    Audio

    Voice Transmitting Based And Some Code Taken From discord.py Voice Recording Based Off The Following:

    https://github.com/Rapptz/discord.py/pull/6507 https://github.com/nextcord/nextcord/pull/224

    Changes

    • adds: Opus Voice Support
    • adds: #217
    • removes: Bin In gitignore

    Check off the following

    • [ ] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    enhancement help wanted 
    opened by VincentRPS 9
  • :sparkles: Middleware addition

    :sparkles: Middleware addition

    Changes

    • adds:
      • on_channel_delete
      • on_channel_pins_update
      • on_channel_update
      • on_guild_delete
      • on_guild_update
      • on_message_reaction_add
      • on_message_reaction_remove
      • on_message_reaction_remove_all
      • on_message_reaction_remove_emoji
      • on_thread_create
      • on_thread_delete
      • on_thread_list_sync
      • on_thread_member_update
      • on_thread_members_update
      • on_thread_update

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    enhancement 
    opened by Endercheif 9
  • :children_crossing: new example with PIL

    :children_crossing: new example with PIL

    Changes

    • adds: tweet_generator.py example

    Check off the following

    • [X] I have tested my changes with the current requirements
    • [X] My Code follows the pep8 code style.
    enhancement 
    opened by drawbu 8
  • Nox stuff

    Nox stuff

    Changes

    It has come to my attention that many of the measure we have in place are not being run or used as much. Nox will fix that. Before doing a pr, on can run nox on their local machine to run tests and lints. As a workflow, they will also run.

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    CI 
    opened by Endercheif 7
  • :sparkles: Rewrote command registration and added cogs

    :sparkles: Rewrote command registration and added cogs

    Changes

    • adds: Cogs. Look at the cog example to see how it works. Also kills old cog system.
    • fixed: Commands and Message Components are registered when a class is initiated. This makes pincer a lot more modular and any class can register a cog now. as long as it inherits from Interactable ~~FUNCTIONAL BOTS WILL BE IMPOSSIBLE IF THIS GETS MERGED.~~ Rewrote and they're possible + better
    • improvements: ...

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    opened by Lunarmagpie 7
  • ✨ Add more guild methods

    ✨ Add more guild methods

    Changes

    • adds: the remaining stuff for #222

    Check off the following

    • [x] I have tested my changes with the current requirements
    • [x] My Code follows the pep8 code style.
    enhancement 
    opened by Endercheif 7
Releases(0.16.1)
  • 0.16.1(Aug 9, 2022)

    What's Changed

    • ♻️ reorganised imports by @Kylianalex in https://github.com/Pincer-org/Pincer/pull/436
    • :sparkles: Added an imager welcome example by @Arthurdw in https://github.com/Pincer-org/Pincer/pull/453
    • :construction_worker: Updated package to use Poetry by @Endercheif in https://github.com/Pincer-org/Pincer/pull/468
    • :art: Formatting with black once and for all by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/473
    • Nox stuff by @Endercheif in https://github.com/Pincer-org/Pincer/pull/469
    • :bug: command can now accept Optional[T] as a type by @ooliver1 in https://github.com/Pincer-org/Pincer/pull/480
    • ✨ Partially implement MODAL_SUBMIT by @Sly-Little-Fox in https://github.com/Pincer-org/Pincer/pull/485

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.16.0...0.16.1

    Source code(tar.gz)
    Source code(zip)
  • 0.16.0(Mar 2, 2022)

    What's Changed

    • :sparkles: Random fixes by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/373
    • ✨ Adding close, is_closed and saving loop by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/371
    • :construction_worker: Add a license generator by @beastmatser in https://github.com/Pincer-org/Pincer/pull/381
    • :bug: Fix sticker description by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/383
    • :construction_worker: Fix license generator by @beastmatser in https://github.com/Pincer-org/Pincer/pull/385
    • :ambulance: fix empty __all__'s by @VincentRPS in https://github.com/Pincer-org/Pincer/pull/386
    • :sparkles: Add support for Annotated type hint for command arguments and deprecate CommandArg by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/379
    • :sparkles: Adding message history by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/380
    • :sparkles: Add permission handler by @beastmatser in https://github.com/Pincer-org/Pincer/pull/378
    • :sparkles: added get_shard method to client by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/384
    • :sparkles: Get Invite & Delete invite by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/393
    • :bug: Fix emotes & guild Features by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/401
    • :sparkles: Add guild sheduled event endpoints by @beastmatser in https://github.com/Pincer-org/Pincer/pull/396
    • ♻️ Using a Custom class for Generator to be awaitable by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/403
    • :pencil: Fixed typo in VoiceChannel and NewsChannel by @Kylianalex in https://github.com/Pincer-org/Pincer/pull/417
    • :bug: Fixed api endpoint for guild member role actions by @Kylianalex in https://github.com/Pincer-org/Pincer/pull/426
    • :sparkles: Allow for GuildMember in kick & ban by @Skelmis in https://github.com/Pincer-org/Pincer/pull/422
    • :sparkles: Add ENABLED_DISCOVERABLE_BEFORE feature by @Dr-Electron in https://github.com/Pincer-org/Pincer/pull/431
    • :sparkles: Rewrote command registration and added cogs by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/389
    • :memo: Docs improvements by @Kylianalex in https://github.com/Pincer-org/Pincer/pull/434
    • :sparkles: Crosspost Method by @Endercheif in https://github.com/Pincer-org/Pincer/pull/432
    • :sparkles: Added StageInstance Methods by @Endercheif in https://github.com/Pincer-org/Pincer/pull/433

    New Contributors

    • @sourcery-ai made their first contribution in https://github.com/Pincer-org/Pincer/pull/388
    • @Skelmis made their first contribution in https://github.com/Pincer-org/Pincer/pull/422
    • @Dr-Electron made their first contribution in https://github.com/Pincer-org/Pincer/pull/431

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.15.3...0.16.0

    Source code(tar.gz)
    Source code(zip)
  • 0.15.3(Jan 10, 2022)

    What's Changed

    • πŸ”₯ Removing construct_client_dict by Fixing APIObject client attribute by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/360
    • :bug: fixed bugs with APIObject by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/363
    • ✨ Adding approx member count by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/364
    • ✨ Adding support for THREAD_ENABLED guild Feature by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/367
    • :arrow_up: update aiohttp to ~=3.8 by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/368

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.15.2...0.15.3

    Source code(tar.gz)
    Source code(zip)
  • 0.15.2(Jan 8, 2022)

    What's Changed

    • :sparkles: Command groups by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/342
    • :bug: Make sort-alls work on all branches by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/355
    • :bug: gateway no longer starts multiple instances by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/354

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.15.1...0.15.2

    Source code(tar.gz)
    Source code(zip)
  • 0.15.1(Jan 6, 2022)

    What's Changed

    • :sparkles: Adding Interaction Flag support for list to message by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/346
    • :bug: Fix MessageUpdate event causing crash by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/344
    • ♻️ Added query params parameter to HTTP get requests by @DarviL82 in https://github.com/Pincer-org/Pincer/pull/343
    • :sparkles: Adding Pillow Images support for list to message by @drawbu in https://github.com/Pincer-org/Pincer/pull/351
    • :bug: fix GuildFeatures not existing by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/352
    • :wrench: Added more info to CONTRIBUTING.md and add issue forms by @Endercheif in https://github.com/Pincer-org/Pincer/pull/349
    • :recycle: small improvements by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/347

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.15.0...0.15.1

    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Jan 2, 2022)

    What's Changed

    • :pencil: Added mermaid support to docs by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/313
    • :sparkles: Adding ScheduleEvent by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/304
    • :sparkles: Added Channel.bulk_delete_messages() and Channel.edit_permissions() by @DarviL82 in https://github.com/Pincer-org/Pincer/pull/316
    • :tada: Added all user and current user methods by @Endercheif in https://github.com/Pincer-org/Pincer/pull/299
    • :sparkles: Added 10 endpoints to Channel by @DarviL82 in https://github.com/Pincer-org/Pincer/pull/320
    • :sparkles: Moved InviteMetadata to Invite by @Kylianalex in https://github.com/Pincer-org/Pincer/pull/319
    • :bug: Fixed command registration and closes #256 by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/317
    • :sparkles: Added UserMessage.from_id by @Endercheif in https://github.com/Pincer-org/Pincer/pull/315
    • :arrow_up: Adding Python 3.10 as supported by @VincentRPS in https://github.com/Pincer-org/Pincer/pull/323
    • :sparkles: Add timeouts. by @ooliver1 in https://github.com/Pincer-org/Pincer/pull/324
    • :sparkles: Components by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/321
    • :bug: filter out message fields if None instead of False by @TheBobBobs in https://github.com/Pincer-org/Pincer/pull/331
    • :bug: Fixes post_send_handler deleting channel instead of message by @TheBobBobs in https://github.com/Pincer-org/Pincer/pull/332
    • :bug: :sparkles: Added VERY basic sharding support and fixed the gateway by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/329
    • :sparkles: Added 12 endpoints to Channel by @DarviL82 in https://github.com/Pincer-org/Pincer/pull/337
    • :pencil: updated README by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/335
    • :bug: ActivityFlags no longer crash by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/339
    • :sparkles: Message options by @Endercheif in https://github.com/Pincer-org/Pincer/pull/330

    New Contributors

    • @DarviL82 made their first contribution in https://github.com/Pincer-org/Pincer/pull/316
    • @Kylianalex made their first contribution in https://github.com/Pincer-org/Pincer/pull/319
    • @TheBobBobs made their first contribution in https://github.com/Pincer-org/Pincer/pull/331

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.14.0...0.15.0

    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Dec 14, 2021)

    What's Changed

    • :passport_control: added User-Agent header by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/274
    • Removing _http passing and getting it from the client by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/272
    • :art: Improving overall Pincer objects representation by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/285
    • Moved API Files To A Better More Organized Location by @VincentRPS in https://github.com/Pincer-org/Pincer/pull/286
    • :sparkles: Changes File class to allow for certain endpoints more easily by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/282
    • :sparkles: Added Webhook related endpoints by @trag1c in https://github.com/Pincer-org/Pincer/pull/281
    • :speech_balloon: Fixing Grammar by @VincentRPS in https://github.com/Pincer-org/Pincer/pull/247
    • :speech_balloon: Make gitmoji mandatory by @Endercheif in https://github.com/Pincer-org/Pincer/pull/289
    • :memo: Added Interaction guide by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/288
    • ✨ Add more guild methods by @Endercheif in https://github.com/Pincer-org/Pincer/pull/275
    • :sparkles: Added sticker support by @Endercheif in https://github.com/Pincer-org/Pincer/pull/292
    • πŸ› Transform message.edit list of APIObject to JSONSerializable by @drawbu in https://github.com/Pincer-org/Pincer/pull/306
    • :technologist: Adding Visual Studio Configs To gitignore by @VincentRPS in https://github.com/Pincer-org/Pincer/pull/307
    • :sparkles: Guild & Channel properties for APIObjects by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/298

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.13.0...0.14.0

    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(Nov 30, 2021)

    What's Changed

    • :boom: Better command types and application command types by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/246
    • :children_crossing: new example with PIL by @drawbu in https://github.com/Pincer-org/Pincer/pull/241
    • :sparkles: :zap: Added Mentionable type and improved Interaction performance by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/253
    • :art: Middleware no longer returns API objects in list by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/259
    • :sparkles: Added Audit Log and Emoji related Guild methods by @trag1c in https://github.com/Pincer-org/Pincer/pull/267
    • :sparkles: Added GuildTemplate related endpoints by @trag1c in https://github.com/Pincer-org/Pincer/pull/271
    • :sparkles: Implements Ratelimiter to prevent 429s from user scope by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/264

    New Contributors

    • @snyk-bot made their first contribution in https://github.com/Pincer-org/Pincer/pull/258
    • @drawbu made their first contribution in https://github.com/Pincer-org/Pincer/pull/241

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.12.1...0.13.0

    Source code(tar.gz)
    Source code(zip)
  • 0.12.1(Nov 24, 2021)

  • 0.12.0(Nov 24, 2021)

    What's Changed

    • Ability to send messages to users. Hex color class to work with User banner colors and anything with that format in the future.
    • Explicit args in Guild.ban() and Guild.kick(). Message Context.ack() is now optional.
    • Allow non-parenthesised @command decorator
    • Fixing payload to objects transformation
    • Added client and guild methods, GuildPreview object

    Contributors

    @Lunarmagpie @RPSMain @Sigmanificient @beastmatser @trag1c @Endercheif

    Source code(tar.gz)
    Source code(zip)
  • 0.11.4(Nov 18, 2021)

    • Adding loop_for and wait_for event for the bot
    • Adding flash sub package to optimize asynchronous performances
    • Toggable command register behavior
    • Checking snowflake boundaries

    Bug Fixes:

    • corrected route call for kick & ban methods
    • proper http closing when bot crash within it initialization
    Source code(tar.gz)
    Source code(zip)
  • 0.11.2(Nov 16, 2021)

  • 0.11.1(Nov 15, 2021)

    What's Changed

    • Added me,hoisted_role, kick & ban to guild members
    • Added fetch_message
    • Added get_avatar_url & get_avatar to user
    • Major BugFixes

    New Contributors

    • @VincentRPS made their first contribution in https://github.com/Pincer-org/Pincer/pull/193

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.10.1...0.11.1

    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(Nov 14, 2021)

    What's Changed

    • Adds UserMessage endspoints (Reactions, Edit, and Delete) by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/157
    • :sparkles: Support Discord Gateway Event Compression by @mwath in https://github.com/Pincer-org/Pincer/pull/160
    • ✨ Guild registration, guild commands fix, interaction response methods, message delete_after and HTTPMeta rewrite, post_init automatic conversion, channel send & delete, add headers to http request by @Arthurdw in https://github.com/Pincer-org/Pincer/pull/158
    • ✨ Implement Guild Member Middleware by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/162
    • βœ… Improve test coverage for core/Heartbeat.py (#121) by @gillesigot in https://github.com/Pincer-org/Pincer/pull/169
    • ✨ πŸ› new interaction features, bugfix and refactor by @Arthurdw in https://github.com/Pincer-org/Pincer/pull/167
    • πŸ› Pillow images can be sent in an interaction by @Lunarmagpie in https://github.com/Pincer-org/Pincer/pull/179
    • πŸ“ Upgrade docs by @ooliver1 in https://github.com/Pincer-org/Pincer/pull/155
    • :sparkles: Middleware addition by @Endercheif in https://github.com/Pincer-org/Pincer/pull/163
    • :sparkles: Add middleware by @beastmatser in https://github.com/Pincer-org/Pincer/pull/174
    • πŸ”– 0.10.1 - Doc Rewrite by @Sigmanificient in https://github.com/Pincer-org/Pincer/pull/213

    New Contributors

    • @gillesigot made their first contribution in https://github.com/Pincer-org/Pincer/pull/169
    • @ooliver1 made their first contribution in https://github.com/Pincer-org/Pincer/pull/155
    • @beastmatser made their first contribution in https://github.com/Pincer-org/Pincer/pull/174

    Full Changelog: https://github.com/Pincer-org/Pincer/compare/0.9.3...0.10.1

    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(Nov 7, 2021)

    • proper closing/restart
    • ack & ctx interaction
    • Descripted annotation
    • Type Casting
    • Gateway compression
    • Guild member middleware
    • New str defaults
    • Invite link property
    • Message delete_after
    • Guild registeration
    • Discord changes
    • Emoji reaction functions
    • BugFixes
    Source code(tar.gz)
    Source code(zip)
  • 0.9.3(Oct 18, 2021)

    Changes

    • Added the ability to register events multiple times. (except for the on_command_error event to prevent conflicts)
    • Iteration improvements

    Bugfixes

    • Resolved the issue where already existing global commands were not being removed
    Source code(tar.gz)
    Source code(zip)
  • 0.9.2(Oct 14, 2021)

    Just a generic patch, with some important bugfixes and useful new command argument types

    Changes

    • Changed to LF file endings.
    • Internal refactoring
    • Documentation updates/typo fixes
    • Added float, User, Channel and Role command argument type

    Bugfixes

    • Broken guild only commands
    • Bot loading in specific architecture
    Source code(tar.gz)
    Source code(zip)
  • 0.9.1(Oct 9, 2021)

    There is now support for any bytes. Pillow JPG and PNG images and files have helper functions. Other formats can be sent by constructing a file object manually.

    Example

    Pillow image

    class Bot(Client):
        
        @command(description="Test method")
        async def test(self):
    
            img = Image.new("RGB",(500,500),(20,20,20))
    
           # Method one if you want to specify an image format. The file extension is used as the format.
            return Message(attachments=[
                File.from_image(
                    img,
                    "image.png"
                )
            ])
    
          #Method 2 & 3, can only do PNGs.
          return img
          return Message(attachments=[img])
    
    

    Sending a file

    class Bot(Client):
        
        @command(description="Test method")
        async def test(self):
    
            return Message(attachments=[
                File.from_file(
                     "test/something.txt"
                      #Filename can be specified if wanted
                     filename="somethingelse.txt"
                )
            ])
    
          # Can also be done like a png
          return Message(attachments=["test/something.txt"])
          
          # but this returns a message. Someone is gonna be baited by this. Probably me :(.
          return "something.txt"
          
    
    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Oct 4, 2021)

    Implemented cogs and channel.edit

    Basic cogs example:

    run.py

    >>> from pincer import Client
    >>>
    >>> class BotClient(Client):
    ...     def __init__(self, *args, **kwargs):
    ...         self.load_cog("cogs.say")
    ...         super().__init__(*args, **kwargs)
    

    cogs/say.py

    >>> from pincer import command
    >>>
    >>> class SayCommand:
    ...     @command()
    ...     async def say(self, message: str) -> str:
    ...         return message
    >>>
    >>> setup = SayCommand
    

    Note on setup method

    The setup method may have 1 optional argument which contains the client. The only restriction on the setup method is that it must be a callable, this means that the following code is also valid:

    def setup(client):
        return MyCog(client.bot.name)
    
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Oct 3, 2021)

    Version 0.8.0 release:

    Changes

    • Implemented argument choices
    • Bugfix for Optional and descriptions

    Tasks

    Might be changed in future version

    functional way

    
    client = Bot(...)
    task = TaskScheduler(client)
    
    
    @task.loop(minutes=3)
    async def my_task(self):
        print(">w<")
    
    my_task.start()
    client.run()
    

    OOP way

    class Bot(Client):
        ...
    
        @Client.event
        async def on_ready(self):
            task = TaskScheduler(self)
    
            @task.loop(seconds=3)
            async def sample():
                print(">w<")
    
            sample.start()
    
    
    Bot(...).run()
    
    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(Oct 2, 2021)

    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')

    Source code(tar.gz)
    Source code(zip)
  • 0.7.1(Oct 2, 2021)

    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

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Sep 28, 2021)

  • 0.6.10(Sep 20, 2021)

  • 0.6.9(Sep 19, 2021)

    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'
    
    
    Source code(tar.gz)
    Source code(zip)
  • 0.6.8(Sep 17, 2021)

  • 0.6.6(Sep 13, 2021)

    | :exclamation: | 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!

    Source code(tar.gz)
    Source code(zip)
  • 0.6.5(Sep 11, 2021)

    | :exclamation: | 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"
            )
        )
    
    
    Source code(tar.gz)
    Source code(zip)
  • 0.6.4(Sep 10, 2021)

    | :exclamation: | The package is currently within the planning phase | | ------------- | :------------------------------------------------- |

    Bugfix for the command guild registration and added some more objects.

    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Sep 10, 2021)

    | :exclamation: | The package is currently within the planning phase | | ------------- | :------------------------------------------------- |

    Just fixes issues with the PyPi readme.

    Source code(tar.gz)
    Source code(zip)
Owner
Pincer
πŸš€ An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets
Pincer
Backlog API v2 Client Library for Python

BacklogPy - Backlog API v2 Client Library for Python BacklogPy is Backlog API v2 Client Library for Python 2/3 Install You can install the client libr

Koudai Aono 7 Dec 16, 2022
Free & open source API service for obtaining information about +9600 universities worldwide.

Free & open source API service for obtaining information about +9600 universities worldwide.

Yagiz Degirmenci 57 Nov 04, 2022
Innocent-Bot - A Discord client self-bot for destroying, nuking and causing mischief in servers

Innocent-bot A Discord client self-bot for destroying, nuking and causing mischi

†† 5 Jan 26, 2022
An App to get Ko-Fi payment updates on Telegram.

Deployments. Heroku.com πŸš€ Replit.com πŸŒ€ Make sure your app runs 24*7 Zeet.co πŸ’ͺ Use this :~ Get Bot token from @botfather πŸ€– Get ID where you want to

Jainam Oswal 16 Nov 12, 2022
RChecker - Checker for minecraft servers

πŸ”Ž RChecker v1.0 Checker for Minecraft Servers πŸ’» Supported operating systems: βœ…

Pedro Vega 1 Aug 30, 2022
Simple script to ban bots at Twitch chats using a text file as a source.

AUTOBAN πŸ‡ΊπŸ‡Έ English version Simple script to ban bots at Twitch chats using a text file as a source. How to use Windows Go to releases for further in

And Paiva 5 Feb 06, 2022
A small bot to interact with the reddit API. Get top viewers and update the sidebar widget.

LiveStream_Reddit_Bot Get top twitch and facebook stream viewers for a game and update the sidebar widget and old reddit sidebar to show your communit

Tristan Wise 1 Nov 21, 2021
Accurately dump Commodore 64 tapes

TrueTape64 A cheap, easy to build adapter to interface a Commodore 1530 (C2N) Datasette to your PC to dump and preserve your aging Commodore 64 softwa

francesco 38 Dec 03, 2022
Wrapper around the UPS API for creating shipping labels and fetching a package's tracking status.

ClassicUPS: A Useful UPS Library ClassicUPS is an Apache2 Licensed wrapper around the UPS API for creating shipping labels and fetching a package's tr

Jay Goel 55 Dec 12, 2022
Project for QVault Hackathon which plays sounds based on the letters of a user's name

virtual_instrument Project for QVault Hackathon which plays sounds based on the letters of a user's name I created a virtual instrument using Python a

Paolo Sidera 2 Feb 11, 2022
Upload on Doodstream by Url, File and also by direct forward post from other channel...

Upload on Doodstream by Url, File and also by direct forward post from other channel...

Pʀᴇᴅᴀᴛᴏʀ 8 Aug 10, 2022
Auto Liker, Auto Reaction, Auto Comment, Auto Follower Tool. RajeLiker Credit Hacker.

Auto Liker, Auto Reaction, Auto Comment, Auto Follower Tool. RajeLiker Credit Hacker. Unlimited RajeLiker Credit Hack. Thanks To RajeLiker.

Md. Mehedi Hasan 32 Dec 28, 2022
Chorok - High quality Discord music bot

Chorok - High quality Discord music bot Rewrite with dico Config guide

Chorok Opensource project 10 May 03, 2022
πŸ€– Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

πŸ€– Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

Fariz 2 Nov 13, 2021
The Social-Engineer Toolkit (SET) is specifically designed to perform advanced attacks against the human element.

The Social-Engineer Toolkit (SET) The Social-Engineer Toolkit (SET) is specifically designed to perform advanced attacks against the human element. SE

Professor 6 Nov 28, 2022
A Bot that Forwards Tweets to Telegram using Airtable as a database.

Twitter Telegram Forward A Bot that Forwards Tweets to Telegram using Airtable as a Database. Features: Handles multiple twitter and telegram channels

George Bakev 3 Dec 21, 2022
A telegram bot written in Python to fetch random SFW & NSFW anime images

Tsuzumi A telegram bot written in python to fetch both random SFW & NSFW Anime images using nekos.life & waifu.pics API Commands SFW Commands : /

Nisarga Adhikary 3 Oct 12, 2022
Automated AWS account hardening with AWS Control Tower and AWS Step Functions

Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean

AWS Samples 20 Dec 07, 2022
A Python app to serve Conveyor room requests and run approvals through Slack

✨ CONVEYOR FOR SLACK ✨ This is a friendly little Python app that will allow you to integrate your instance of Conveyor with your Slack workspace. In o

Vivienne 4 Sep 27, 2021
Jika ada pertanyaan lebih lanjut, hubungi kontak dibawah ini. Terimakasih...

⚑ Lynx Userbot ⚑ Userbot Used for Fun on Telegram, and for Maintianing Your Group. This is a Repo Lynx-Userbot. This is Repo was Created by Axel From

29 Aug 30, 2021