Discord Bot проблемы

Ebatte_Sratte

Участник
Автор темы
38
8
Мне нужен дс бот который будет отвеччать на сообщение тем же содержанием но почему то ctx.content не работает
Вот код:
Код:
import discord
from discord.ext import commands

config = {
    'token': '',
    'prefix': '$',
}

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.default())

@bot.event
async def on_message(ctx):
    if ctx.author != bot.user:
        await ctx.reply(ctx.content)

bot.run(config['token'])
 

skrrt

Активный
249
90
попробуй методами *message.content* и *message.channel.send*

JS:
import discord
from discord.ext import commands

config = {
    'token': '',
    'prefix': '$',
}

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.default())

@bot.event
async def on_message(message):
    if message.author != bot.user:
        await message.channel.send(message.content)

bot.run(config['token'])
 

Ebatte_Sratte

Участник
Автор темы
38
8
попробуй методами *message.content* и *message.channel.send*

JS:
import discord
from discord.ext import commands

config = {
    'token': '',
    'prefix': '$',
}

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.default())

@bot.event
async def on_message(message):
    if message.author != bot.user:
        await message.channel.send(message.content)

bot.run(config['token'])
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message