本文整理汇总了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;未经允许,请勿转载。 |
请发表评论