Merge pull request #3349 from volundmush/command_msg

Default Commands now use self.msg() instead of self.caller.msg()
This commit is contained in:
Griatch 2023-12-02 21:28:20 +01:00 committed by GitHub
commit a928e418a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 72 additions and 74 deletions

View file

@ -312,7 +312,7 @@ class CmdChannel(COMMAND_DEFAULT_CLASS):
"""
if not channel.access(self.caller, "send"):
self.caller.msg(f"You are not allowed to send messages to channel {channel}")
self.msg(f"You are not allowed to send messages to channel {channel}")
return
# avoid unsafe tokens in message
@ -1684,21 +1684,21 @@ class CmdIRCStatus(COMMAND_DEFAULT_CLASS):
chtext = f"IRC bot '{ircbot.db.irc_botname}' on channel {channel} ({network}:{port})"
if option == "ping":
# check connection by sending outself a ping through the server.
self.caller.msg(f"Pinging through {chtext}.")
self.msg(f"Pinging through {chtext}.")
ircbot.ping(self.caller)
elif option in ("users", "nicklist", "who"):
# retrieve user list. The bot must handles the echo since it's
# an asynchronous call.
self.caller.msg(f"Requesting nicklist from {channel} ({network}:{port}).")
self.msg(f"Requesting nicklist from {channel} ({network}:{port}).")
ircbot.get_nicklist(self.caller)
elif self.caller.locks.check_lockstring(
self.caller, "dummy:perm(ircstatus) or perm(Developer)"
):
# reboot the client
self.caller.msg(f"Forcing a disconnect + reconnect of {chtext}.")
self.msg(f"Forcing a disconnect + reconnect of {chtext}.")
ircbot.reconnect()
else:
self.caller.msg("You don't have permission to force-reload the IRC bot.")
self.msg("You don't have permission to force-reload the IRC bot.")
# RSS connection