[Docs] Adding permission docs for interaction framework (#2265)
* Get rid of mediatrsample sln * Add framework perms doc * Append suggestion Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com> * Append suggestion Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
[EnabledInDm(false)]
|
||||
[SlashCommand("ban", "Bans a user in this guild")]
|
||||
public async Task BanAsync(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
[EnabledInDm(false)]
|
||||
[DefaultMemberPermissions(GuildPermission.BanMembers)]
|
||||
[SlashCommand("ban", "Bans a user in this guild")]
|
||||
public async Task BanAsync(...)
|
||||
{
|
||||
...
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[EnabledInDm(true)]
|
||||
[DefaultMemberPermissions(GuildPermission.ViewChannels)]
|
||||
public class Module : InteractionModuleBase<SocketInteractionContext>
|
||||
{
|
||||
[DefaultMemberPermissions(GuildPermission.SendMessages)]
|
||||
public class NestedModule : InteractionModuleBase<SocketInteractionContext>
|
||||
{
|
||||
// While looking for more permissions, it has found 'ViewChannels' and 'SendMessages'. The result of this lookup will be:
|
||||
// ViewChannels + SendMessages + ManageMessages.
|
||||
// If these together are not found for target user, the command will not show up for them.
|
||||
[DefaultMemberPermissions(GuildPermission.ManageMessages)]
|
||||
[SlashCommand("ping", "Pong!")]
|
||||
public async Task Ping()
|
||||
=> await RespondAsync("pong");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
[DefaultMemberPermissions(GuildPermission.SendMessages | GuildPermission.ViewChannels)]
|
||||
[SlashCommand("ping", "Pong!")]
|
||||
public async Task Ping()
|
||||
=> await RespondAsync("pong");
|
||||
Reference in New Issue
Block a user