“Saluran Perintah Unhiding in Discord.py” Kode Jawaban

Perintah Pembersihan Discord.py

You can treat single argument callables (like int) like converters for the purpose of declaring arguments. I also changed your permissions check to be handled automatically by a commands.check

@bot.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def clean(ctx, limit: int):
        await ctx.channel.purge(limit=limit)
        await ctx.send('Cleared by {}'.format(ctx.author.mention))
        await ctx.message.delete()

@clean.error
async def clear_error(ctx, error):
    if isinstance(error, commands.MissingPermissions):
        await ctx.send("You cant do that!")
Santino

bagaimana melakukan perintah pemutusan pada anggota dalam python perselisihan

@client.command
async def leave(ctx, member : discord.Member):
    await discord.Member.disconnect()



 if msg.startswith("$kick."):
        users = message.guild.members
        count = 6
        name = ""
        while count < len(message.content):
            name = name + str(message.content[count])
            count = count + 1
        #till here we just got the name
        x = 0
        while x > id.member_count:
            if name == users[x]:
                leave('was kicked',user[x])
                break
Friendly Flatworm

Perintah Penghapusan Saluran Berganda di Discord.py

#channel delete
@bot.command(aliases=['chd'])
@commands.has_permissions(manage_channels=True)
async def chdel(ctx, *channels: discord.TextChannel):
    for ch in channels:
        await ch.delete()
        await ctx.send(f'**<:vf:947194381172084767>`{ch.name}` has been deleted**')
        await sleep(1)
Hunter 87

Saluran Perintah Unhiding in Discord.py

#unhide channel
@bot.command(help=" Use this command to unhide a channel")
@commands.has_permissions(manage_channels=True)
async def unhide(ctx):
    await ctx.channel.set_permissions(ctx.guild.default_role,view_channel=True)
    await ctx.send('**<:vf:947194381172084767>This channel is visible to everyone**')
    await ctx.channel.purge(limit=2)
Hunter 87

Jawaban yang mirip dengan “Saluran Perintah Unhiding in Discord.py”

Pertanyaan yang mirip dengan “Saluran Perintah Unhiding in Discord.py”

Lebih banyak jawaban terkait untuk “Saluran Perintah Unhiding in Discord.py” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya