Files
An extension library for interactions.py allowing files in interaction responses.
Install / Use
/learn @B1ue-Dev/FilesREADME
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
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
