mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
refactor(Channel): change channel types to UPPER_CASE (#6035)
This commit is contained in:
@@ -582,7 +582,7 @@ class Util extends null {
|
||||
str = str
|
||||
.replace(/<@!?[0-9]+>/g, input => {
|
||||
const id = input.replace(/<|!|>|@/g, '');
|
||||
if (channel.type === 'dm') {
|
||||
if (channel.type === 'DM') {
|
||||
const user = channel.client.users.cache.get(id);
|
||||
return user ? Util.removeMentions(`@${user.username}`) : input;
|
||||
}
|
||||
@@ -600,7 +600,7 @@ class Util extends null {
|
||||
return mentionedChannel ? `#${mentionedChannel.name}` : input;
|
||||
})
|
||||
.replace(/<@&[0-9]+>/g, input => {
|
||||
if (channel.type === 'dm') return input;
|
||||
if (channel.type === 'DM') return input;
|
||||
const role = channel.guild.roles.cache.get(input.replace(/<|@|>|&/g, ''));
|
||||
return role ? `@${role.name}` : input;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user