Skip to main content

An extension library for interactions.py allowing files in interaction responses.

Project description

interactions-files

PyPI - Downloads Version Python Requirement

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

API Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interactions-files-1.1.5.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interactions_files-1.1.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file interactions-files-1.1.5.tar.gz.

File metadata

  • Download URL: interactions-files-1.1.5.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

Hashes for interactions-files-1.1.5.tar.gz
Algorithm Hash digest
SHA256 826d58b1087d5b56f571bb450b6102a707a3b39dd4ca277e60f860a1eea25562
MD5 49f203f8dacbd0a947d2f6782cc4ad79
BLAKE2b-256 770efe5207fb0e79c821f750de3de5e237f0946684e681a9a92a5bcc65601fa7

See more details on using hashes here.

File details

Details for the file interactions_files-1.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for interactions_files-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1665247031c50db4504f3f654efaba1751f1d6311c1e3267e894e51403cad0a5
MD5 01071947cb9929190cdab69a2d65e580
BLAKE2b-256 7bb2075e32caf933c171f4d169d67d38fc32178f6102a916f63b0ed65f2a5039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page