1
Fork 0
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:
Steffo 2019-04-11 18:20:03 +02:00
parent eaedfa25a9
commit 3ba75b2eb6

View file

@ -53,7 +53,18 @@ class DiscordBot:
alchemy = self.alchemy alchemy = self.alchemy
async def reply(call, text: str): 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): async def net_request(call, message: Message, destination: str):
response = await self.network.request(message, destination) response = await self.network.request(message, destination)