@echo @echo off
call %~dp0venv\Scripts\activate
cd %~dp0bot
python botrun.py
pause
import discord
from discord.ext import commands
from discord import client
TOKEN = "Токен"
client = commands.Bot(command_prefix=('f?'))
client.remove_command( 'help' )
@client.event
async def on_ready():
await client.change_presence(status = discord.Status.do_not_disturb, activity = discord.Activity(type=discord.ActivityType.watching, name='f?help | | '))
print("Flamengo bot запущен!")
#-------------------------------------------------------------------------------------------------------------
#------------------------------------------------общение------------------------------------------------------
@client.command()
async def привет(ctx):
await ctx.reply('привет!')
@client.group(invoke_without_command = True)
async def как(ctx):
await ctx.reply('что именно?')
@как.command()
async def дела(ctx):
await ctx.reply('Хорошо, а у тебя?')
#-------------------------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------
client.run(TOKEN)
#Команда для бана
@client.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member: discord.Member, *, reason):
await ctx.channel.purge(limit = 1)
embed = discord.Embed(title = 'Пользователь забанен!', color = discord.Color.red() )
embed.add_field(name = 'Модератор / админ:', value = ctx.message.author.mention, inline = False)
embed.add_field(name = 'Нарушитель:', value = member.mention, inline = False)
embed.add_field(name= 'Причина:', value = reason, inline = False)
embed.set_author( name = ctx.message.author.name, icon_url = ctx.message.author.avatar_url)
await ctx.send(embed = embed)
await member.send(f'Вы забанены по причине "{reason}"!')
await member.ban( reason = reason)
#Команда для кика
@client.command()
@commands.has_permissions(kick_members = True)
async def kick(ctx, member: discord.Member, *, reason):
await ctx.channel.purge(limit = 1)
embed = discord.Embed(title = 'Пользователь кикнут!', color = discord.Color.red() )
embed.add_field(name = 'Модератор / админ:', value = ctx.message.author.mention, inline = False)
embed.add_field(name = 'Нарушитель:', value = member.mention, inline = False)
embed.add_field(name= 'Причина:', value = reason, inline = False)
embed.set_author( name = ctx.message.author.name, icon_url = ctx.message.author.avatar_url)
await ctx.send(embed = embed)
await member.send(f'Вы кикнуты по причине "{reason}"!')
await member.kick( reason = reason)