Created
February 11, 2018 21:54
-
-
Save FireController1847/4b418a43588f29be7196f3e1d9af4728 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m.prefix = "x"; // set your prefix here | |
const mreg = new RegExp(`^<@!?${this.client.user.id}>`); | |
if (mreg.test(m.content)) { // Test for a tag | |
m.content = m.prefix + m.content.replace(mreg, "").replace(" ", ""); // Replaces the content of the message with the prefix instead of the tag | |
m.mentions.users = m.mentions.users.filter(u => u.id != this.client.user.id); // Fixes the user tags to remove the client | |
// The three lines below will change any tags with "what" and "prefix" to turn it into a "prefix" command. | |
if (m.content.toLowerCase().includes("what") && m.content.toLowerCase().includes("prefix")) { | |
m.content = `${m.prefix}prefix`; | |
} | |
} | |
if (!m.content.startsWith(m.prefix)) return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment