added things, removed things
This commit is contained in:
parent
098b499ec4
commit
c7bffe926f
1 changed files with 13 additions and 39 deletions
|
@ -6,19 +6,6 @@ class Helpers {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rewrite for Eris
|
|
||||||
userError (channel, cmd, error) {
|
|
||||||
const embed = new MessageEmbed()
|
|
||||||
.setColor('#EF5350')
|
|
||||||
.setTitle(`${cmd.help.name}:${cmd.help.category.toLowerCase()}`)
|
|
||||||
.setDescription(error)
|
|
||||||
.addField('**Usage**', cmd.help.usage)
|
|
||||||
.setFooter(`Run 'help ${cmd.help.name}' for more information.`);
|
|
||||||
|
|
||||||
channel.send(embed);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
async getLastMessage (channel) {
|
async getLastMessage (channel) {
|
||||||
const messages = await channel.messages.fetch({ limit: 2 });
|
const messages = await channel.messages.fetch({ limit: 2 });
|
||||||
return messages.last().content;
|
return messages.last().content;
|
||||||
|
@ -41,37 +28,24 @@ class Helpers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is an eris feature lmao
|
highestRole (member) {
|
||||||
findMembers (guild, query) {
|
if (member.roles.length === 0) return member.guild.roles.find(r => r.name === '@everyone');
|
||||||
query = query.toLowerCase();
|
|
||||||
|
|
||||||
const matches = [];
|
let highestRole;
|
||||||
let match;
|
|
||||||
|
|
||||||
try {
|
for (const roleID of member.roles) {
|
||||||
match = guild.members.find(x => x.displayName.toLowerCase() == query);
|
const role = member.guild.roles.get(roleID);
|
||||||
if (!match) guild.members.find(x => x.user.username.toLowerCase() == query);
|
if (!highestRole || highestRole.position < role.position) highestRole = role;
|
||||||
} catch (err) {} //eslint-disable-line no-empty
|
}
|
||||||
|
|
||||||
|
return highestRole;
|
||||||
|
}
|
||||||
|
|
||||||
if (match) matches.push(match);
|
findRole (input, guild) {
|
||||||
guild.members.forEach(member => {
|
|
||||||
if (
|
|
||||||
(member.displayName.toLowerCase().startsWith(query) ||
|
|
||||||
member.user.tag.toLowerCase().startsWith(query)) &&
|
|
||||||
member.id != (match && match.id)
|
|
||||||
) {
|
|
||||||
matches.push(member);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return matches;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
findRole (input, message) {
|
|
||||||
let role;
|
let role;
|
||||||
role = message.guild.roles.find(r => r.name.toLowerCase() === input.toLowerCase());
|
role = guild.roles.find(r => r.name.toLowerCase() === input.toLowerCase());
|
||||||
if (!role) {
|
if (!role) {
|
||||||
role = message.guild.roles.get(input.toLowerCase());
|
role = guild.roles.get(input.toLowerCase());
|
||||||
}
|
}
|
||||||
if (!role) return;
|
if (!role) return;
|
||||||
return role;
|
return role;
|
||||||
|
|
Loading…
Reference in a new issue