我在这个代码上遇到了麻烦(抱歉,它太大了):
import discord, random, asyncio, datetime, time, os
from discord.utils import get
from discord.ext import commands
from discord.ext.commands import bot
import json
bot = commands.Bot(command_prefix="aag!", case_insensitive=True)
@bot.event
async def on_ready():
aw
我有一个关于Debian9不一致引导的问题,我试图运行我的代码,但是VPS抛给我这个错误。以前,我通常在另一个VPS上安装这个机器人,一切都正常工作,但现在它不工作了。我不知道我是否遗漏了任何模块或错误安装的节点和npm。
TypeError: fields.flat is not a function
at Function.normalizeFields (/home/bot/node_modules/discord.js/src/structures/MessageEmbed.js:443:8)
at MessageEmbed.addFields (/home/bot
我该如何打印一份我所有朋友的名单呢?我希望能够通过Discord.py库实现这一点,希望这里的人知道。
我目前得到了错误:
for user in discord.ClientUser.friends: TypeError: 'property' object is not iterable
程序:
token = ""
prefix = "::"
import discord
import asyncio
import codecs
import sys
import io
from discord.ext import commands
f
我有一个用Discord.py编写的预生成代码,它使用Heroku托管,目前它是在线的,只是每当我使用一个命令时,它就什么也不返回,但是当在本地使用Notepad++运行它时,这些命令工作得很好。
main.py
import discord
from discord.ext import commands
token = 'OBVIOUSLY THE TOKEN IS HERE'
prefix = "?"
intents = discord.Intents.default() # or .all() if you ticked all, that is eas
我正在创建一个不和谐的Server,当我构建和执行jar文件时,它说
误差
C:\Users\[user.name]\IdeaProjects\Java-Discord-Bot\target>java -jar "Java-Discord-Bot-1.0 V.jar"
Error: Could not find or load main class discord.java.bot.JavaDiscordBot
这是我的POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<proj
这包括前缀和命令,以及你输入的任何不一致的内容。这是我的代码:
from discord.ext import commands
import discord.member
from dotenv import load_dotenv
import discord
from discord.utils import get
bot = commands.Bot(command_prefix="bot ")
TOKEN = "4893285903457897349857938275732985" #not a valid token by the way :)
最近,我试图清理我的main.py文件,因为其中有很多代码。我想把每个命令都存储到一个文件中。我从清除/清除命令开始。每当我输入>clean时,我就会得到一个错误,即“命令未找到”。我该怎么解决这个问题?一些main.py和clear.py的代码如下所示。如有任何帮助,将不胜感激!
MAIN.PY
import discord
from discord import User
import os
from keep_alive import keep_alive
from discord.ext import commands
import random
import requests
我需要创建从电报到我的不一致通道的桥,但是当我运行.js脚本时,我会收到错误。 throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (\dev\tele-discord-bot\node_modules\discord.js\src\client\Client.js:544:13)
我是一个新的制造Discord.js机器人,我一直收到这样的错误:机器人现在在线!
HIT
C:\Users\kerix\Desktop\MrMiner\bot\index.js:20
let commandMethod = commands.get(name);
^
ReferenceError: commands is not defined
at Client.<anonymous> (C:\Users\kerix\Desktop\MrMiner\bot\index.js:20:25)
at Clien
我试着用discord.py做了一个机器人
bot = commands.Bot(command_prefix='$', description="This is a test bot")
@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')
@bot.command(name='ping')
async def ping(ctx):
await ctx.send("pong
因此,我正在开发一个discord.js,它使用discord.js,一个用于discord.js的node.js包装器。基本上,代码是这样工作的:
/*
A ping pong bot, whenever you send "ping", it replies "pong".
*/
// import the discord.js module
const Discord = require('discord.js');
// create an instance of a Discord Client, and call it bot
discord.py文档有一个spotify类(),我想知道如何将此活动设置为概要文件。文档中没有示例。我尝试在on_ready事件中使用此活动。
@client.event
async def on_ready():
print("Bot was connected to the server")
await bot.change_presence(activity=discord.Spotify(title = "Test"))
我的输出是错的。
Bot was connected to the server
Ignoring excepti
我正在使用discord.js,并且我想创建一个嵌入消息,但是我得到了以下错误: TypeError: (intermediate value).setColor(...).setTitle(...).setUrl is not a function
at Client.<anonymous> (C:\Users\oussa\OneDrive\Bureau\Discord Bot\index.js:48:10)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (C:\Users