使用hexchat(基于xchat)和python脚本.
阅读API文档,我不清楚其他用户是否可以看到打印语句.通道中的其他用户也可以看到以下内容,或者仅对我可见:
import hexchat
hexchat.prnt("Hi everyone!")
Run Code Online (Sandbox Code Playgroud)
那么使用python的打印呢?
import hexchat
print("Hi everyone!")
Run Code Online (Sandbox Code Playgroud)
编辑
我想这个问题的必然结果是如何发送聊天消息,以便其他用户可以看到它.
无论hexchat.prnt与print做同样的事情,显示一个消息你的客户是不会发送到服务器.只有你会看到这些.
要将消息发送到服务器,请使用其中一个
hexchat.command("say <message>") # Uses hexchat's /say command, sends in current channel's context
Run Code Online (Sandbox Code Playgroud)
要么
hexchat.command("PRIVMSG <#channel/user> :<message>") # Uses the raw IRC command, send to any channel
Run Code Online (Sandbox Code Playgroud)
(替换为您的消息,<#channel/user>替换为目标消息目标)
两者之间的区别在于前者还在客户端中显示消息,而后者以静默方式发送消息而不通知用户脚本.
| 归档时间: |
|
| 查看次数: |
1385 次 |
| 最近记录: |