fix self
This commit is contained in:
parent
0afca583b0
commit
a65137307b
4
bot.py
4
bot.py
@ -75,12 +75,12 @@ class BotClient(discord.Client):
|
|||||||
command = message.content.split(" ")[0]
|
command = message.content.split(" ")[0]
|
||||||
match command:
|
match command:
|
||||||
case "%calc":
|
case "%calc":
|
||||||
reply = await _calculate(command[1:])
|
reply = await self._calculate(command[1:])
|
||||||
await message.reply(content=reply)
|
await message.reply(content=reply)
|
||||||
case _:
|
case _:
|
||||||
_log.info(f"Unrecognised command {command}")
|
_log.info(f"Unrecognised command {command}")
|
||||||
|
|
||||||
async def _calculate(args: list[str]) -> str:
|
async def _calculate(self, args: list[str]) -> str:
|
||||||
proc = sp.run(["node", "calc_main.js", "--"] + args)
|
proc = sp.run(["node", "calc_main.js", "--"] + args)
|
||||||
msg = proc.stdout
|
msg = proc.stdout
|
||||||
return msg.strip()
|
return msg.strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user