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

Slash Commands Not in Permission Overwrite #38

Open
ghost opened this issue Jul 15, 2021 · 1 comment
Open

Slash Commands Not in Permission Overwrite #38

ghost opened this issue Jul 15, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 15, 2021

So pretty much, I was making a nuke command, and I noticed that the slash command permission after the channel nuke was to the default.

function nuke(ctx::Client, message::Message)
    if message.author.id == 337711669306458114
        channel = fetch(get_channel(ctx, message.channel_id)).val

        delete(ctx, channel)

        new_channel = fetch(create_guild_channel(ctx, message.guild_id;
            name=channel.name,
            type=channel.type,
            topic=channel.topic,
            rate_limit_per_user=channel.rate_limit_per_user,
            position=channel.position,
            permission_overwrites=channel.permission_overwrites,
            parent_id=channel.parent_id,
            nsfw=channel.nsfw
        )).val

        create_message(ctx, new_channel.id; content="Nuked!")
    end
end

It works, but it just doesn't keep the original slash command permission

Before Nuke:
image
After Nuke:
image

@rapus95
Copy link

rapus95 commented Jul 18, 2021

Given that I can't find the message_reference object, I guess that the newer developments of the discord api/gateway are not part of the library. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant