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
Hashes for interactions-files-1.1.2.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b4b68c84c3d322f8e5735f617129ad8edff2094fc25c48c4d8a87a1d4a5795a |
|
MD5 | 809f61e43a755da5fe5c6dcb5534e138 |
|
BLAKE2b-256 | 550f3416180f5e33a58e98da3eaed86b65c6c3f8180b062628eb19b00e9986dd |
Hashes for interactions_files-1.1.2.post1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d216a698392be9dd27e86fd3d21582f4e4dcef3334e7717401ab7ab76d6f67 |
|
MD5 | da29f0872e2fa420260fa599dd95576a |
|
BLAKE2b-256 | 12cd8ba45668cf3f00deab6719236cf3f0e51db87af28d8c13560f6dea5d3bad |