An extension library for interactions.py allowing files in interaction responses.
Project description
interactions-files
An extension library for interactions.py allowing files in interaction responses.
Table of Contents
Installation
pip install -U interactions-files
Information
This is interactions-files, an extension library for interactions.py allowing files in interaction responses.
By default, interactions.py does not allow you to send files in CommandContext and ComponentContext. This extension exists to solve that problem by adding files field to the .send() and .edit().
Quickstart
You can load interactions-files like every other Extension by using:
client.load('interactions.ext.files')
After that, you can start sending files in Context. For example of doing this, go to this.
Alternatively, you can use the functions provided by the Extension. Take a look at an example below:
import io
import interactions
from interactions.ext.files import command_send
client = interactions.Client(token="Pfft!")
@client.command(
name="file",
description="Send a file.",
)
async def _test(ctx: interactions.CommandContext):
txt = io.StringIO("This is a text file.")
file = interactions.File(filename="file.txt", fp=txt)
await command_send(ctx, "Below is a file.", files=file)
client.start()
For more information on the fuctions, check out the documentation.
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interactions-files-1.1.4.tar.gz.
File metadata
- Download URL: interactions-files-1.1.4.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
265648c81ed706fce7630aa3ff7d3a932e4c42154637b1c399bd09190b0cf700
|
|
| MD5 |
b9509b2e59ce8baeb3e0ad0468804868
|
|
| BLAKE2b-256 |
2f3b42215b515df15057f38e0047764eb71bc782cc1b86bbb91f582dc5a4101d
|
File details
Details for the file interactions_files-1.1.4-py3-none-any.whl.
File metadata
- Download URL: interactions_files-1.1.4-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3951517c55e9432c36c0098ff2594d1d71b6a8f7186fba6b7e0f5fdd207599c
|
|
| MD5 |
ab7c63de84c614a877fdc76d944f2773
|
|
| BLAKE2b-256 |
6c834a3a034db0d71c91ee810d20e0329d5db0d9f6461320ac6a369113fb7563
|