本文整理汇总了Java中sx.blah.discord.handle.obj.IChannel.getName方法的典型用法代码示例。如果您正苦于以下问题:Java IChannel.getName方法的具体用法?Java IChannel.getName怎么用?Java IChannel.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sx.blah.discord.handle.obj.IChannel
的用法示例。
在下文中一共展示了IChannel.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromChannel
import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public WebChannel fromChannel(IChannel c, GuildSettings settings) {
id = c.getLongID();
name = c.getName();
discalChannel = settings.getDiscalChannel().equalsIgnoreCase(String.valueOf(id));
return this;
}
示例2: getChannelNameFromNameOrId
import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
/**
* Gets the IChannel from its name.
*
* @param nameOrId The channel name or ID.
* @param guildId The ID of the guild this channel belongs to.
* @return the IChannel if successful, else <code>null</code>.
*/
public static String getChannelNameFromNameOrId(String nameOrId, long guildId) {
IGuild guild = Main.client.getGuildByID(guildId);
if (nameOrId.contains("#")) {
nameOrId = nameOrId.replace("#", "");
}
for (IChannel c : guild.getChannels()) {
if (c.getName().equalsIgnoreCase(nameOrId) || c.getStringID().equals(nameOrId)) {
return c.getName();
}
}
return "ERROR";
}
示例3: DiscordChannel
import sx.blah.discord.handle.obj.IChannel; //导入方法依赖的package包/类
public DiscordChannel(IChannel channel) {
this.id = channel.getID();
this.name = channel.getName();
this.isPrivate = channel.isPrivate();
}