Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Channel To Category #1208

Closed
jatinluthra14 opened this issue Apr 12, 2018 · 9 comments
Closed

Add Channel To Category #1208

jatinluthra14 opened this issue Apr 12, 2018 · 9 comments
Labels
stale This issue is too old.

Comments

@jatinluthra14
Copy link

While using discord.client.create_channel,
How can I add all roles to the new channel?

@Vexs
Copy link
Contributor

Vexs commented Apr 12, 2018

There is an example of this for a single role in the docs, I've taken the liberty of posting it below as well. To do it for all roles is a simple iteration over server.roles.

everyone_perms = discord.PermissionOverwrite(read_messages=False)
my_perms = discord.PermissionOverwrite(read_messages=True)

everyone = discord.ChannelPermissions(target=server.default_role, overwrite=everyone_perms)
mine = discord.ChannelPermissions(target=server.me, overwrite=my_perms)
await client.create_channel(server, 'secret', everyone, mine)

@jatinluthra14
Copy link
Author

@Vexs I tried The iteration but it is not working. Above example has only for bot and @everyone role.

@jatinluthra14
Copy link
Author

Anyone?

@doron-goldstein
Copy link

doron-goldstein commented Apr 12, 2018

This place is for issues regarding the library. Questions like this one are easier to answer on the discord server.

@jatinluthra14 jatinluthra14 changed the title Roles While Creating Channel Add Channel To Category Apr 12, 2018
@jatinluthra14
Copy link
Author

Now the thing is changed
The Question is how to add a channel to category.
Got a "No Way" from Discord Server of discord.py

@doron-goldstein
Copy link

Doesn't change the fact that this isn't the place to look for this kind of help.

@Vexs
Copy link
Contributor

Vexs commented Apr 12, 2018

The async (0.16.x) branch has no support for channel categories. In short: "No Way"

@Rapptz Rapptz closed this as completed Feb 15, 2019
@Rapptz Rapptz added the stale This issue is too old. label Feb 15, 2019
@edraft
Copy link

edraft commented Feb 16, 2019

Hello, you can find Categories with:

for c in s.channels:
        if c.type == 4:
            if c.name == '•☆• -- V.I.P. -- •☆•':
                print('FOUND')
                print(c.name, c.type, c.position, c.is_private)
                #here you can use the channel with c.

@Harmon758
Copy link
Contributor

@jatinluthra14 You can set the target to any role or user. Those are just examples.
As for category channels, they are fully supported on the rewrite branch as CategoryChannels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is too old.
Projects
None yet
Development

No branches or pull requests

6 participants