Change var to let on all variables
I've heard it's apparently best practice so I guess why not. I don't know if it actually matters though.
This commit is contained in:
parent
489d365eb8
commit
2594c5a60c
1 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
module.exports = function (text, guild) {
|
module.exports = function (text, guild) {
|
||||||
var id = "";
|
let id = "";
|
||||||
var ismention = false;
|
let ismention = false;
|
||||||
if (
|
if (
|
||||||
text.substring(0, 2) == "<@" &&
|
text.substring(0, 2) == "<@" &&
|
||||||
text.substring(text.length - 1, text.length) == ">"
|
text.substring(text.length - 1, text.length) == ">"
|
||||||
) {
|
) {
|
||||||
var start = 2;
|
let start = 2;
|
||||||
if (text.substring(0, 3) == "<@!") start = 3;
|
if (text.substring(0, 3) == "<@!") start = 3;
|
||||||
id = text.substring(start, text.length - 1);
|
id = text.substring(start, text.length - 1);
|
||||||
ismention = true;
|
ismention = true;
|
||||||
|
@ -16,7 +16,7 @@ module.exports = function (text, guild) {
|
||||||
}
|
}
|
||||||
if (!ismention) {
|
if (!ismention) {
|
||||||
guild.members.cache.each(function (guildMember, guildMemberID) {
|
guild.members.cache.each(function (guildMember, guildMemberID) {
|
||||||
var compare = text.toLowerCase();
|
let compare = text.toLowerCase();
|
||||||
if (guildMember.user.username.toLowerCase().includes(compare)) {
|
if (guildMember.user.username.toLowerCase().includes(compare)) {
|
||||||
id = guildMemberID;
|
id = guildMemberID;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue