當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。