mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Implement DiscordCall.reply()
This commit is contained in:
parent
eaedfa25a9
commit
3ba75b2eb6
1 changed files with 12 additions and 1 deletions
|
@ -53,7 +53,18 @@ class DiscordBot:
|
|||
alchemy = self.alchemy
|
||||
|
||||
async def reply(call, text: str):
|
||||
raise NotImplementedError()
|
||||
escaped_text = text.replace("*", "\\*") \
|
||||
.replace("_", "\\_") \
|
||||
.replace("`", "\\`") \
|
||||
.replace("[b]", "**") \
|
||||
.replace("[/b]", "**") \
|
||||
.replace("[i]", "_") \
|
||||
.replace("[/i]", "_") \
|
||||
.replace("[u]", "__") \
|
||||
.replace("[/u]", "__") \
|
||||
.replace("[c]", "`") \
|
||||
.replace("[/c]", "`")
|
||||
await call.channel.send(escaped_text)
|
||||
|
||||
async def net_request(call, message: Message, destination: str):
|
||||
response = await self.network.request(message, destination)
|
||||
|
|
Loading…
Reference in a new issue