mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Implement reply_image for Discord serfs
This commit is contained in:
parent
b43cc260d7
commit
7cb4e783f7
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import asyncio as aio
|
import asyncio as aio
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
import warnings
|
||||||
|
import io
|
||||||
from typing import *
|
from typing import *
|
||||||
import royalnet.backpack.tables as rbt
|
import royalnet.backpack.tables as rbt
|
||||||
import royalnet.commands as rc
|
import royalnet.commands as rc
|
||||||
|
@ -77,6 +78,9 @@ class DiscordSerf(Serf):
|
||||||
async def reply(data, text: str):
|
async def reply(data, text: str):
|
||||||
await data.message.channel.send(escape(text))
|
await data.message.channel.send(escape(text))
|
||||||
|
|
||||||
|
async def reply_image(data, image: io.IOBase, caption: str) -> None:
|
||||||
|
await data.message.channel.send(file=discord.File(image, 'image'))
|
||||||
|
|
||||||
async def get_author(data, error_if_none=False):
|
async def get_author(data, error_if_none=False):
|
||||||
user: "discord.Member" = data.message.author
|
user: "discord.Member" = data.message.author
|
||||||
query = data.session.query(self.master_table)
|
query = data.session.query(self.master_table)
|
||||||
|
|
Loading…
Reference in a new issue