本文整理汇总了Java中net.dv8tion.jda.core.managers.PermOverrideManagerUpdatable类的典型用法代码示例。如果您正苦于以下问题:Java PermOverrideManagerUpdatable类的具体用法?Java PermOverrideManagerUpdatable怎么用?Java PermOverrideManagerUpdatable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PermOverrideManagerUpdatable类属于net.dv8tion.jda.core.managers包,在下文中一共展示了PermOverrideManagerUpdatable类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: stopGame
import net.dv8tion.jda.core.managers.PermOverrideManagerUpdatable; //导入依赖的package包/类
/**
* Stop game.
*
* @param guildID the guild id
*/
public void stopGame(Long guildID) //Cause a hard stop of the game on the called from server
{
//set gamestate to Idle, this basically tell us this guild has no-games running anymore
setGameState(guildID, GameState.IDLE);//Either way, as long as gamestate is set to IDLE, the scheduled will eventually stop, instead of right away.
Map<Long, ScheduledFuture<?>> listOfTimers = new HashMap<>(timerThreads.get(guildID));
for (Long taskID : listOfTimers.keySet()) {
listOfTimers.get(taskID).cancel(true);
removeTimer(guildID, taskID);
}
TextChannel townChannel = getTownChannel(guildID);
for (PermissionOverride thisPO : townChannel.getMemberPermissionOverrides()) {
if (thisPO.isMemberOverride()) {
thisPO.delete().queue();
}
}
net.dv8tion.jda.core.entities.Role everyoneRole = townChannel.getGuild().getPublicRole();
PermissionOverride townChannelPO = townChannel.getPermissionOverride(everyoneRole);
PermOverrideManagerUpdatable poa = townChannelPO.getManagerUpdatable();
poa.clear(Permission.MESSAGE_WRITE);
poa.clear(Permission.MESSAGE_READ);
poa.update().queue();
List<Player> playerList = gamesPlayerLists.get(guildID).getPlayerListByRole(Role.WOLF);
List<Member> memberListWolves = new ArrayList<>();
for (Player thisPlayer : playerList) {
memberListWolves.add(thisPlayer.getMember());
}
setChannelPermissions(getWolfChannel(guildID), memberListWolves, false);
//clear theme
clearTheme(guildID);
getTownChannel(guildID).sendMessage("Game Over.").queue();
}
示例2: getManagerUpdatable
import net.dv8tion.jda.core.managers.PermOverrideManagerUpdatable; //导入依赖的package包/类
@Override
public PermOverrideManagerUpdatable getManagerUpdatable()
{
PermOverrideManagerUpdatable mng = managerUpdatable;
if (mng == null)
{
synchronized (mngLock)
{
mng = managerUpdatable;
if (mng == null)
mng = managerUpdatable = new PermOverrideManagerUpdatable(this);
}
}
return mng;
}
示例3: getManagerUpdatable
import net.dv8tion.jda.core.managers.PermOverrideManagerUpdatable; //导入依赖的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.
* <br>This can be used to bulk update channel settings.
*
* @return The PermOverrideManager of this override.
*
* @see #getManager()
*/
PermOverrideManagerUpdatable getManagerUpdatable();