This commit is contained in:
Mirco Wittrien 2019-12-30 12:02:46 +01:00
parent d2ff7b8dce
commit 6b155e4ee3
3 changed files with 10 additions and 5 deletions

View File

@ -2122,7 +2122,8 @@
};
BDFDB.ChannelUtils = {};
BDFDB.ChannelUtils.isTextChannel = function (channel) {
BDFDB.ChannelUtils.isTextChannel = function (channelOrId) {
let channel = typeof channelOrId == "string" ? LibraryModules.ChannelStore.getChannel(channelOrId) : channelOrId;
return BDFDB.ObjectUtils.is(channel) && (channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_TEXT || channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_STORE || channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_ANNOUNCEMENT);
};
BDFDB.ChannelUtils.getId = function (div) {
@ -2189,6 +2190,10 @@
};
BDFDB.DMUtils = {};
BDFDB.DMUtils.isDMChannel = function (channelOrId) {
let channel = typeof channelOrId == "string" ? LibraryModules.ChannelStore.getChannel(channelOrId) : channelOrId;
return BDFDB.ObjectUtils.is(channel) && (channel.type == BDFDB.DiscordConstants.ChannelTypes.DM || channel.type == BDFDB.DiscordConstants.ChannelTypes.GROUP_DM);
};
BDFDB.DMUtils.getIcon = function (id) {
var channel = LibraryModules.ChannelStore.getChannel(id = typeof id == "number" ? id.toFixed() : id);
if (!channel) return null;

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
class ShowHiddenChannels {
getName () {return "ShowHiddenChannels";}
getVersion () {return "2.6.7";}
getVersion () {return "2.6.8";}
getAuthor () {return "DevilBro";}
@ -316,8 +316,8 @@ class ShowHiddenChannels {
}
}
isChannelHidden (channelid) {
return !BDFDB.UserUtils.can("VIEW_CHANNEL", BDFDB.UserUtils.me.id, channelid);
isChannelHidden (channelId) {
return !BDFDB.DMUtils.isDMChannel(channelId) && !BDFDB.UserUtils.can("VIEW_CHANNEL", BDFDB.UserUtils.me.id, channelId);
}
getHiddenChannels (guild) {