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


Java IVoiceChannel.leave方法代码示例

本文整理汇总了Java中sx.blah.discord.handle.obj.IVoiceChannel.leave方法的典型用法代码示例。如果您正苦于以下问题:Java IVoiceChannel.leave方法的具体用法?Java IVoiceChannel.leave怎么用?Java IVoiceChannel.leave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sx.blah.discord.handle.obj.IVoiceChannel的用法示例。


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

示例1: leaveMusic

import sx.blah.discord.handle.obj.IVoiceChannel; //导入方法依赖的package包/类
@Command(
        command = "leave",
        alias = "leave",
        description = "The Bot leaves voice Server",
        arguments = {},
        permission = "music_control",
        prefix = Globals.MUSIC_PREFIX
)
public boolean leaveMusic(MessageReceivedEvent event, String[] args) {
    IVoiceChannel botVoiceChannel = event.getClient().getOurUser().getVoiceStateForGuild(event.getGuild()).getChannel();

    if (botVoiceChannel == null) {
        BotUtils.sendEmbMessage(event.getChannel(), SMB.shortMessage(LANG.getTranslation("music_notinchannel_user")), true);
        return false;
    }

    AudioPlayer audioP = AudioPlayer.getAudioPlayerForGuild(event.getGuild());

    audioP.clear();

    botVoiceChannel.leave();
    return true;
}
 
开发者ID:ModdyLP,项目名称:MoMuOSB,代码行数:24,代码来源:MainMusic.java

示例2: runCommand

import sx.blah.discord.handle.obj.IVoiceChannel; //导入方法依赖的package包/类
/**
 * Leaves current voice channel
 * @param event passed event
 * @param args passed arguments
 */
@Override
public final void runCommand(MessageReceivedEvent event, String args) {
    // The channel the bot is in
    IVoiceChannel currentChannel = event.getClient().getOurUser()
            .getVoiceStateForGuild(event.getGuild()).getChannel();

    if (currentChannel == null) {
        rexCord.sendMessageWithBlock(event.getChannel(),
                "RexCord is not in a voice channel!");
        return;
    }

    currentChannel.leave();
}
 
开发者ID:Pedro12909,项目名称:RexCord,代码行数:20,代码来源:LeaveCommand.java

示例3: leaveVoiceChannel

import sx.blah.discord.handle.obj.IVoiceChannel; //导入方法依赖的package包/类
public void leaveVoiceChannel() {
	IVoiceChannel voiceChannel = Shadbot.getClient().getOurUser().getVoiceStateForGuild(guild).getChannel();
	if(voiceChannel != null && voiceChannel.getShard().isReady()) {
		voiceChannel.leave();
	}
}
 
开发者ID:Shadorc,项目名称:Shadbot,代码行数:7,代码来源:GuildMusic.java


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