Answer the question
In order to leave comments, you need to log in
How to solve a problem with Discord bot?
import discord
from discord.ext import commands
client = discord.Client()
bot = commands.Bot(command_prefix='!') #инициализируем бота с префиксом '!'
@bot.command(pass_context=True) #разрешаем передавать аргументы
async def test(ctx, arg): #функция
await ctx.send(arg)
client.run( 'Мой токен' )
Answer the question
In order to leave comments, you need to log in
Aren't you embarrassed that you didn't launch the bot?
https://github.com/Rapptz/discord.py#bot-example
import discord
from discord.ext import commands
Bot = commands.Bot(command_prefix = "!") #инициализируем бота с префиксом '!'
@Bot.command() #в новых версиях можно делать без pass_context
async def test(ctx, *, arg): #* означает, что можно писать хоть что,
await ctx.send(arg) #и всё уйдёт в "arg"
Bot.run( 'токен_бота' )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question