Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- client = commands.Bot(command_prefix = "!")
- footer = "TutorialBot | v1.2"
- botfilter = "Botok nem tudják ezt a parancsot használni!"
- noperm = "Nincs jogod ehhez!"
- print("Betöltés...")
- @client.event
- async def on_ready():
- print("A rendszer elindult!")
- await client.change_presence(game = discord.Game(name = "Tutorial videó felvétel"))
- @client.command(pass_context = True)
- async def ban(ctx, user: discord.Member = None, *, reason: str = None):
- if ctx.message.author.bot:
- embed = discord.Embed(title = "Védelem", description = botfilter, colour = discord.Colour.red())
- embed.set_footer(text = footer)
- return await client.say(embed = embed)
- if not ctx.message.author.server_permissions.ban_members:
- embed = discord.Embed(title = "Hiba!", description = noperm, colour = discord.Colour.red())
- embed.set_footer(text = footer)
- return await client.say(embed = embed)
- if user == None:
- embed = discord.Embed(title = "Hiba!", description = "Használat: !ban [@felhasználó] (Indok)", colour = discord.Colour.red())
- embed.set_footer(text = footer)
- return await client.say(embed = embed)
- try:
- await client.ban(user)
- except:
- embed = discord.Embed(title = "Hiba!", description = "Nincs elegendő jogom kitiltani a megadott felhasználót!", colour = discord.Colour.red())
- embed.set_footer(text = footer)
- return await client.say(embed = embed)
- if reason == None:
- reason = "Nincs megadva"
- embed = discord.Embed(title = "Moderáció", description = "Sikeres kitiltás!", colour = discord.Colour.green())
- embed.add_field(name = "Kitiltott", value = user, inline = False)
- embed.add_field(name = "Végrehajtó", value = ctx.message.author.mention, inline = False)
- embed.add_field(name = "Indok", value = reason, inline = False)
- embed.set_footer(text = footer)
- await client.say(embed = embed)
- try:
- embed = discord.Embed(title = "Figyelmeztetés!", description = "Ki lettél tiltva!", colour = discord.Colour.green())
- embed.add_field(name = "Szerver", value = ctx.message.server.name, inline = False)
- embed.add_field(name = "Végrehajtó", value = ctx.message.author.mention, inline = False)
- embed.add_field(name = "Indok", value = reason, inline = False)
- embed.set_footer(text = footer)
- await client.send_message(user, embed = embed)
- except:
- embed = discord.Embed(title = "Figyelem!", description = "Nem sikerült figyelmeztetni a kitiltott személy privátban!", colour = discord.Colour.gold())
- embed.set_footer(text = footer)
- await client.say(embed = embed)
- client.run("Botod tokenje")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement