我的AFK命令工作得很好,除了我只能使用一个词的原因。举个例子,我会说-afk在遛狗。每当有人在我去afk的不一致服务器上ping我时,它只会说(用户)如果AFK。原因:步行。我正在试图弄清楚如何让它说多个单词,而不是只说一个单词。下面是我的一些afk命令 @client.event async def on_message(message):全局afkdict if message.author in afkdict: afkdict.pop(message.author) for member in message.mentions:
if member != message
我用discord.py为我的机器人做了一个afk命令,但是当我执行Afk命令时,它只有一个单词,当pinged时,代码就在这里https://nekobin.com/sulotolise @client.event
async def on_member_join(member):
print(f'{member} has joined a server!')
with open('afk.json', 'r') as f:
afk = json.load(f)
await update_data(a
我希望我的机器人使用"<afk无线电“命令在两个afk频道中的一个频道中移动用户。但我首先要检查用户是否已在AFK信道中就绪。我试过:
const voiceChannel = message.member.voice.channel;
const voiceChannelID = message.member.voice.channelID;
if (!voiceChannel) {
return message.channel.send('You are not in an voice Channel so why move to AFK?')
我有一个代码,我在一定的时间后删除afk。用户可以发送任何否。在这个时间的消息,但afk不会被删除,它将被删除后,只有一定的时间,但我的代码只是发送许多消息,由用户发送的afk的嵌入删除。
这是我的代码
if afkData.val() is not None:
await asyncio.sleep(10)
db.child("AFK").child(str(message.guild.id)).child(str(message.author.id)).remove()
em = discord.Embed(title="AFK remove
我(希望)有一个关于布尔函数的简单问题。我正在尝试设置一个简单的自动回复程序,但出于某种原因,它不返回错误,只是不工作。我不知道为什么,似乎没有注册,我已将afk设置为相等的真实。我卡住了。有什么帮助吗?
afk = False #set to default as False
if Status == 'SENT' or (Status == 'RECEIVED'):
if Message.Body.lower() == '!afk on':
afk = True #set "on
我希望能够在我的代码中更改单词列表,例如
var words= {
AFK Away from the keyboard 4U For you B4N By for now BBL Be back later BDAY Birthday CBA Can't be asked }
已更改为此格式:
var words= {
'AFK': "Away from the keyboard", '4U': "For you", 'B4N': "By for now", 'BBL'
我正在尝试为我的服务器创建一个afk命令,每当我在cmd中运行它时,它都会给出这个错误:
discord.ext.commands.errors.CommandInvokeError: Command raised an
exception: AttributeError: 'Client' object has no attribute
'change_nickname'
我不知道为什么。任何对discord.py有一定了解的人可以帮助我吗?到目前为止,我的代码如下:
import os
import discord
import
我在sqlite.org上上下下找了又找,还是找不到。我习惯了MySQL,所以我想我可能忽略了一些东西。
请参阅以下代码:
sqlite> select id,event_number,must_say from events where id=28;
28|'28'|'AFK'
sqlite> select id,event_number,must_say from events where must_say='AFK';
sqlite> select id,event_number,must_say from events
区块报价
@client.command()
async def afk(ctx, activity=None):
if ctx.author.mention:
await ctx.send(f"""{ctx.author.mention} is currently afk. Reason: {activity}""")
else:
print("A user is afk...")
我正试着做一个afk的命令,这就是我的全部。我很难让我的机器人响应最近使用这个afk命令的用户。
我最近从一个不同的线程查看了一个AFK命令。代码如下:
client.on('message', (message) => {
// checks if the message author is afk
if (db.has(message.author.id + '.afk')) {
message.channel.send(`Welcome back ${message.author} I removed your AFK.`);
db.delete(message.author.id + '.afk');
db.de
我遇到了一个问题,当我启动我的机器人并运行这个命令时,它会显示"undefined“或"null”作为输出。我该如何解决这个问题?
我已经尝试使用与所有其他选项相同的方法。
if (serv.verified == false) {
var veri = "No.";
}
其中它检查布尔值、字符串或数字。它似乎就是不起作用。它将我的变量设置为空或未定义。
if (serv.afkChannel == `null`) {
var afk = "No AFK VC.";
}
if (serv.verified == true) {
目前,我只有一个简单的表,其中满是输入命令的用户:~afk
示例:
var afkMembers = []
client.on('message' async message => {
if (message.content.toLowerCase() === '~afk') {
afkMembers.push(message.author.id)
return message.channel.send('you are now marked as AFK')
}
if (message.content.toLowerCase() ===
import sqlite3
conn = sqlite3.connect('carlist.db')
c = conn.cursor()
c.execute("""CREATE TABLE IF NOT EXISTS carlist(
ID INTEGER PRIMARY KEY AUTOINCREMENT,
Brand text NOT NULL,
Model text NOT NULL,
License Plate text NOT NULL,
Year INTEG
我目前正在尝试用python制作一个不和谐的机器人(对我来说几乎是全新的东西)。我试图创建一个AFK函数(类似于Dyno的函数)。这是我的代码: afkdict = {}
@client.command(name = "afk", brief = "Away From Keyboard",
description = "I'll give you the afk status and if someone pings you before you come back, I'll tell "
我做了一个工作的AFK代码,但我需要它切片(删除) 'AFK‘,如果用户发送消息。代码是:
@client.command()
async def afk(ctx, *, message="Dind't specify a message."):
global afk_dict
if ctx.author in afk_dict:
afkdict.pop(ctx.author)
await ctx.send('Welcome back! You are no longer afk.')
我执行了一个AFK命令,如果用户ping了某个AFK用户,机器人将在当前通道中发送一条消息,告知他标记的用户是AFK。
但我想补充一点。机器人还需要私下给AFK的人发消息,说(user that you in this message: user message)
当前代码:
client.on('message', (message) => {
message.mentions.users.forEach((user) => {
if (message.author.bot) return false;
if (
message.content.
在我的组合框中,有以下项目
Edward
Isaac Maria
tony Samuel
Vikram Singh
Natasha raghav
krishh
Rahul Krishna
当我输入kr时,组合框将列出任何位置包含“kr”的所有匹配单词,即组合框将列出vikram, krishh, rahul Krishna。在组合框中,自动完成模式是Suggest,自动完成源是Custom Source,但是当我在组合框中输入kr时,它只显示以kr开头的单词。在组合框里,有100多个名字。