E
E
EugenOP2021-09-25 16:04:01
Python
EugenOP, 2021-09-25 16:04:01

How to access chats of a certain category?

I need to access chats from a specific category

Here is an example to access a role:
role = discord.utils.get(ctx.message.guild.roles,id=845581727962759213)
But I don't know how to access chats from certain category

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2021-09-26
@EugenOP

category = ctx.guild.get_channel(872712940890900371)  # получаем категорию
for channel in category.channels:  # https://discordpy.readthedocs.io/en/latest/api.html#discord.CategoryChannel.channels
    print(channel.id, channel.name)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question