import discord import random from discord . ext import commands config = { 'token' : '' , 'prefix' : '#' , } intents = discord . Intents . default ( ) intents . presences = True intents . members = True intents . message_content = True bot = commands . Bot ( command_prefix = config [ 'prefix' ] , intents = intents ) @bot.command ( ) async def rand ( ctx ) : await ctx . reply ( random . randint ( 0 , 100 ) ) @bot.event async def on_message ( ctx ) : await bot . process_commands ( ctx ) if ctx . author != bot . user : if ctx . channel . name == "bot-test" : await ctx . reply ( 'Ты ' + ctx . channel . name ) bot . run ( config [ 'token' ] )