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


Java BeamException类代码示例

本文整理汇总了Java中pro.beam.api.exceptions.BeamException的典型用法代码示例。如果您正苦于以下问题:Java BeamException类的具体用法?Java BeamException怎么用?Java BeamException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BeamException类属于pro.beam.api.exceptions包,在下文中一共展示了BeamException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUser

import pro.beam.api.exceptions.BeamException; //导入依赖的package包/类
public BeamUser getUser(BeamAPI beam) throws BeamException {
    String username = this.config.getString("beam.auth.username");
    String password = this.config.getString("beam.auth.password");
    String twoFactor = this.config.getString("beam.auth.twoFactor");

    Game.minecraftUsername = this.config.getString("minecraft.username");

    CheckedFuture<BeamUser, BeamException> task;
    if (twoFactor == null) {
        task = beam.use(UsersService.class).login(username, password);
    } else {
        task = beam.use(UsersService.class).login(username, password, twoFactor);
    }

    return task.checkedGet();
}
 
开发者ID:mixer,项目名称:skyblock-interactive-minecraft,代码行数:17,代码来源:TetrisBukkitConnector.java

示例2: findRelationship

import pro.beam.api.exceptions.BeamException; //导入依赖的package包/类
public CheckedFuture<ChannelStatusResponse, BeamException> findRelationship(BTBBeamChannel channel, BTBBeamUser user) {
    return new Channels.StatusChecker(this.beam.gson).check(this.get(
            String.format("%d/relationship", channel.id),
            ChannelStatusResponse.class,
            BeamHttpClient.getArgumentsBuilder()
                    .put("user", String.valueOf(user.id))
                .build()
    ));
}
 
开发者ID:StreamerSpectrum,项目名称:BeamTeamDiscordBot,代码行数:10,代码来源:BTBChannelsService.java

示例3: start

import pro.beam.api.exceptions.BeamException; //导入依赖的package包/类
public void start() throws ExecutionException, InterruptedException, BeamException {
    BeamUser user = this.bridge.getUser(this.beam);
    BeamChat chat = this.beam.use(ChatService.class).findOne(this.channel).get();
    BeamChatConnectable connectable = chat.makeConnectable(this.beam);

    connectable.connectBlocking();

    connectable.send(AuthenticateMessage.from(user.channel, user, chat.authkey));
    connectable.on(IncomingMessageEvent.class, incomingMessageHandler());
}
 
开发者ID:mixer,项目名称:skyblock-interactive-minecraft,代码行数:11,代码来源:BeamChatLogger.java

示例4: authenticate

import pro.beam.api.exceptions.BeamException; //导入依赖的package包/类
/**
 * Prepares the given instance of the BeamAPI (see: Java Client; https://githuib.com/WatchBeam/beam-client-java)
 * by authenticating it with the API so that it may fetch robot network credentials later (see #findCredentials).
 *
 * @param beam The API that will be prepared.
 * @return The prepared version of that API.
 *
 * @throws BeamException Thrown if invalid credentials are given with which to login.
 */
protected BeamAPI authenticate(BeamAPI beam) throws BeamException {
    UsersService users = beam.use(UsersService.class);
    CheckedFuture<BeamUser, BeamException> loginTask = null;

    if (this.builder.twoFactor != null) {
        loginTask = users.login(this.builder.username, this.builder.password, this.builder.twoFactor);
    } else {
        loginTask = users.login(this.builder.username, this.builder.password);
    }

    loginTask.checkedGet();

    return beam;
}
 
开发者ID:mixer,项目名称:beam-interactive-java,代码行数:24,代码来源:RobotConnector.java

示例5: findCredentials

import pro.beam.api.exceptions.BeamException; //导入依赖的package包/类
/**
 * Finds the robot's credentials for the given channel in a blocking fashion.
 *
 * @param beam The API to work with.
 * @return The asked for credentials.
 *
 * @throws ExecutionException
 * @throws InterruptedException
 */
protected RobotInfo findCredentials(BeamAPI beam) throws BeamException, ExecutionException, InterruptedException {
    return beam.use(TetrisService.class).getRobotCredentials(this.builder.channel).checkedGet();
}
 
开发者ID:mixer,项目名称:beam-interactive-java,代码行数:13,代码来源:RobotConnector.java


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