Metadata-Version: 2.1
Name: wumpy-bot
Version: 0.1.0
Summary: Highly abstracted and easy to use wrapper over the Wumpy project
Keywords: wumpy,wumpus,wrapper,discord,discord-api,discord-bot,discord-api-wrapper,python-3
Author-email: Bluenix <bluenixdev@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: AnyIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: anyio >= 3.3.4, <4
Requires-Dist: typing_extensions >= 4.3, <5
Requires-Dist: wumpy-gateway >= 0.3, <1
Requires-Dist: wumpy-rest >= 0.3, <1
Requires-Dist: wumpy-models >= 0.1, <1
Requires-Dist: wumpy-interactions >= 0.1, <1
Requires-Dist: wumpy-cache >= 0.1, <1
Project-URL: Documentation, https://wumpy.rtfd.io
Project-URL: Homepage, https://github.com/wumpyproject/wumpy
Project-URL: Repository, https://github.com/wumpyproject/wumpy/tree/main/library/wumpy-bot

# Wumpy-bot

Easy to use high abstraction over other Wumpy subpackages.

This is the most beginner-friendly way to use Wumpy, and provides all features
of the Discord API. This is the primary package installed from PyPI when you
only specify [`wumpy`](https://pypi.org/project/wumpy/).

## Getting started

All official Wumpy projects prioritise both asyncio and Trio support so you can
run the bot under either:

```python
import anyio
from wumpy.bot import Bot


bot = Bot('ABC123.XYZ789')  # Replace with your token and keep it safe!

# This runs the bot with Trio as the event loop (recommended),
# use backend='asyncio' to run it under asyncio.
anyio.run(bot.run, backend='trio')
```

### Registering listeners

Continuing from the previous code, you can register listeners for Discord
events using Wumpy's rich event listeners:

```python
import anyio
from wumpy.bot import Bot
from wumpy.bot.events import MessageDeleteEvent


bot = Bot('ABC123.XYZ789')


@bot.listener()
async def log_deleted_messages(event: MessageDeleteEvent):
    print(f'Message {event.message_id} in {event.channel_id} was deleted')


anyio.run(bot.run, backend='trio')
```

The listener is registered with the `@bot.listener()` decorator, which tells
Wumpy to read the annotation of the first parameter (name does not matter, but
here it is called `event`) and register that function for the type of event
that it is typehinted as.

