本文整理汇总了Java中net.dv8tion.jda.core.managers.PermOverrideManager类的典型用法代码示例。如果您正苦于以下问题:Java PermOverrideManager类的具体用法?Java PermOverrideManager怎么用?Java PermOverrideManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermOverrideManager类属于net.dv8tion.jda.core.managers包,在下文中一共展示了PermOverrideManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import net.dv8tion.jda.core.managers.PermOverrideManager; //导入依赖的package包/类
@Override
protected void execute(CommandEvent e) {
if (C.hasRole(e.getMember(), Roles.ADMIN)) {
try {
PermissionOverride permissionOverride = e.getTextChannel().getPermissionOverride(Roles.EVERYONE.getRole());
PermOverrideManager manager = permissionOverride.getManager();
manager.deny(Permission.MESSAGE_WRITE).queue();
e.replySuccess(":lock: Channel has been locked!");
} catch (NullPointerException npe) {
e.replyError("An error occurred while locking the channel! Please make sure this channel is setup correctly.");
}
} else {
e.replyError(C.permMsg(Roles.ADMIN));
}
}
示例2: execute
import net.dv8tion.jda.core.managers.PermOverrideManager; //导入依赖的package包/类
@Override
protected void execute(CommandEvent e) {
if (C.hasRole(e.getMember(), Roles.ADMIN)) {
try {
PermissionOverride permissionOverride = e.getTextChannel().getPermissionOverride(Roles.EVERYONE.getRole());
PermOverrideManager manager = permissionOverride.getManager();
manager.grant(Permission.MESSAGE_WRITE).queue();
e.replySuccess(":unlock: Channel has been unlocked!");
} catch (NullPointerException npe) {
e.replyError("An error occurred while un-locking the channel! Please make sure this channel is setup correctly.");
}
} else {
e.replyError(C.permMsg(Roles.ADMIN));
}
}
示例3: getManager
import net.dv8tion.jda.core.managers.PermOverrideManager; //导入依赖的package包/类
@Override
public PermOverrideManager getManager()
{
PermOverrideManager mng = manager;
if (mng == null)
{
synchronized (mngLock)
{
mng = manager;
if (mng == null)
mng = manager = new PermOverrideManager(this);
}
}
return mng;
}
示例4: getManager
import net.dv8tion.jda.core.managers.PermOverrideManager; //导入依赖的package包/类
/**
* Returns the {@link net.dv8tion.jda.core.managers.PermOverrideManager PermOverrideManager} for this PermissionOverride.
* In the PermOverrideManager you can modify the permissions of the override.
*
* @return The PermOverrideManager of this override.
*
* @see #getManagerUpdatable()
*/
PermOverrideManager getManager();