phBot Plugins
Search…
Chat API

Chat

You must import phBotChat to use the chat API.

All(text)

Sends a message to general chat.

Party(text)

Sends a message to the party.

Guild(text)

Sends a message to the guild.

Union(text)

Sends a message to the union.

Stall(text)

Sends a message to the stall.

Private(name, text)

Sends a private message to another player.

Note(name, text)

Sends a note to another player.

Global(text)

Sends a global message.

Returns

True if the message was sent, False if sending the message failed.

Example

1
from phBot import *
2
import phBotChat
3
import QtBind
4
5
gui = QtBind.init(__name__, 'Chat Example')
6
7
name = QtBind.createLineEdit(gui, '', 10, 10, 100, 20)
8
text = QtBind.createLineEdit(gui, '', 10, 40, 250, 20)
9
send = QtBind.createButton(gui, 'send_message', 'Send', 10, 70)
10
11
def send_message():
12
13
player = QtBind.text(gui, name)
14
message = QtBind.text(gui, text)
15
16
if len(player) > 0 and len(message) > 0:
17
18
phBotChat.Private(player, message)
19
20
log('[%s] Loaded' % __name__)
Copied!