E
E
EugenOP2021-09-24 17:59:50
Python
EugenOP, 2021-09-24 17:59:50

How to change the rights of the created chat, how to send a message there and how to ping this created chat?

How to change the rights of the created chat, how to send a message there and how to ping this created chat?
async def on_message(message):

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Telmor, 2021-09-24
@EugenOP

@bot.command()
async def create_channel(ctx):
    for guild in bot.guilds:
        maincategory = discord.utils.get(guild.categories, id=890206389455159346)#id категории где будет создаваться канал
        channel = await guild.create_text_channel(name=f'Текстовый Канал',category = maincategory)
        member = ctx.author
        #await channel.set_permissions(member,manage_channels=True)
        emb = discord.Embed(title='Канал Создан', description=f'{ctx.author.mention}, Ваш канал был создан. Для перехода в него нажмите -> <#{channel.id}>')
        emb.set_thumbnail(url=ctx.author.avatar_url)
        await ctx.send(embed = emb)
        emb = discord.Embed(tilte='Текст в канале', description=f'{ctx.author.mention}, ваш канал был создан.')
        emb.set_thumbnail(url=ctx.author.avatar_url)
        await channel.send(embed = emb)

Then I think you'll understand. If you write something that is not clear - I will answer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question