stuff
This commit is contained in:
parent
d2ff7b8dce
commit
6b155e4ee3
|
@ -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
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue