• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextChannelDeleteEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



TextChannelDeleteEvent类属于net.dv8tion.jda.core.events.channel.text包,在下文中一共展示了TextChannelDeleteEvent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@Override
public void onTextChannelDelete(TextChannelDeleteEvent e) {
    String portalStatus = RubiconBot.getMySQL().getGuildValue(e.getGuild(), "portal");
    if(portalStatus.equalsIgnoreCase("closed") || portalStatus.equalsIgnoreCase("waiting"))
        return;
    if(portalStatus.equalsIgnoreCase("open")) {
        TextChannel channel = e.getJDA().getTextChannelById(RubiconBot.getMySQL().getPortalValue(e.getGuild(), "channelid"));
        if(e.getChannel().getId() != channel.getId())
            return;

        Guild partnerGuild = e.getJDA().getGuildById(RubiconBot.getMySQL().getPortalValue(e.getGuild(), "partnerid"));
        RubiconBot.getMySQL().deletePortal(e.getGuild());
        RubiconBot.getMySQL().deletePortal(partnerGuild);
        RubiconBot.getMySQL().updateGuildValue(e.getGuild(), "portal", "closed");
        RubiconBot.getMySQL().updateGuildValue(partnerGuild, "portal", "closed");

        sendPortalNotification(e.getGuild(), "Portal was closed.");
        sendPortalNotification(partnerGuild, "Portal was closed on the other side.");
    }
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:21,代码来源:ChannelDeleteListener.java


示例2: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
/**
 * Deactivate verification when channel got deleted
 */
@Override
public void onTextChannelDelete(TextChannelDeleteEvent event) {
    if (!RubiconBot.getMySQL().verificationEnabled(event.getGuild())) return;
    if (!RubiconBot.getMySQL().getVerificationValue(event.getGuild(), "channelid").equals(event.getChannel().getId()))
        return;

    RubiconBot.getMySQL().deleteGuildVerification(event.getGuild());
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:12,代码来源:VerificationListener.java


示例3: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@Override
public void onTextChannelDelete(TextChannelDeleteEvent event)
{
    String cId = event.getChannel().getId();

    // if the deleted channel was a schedule, clear the db entries
    if(Main.getScheduleManager().isASchedule(cId))
    {
        Main.getDBDriver().getEventCollection().deleteMany(eq("channelId", cId));
        Main.getDBDriver().getScheduleCollection().deleteOne(eq("_id", cId));
    }
}
 
开发者ID:notem,项目名称:Saber-Bot,代码行数:13,代码来源:EventListener.java


示例4: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@Override
public void onTextChannelDelete(final TextChannelDeleteEvent event) {
    final long channelId = event.getChannel().getIdLong();
    final long guildId = event.getGuild().getIdLong();

    if (Games.get(channelId) != null) {
        DiscordLogger.getLogger().log("%s `%s` Destroying game due to deleted channel **#%s** `%s` in guild **%s** `%s`.",
                Emojis.BOOM, TextchatUtils.berlinTime(),
                event.getChannel().getName(), channelId, event.getGuild().getName(), guildId);

        Games.get(channelId).destroy(new UserFriendlyException("Main game channel `%s` in guild `%s` was deleted", channelId, guildId));
    }
}
 
开发者ID:napstr,项目名称:wolfia,代码行数:14,代码来源:InternalListener.java


示例5: handleChannelDeletion

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
public static void handleChannelDeletion(TextChannelDeleteEvent event){
    TextChannel channel = event.getChannel();
    if(RubiconBot.getMySQL().isBlacklisted(channel))
        unblockChannel(channel);
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:6,代码来源:CommandBlacklist.java


示例6: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@Override
public void onTextChannelDelete(TextChannelDeleteEvent event) {
    CommandBlacklist.handleChannelDeletion(event);
}
 
开发者ID:Rubicon-Bot,项目名称:Rubicon,代码行数:5,代码来源:ChannelDeletionListener.java


示例7: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@SubscribeEvent
private void onTextChannelDelete(final TextChannelDeleteEvent event)
{
    this.delete(event, event.getChannel().getName());
}
 
开发者ID:JDA-Applications,项目名称:GuildBot,代码行数:6,代码来源:CommandExecutor.java


示例8: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
@Override
public void onTextChannelDelete(TextChannelDeleteEvent event) {
    if (activeGames.containsKey(Long.valueOf(event.getChannel().getId()))) closeGame(event.getChannel());
}
 
开发者ID:Godson777,项目名称:KekBot,代码行数:5,代码来源:GamesManager.java


示例9: onTextChannelDelete

import net.dv8tion.jda.core.events.channel.text.TextChannelDeleteEvent; //导入依赖的package包/类
public void onTextChannelDelete(TextChannelDeleteEvent event) {} 
开发者ID:DV8FromTheWorld,项目名称:JDA,代码行数:2,代码来源:ListenerAdapter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XSParticle类代码示例发布时间:2022-05-23
下一篇:
Java LightModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap