当前位置: 首页>>代码示例>>Java>>正文


Java PermOverrideManagerUpdatable类代码示例

本文整理汇总了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();
}
 
开发者ID:IANetworks,项目名称:Ducky-Mc-Duckerson,代码行数:40,代码来源:Werewolf.java

示例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;
}
 
开发者ID:DV8FromTheWorld,项目名称:JDA,代码行数:16,代码来源:PermissionOverrideImpl.java

示例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();
 
开发者ID:DV8FromTheWorld,项目名称:JDA,代码行数:11,代码来源:PermissionOverride.java


注:本文中的net.dv8tion.jda.core.managers.PermOverrideManagerUpdatable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。