Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

Commit

Permalink
docs: Fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
B1ue-Dev committed May 26, 2022
1 parent 9d819ab commit a0fa720
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@ import io
client = interactions.Client(...)
client.load('interactions.ext.files')


async def test(ctx: interactions.CommandContext):
data = "Hey look, this is a file from CommandContext."
file = io.StringIO(data)
@client.command(
name="file",
description="Send a message as a text file",
options=[
interactions.Option(
type=interactions.OptionType.STRING,
name="message",
description="Message",
required=True
)
]
)
async def _file(ctx: interactions.CommandContext, message: str):
file = io.StringIO(message)
with file as f:
file = interactions.File(filename="aaaaa.txt", fp=f)
file = interactions.File(filename="message.txt", fp=f)
await ctx.send(files=file)


Expand Down

0 comments on commit a0fa720

Please sign in to comment.