我试图强迫我的机器人改变它的游戏"游戏"什么时候开始帮助"!寻求帮助"但似乎无法让它发挥作用。
目前我的代码是......
const Commando = require('discord.js-commando');
const Request = require('request');
const Bot = new Commando.Client();
Bot.client.setGame("!help for help");
我也试过......
Bot.client.setStatus("!help for help");
Bot.user.setGame("!help for help");
Bot.user.setStatus("!help for help");
我使用似乎无法理解你如何调用它来使它工作。
答案 0 :(得分:4)
试试这个:
bot.on('ready', () => {
bot.user.setGame("use !help");
});
答案 1 :(得分:0)
.setStatus
是用户旁边的圆圈
答案 2 :(得分:0)
在检查您的客户端是否准备就绪时,您可以添加这段代码。
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.setMinimumSize(QSize(300, 300))
pybutton = QPushButton('button', self)
pybutton.clicked.connect(self.draw_line)
pybutton.resize(100,100)
pybutton.move(0, 0)
pybutton2 = QPushButton('button2', self)
pybutton2.clicked.connect(self.draw_line)
pybutton2.resize(100,100)
pybutton2.move(200, 0)
self.pixmap = QPixmap(self.size())
self.pixmap.fill(Qt.transparent)
def draw_line(self):
button = self.sender()
r = button.geometry()
p1 = QPoint(r.left() + r.width()/2, r.height())
p2 = p1+QPoint(0, 100)
line = QLine(p1, p2)
p = QPainter(self.pixmap)
pen = QPen(Qt.red, 3)
p.setPen(pen)
p.drawLine(line)
p.end()
self.update()
def paintEvent(self,event):
QMainWindow.paintEvent(self, event)
painter = QPainter(self)
painter.drawPixmap(QPoint(), self.pixmap)
def resizeEvent(self, event):
if self.width() > self.pixmap.width() or self.height() > self.pixmap.height():
pixmap = QPixmap(self.size())
pixmap.fill(Qt.transparent)
p = QPainter(pixmap)
p.drawPixmap(QPoint(), self.pixmap)
self.pixmap = pixmap
QMainWindow.resizeEvent(self, event)
希望这有帮助!