A
A
Alexander2021-01-04 17:59:53
Python
Alexander, 2021-01-04 17:59:53

Mut by changing permissions?

So I made a mut through permissions for text channels, and I have a question, can this be done with voice channels?

async def mute(self, ctx, member: discord.Member = None, time: int = None, *, args=None):
    await ctx.channel.purge(limit=1)
    await ctx.channel.set_permissions(member, read_messages=True, send_messages=False)
    await ctx.allvoice_channel.set_permissions(member, connect=False)
    await asyncio.sleep(time)
    await ctx.channel.set_permissions(member, read_messages=True, send_messages=True)
    await ctx.send(embed=discord.Embed(description=f'**Unmuted user {member.mention}** \n*После недолгого перерыва...*',
                                    color=0x00ff00), delete_after=20)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-01-04
@BigTooth

Of course you can, you just need to find it off. python documentation. For example, flags in JS:

CONNECT (connect to a voice channel); SPEAK (speak in a voice channel)
But you can try this in python:
connect; speak
Hope this helps you :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question