Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

[BUGFIX] Fixed Selfbot Prefix Mentioning Crashing with CMD Prompts #112

Merged
merged 2 commits into from
Jan 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- loadCommands no longer counts/loads "Ghost" commands.
- DMs throwing errors with new Config System && permLevel
- Fixed Reload not erroring on new commands that aren't found
- Fixed Bug on Selfbot mentions introduced with the new Argument Prompts

### Removed
- Old Configuration System
Expand Down
6 changes: 3 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ exports.start = (config) => {
if (conf.prefix instanceof Array) {
conf.prefix.forEach((prefix) => {
if (msg.content.startsWith(prefix)) thisPrefix = prefix;
else thisPrefix = prefix[0];
});
} else if (msg.content.startsWith(conf.prefix)) {
} else {
thisPrefix = conf.prefix;
}
if (!thisPrefix) return;
if (client.config.prefixMention && !client.config.prefixMention.test(msg.content)) return;
if (msg.content.startsWith(thisPrefix) && client.config.prefixMention && !client.config.prefixMention.test(msg.content)) return;
let prefixLength = thisPrefix.length;
if (client.config.prefixMention && client.config.prefixMention.test(msg.content)) prefixLength = client.config.prefixMention.exec(msg.content)[0].length + 1;
const command = msg.content.slice(prefixLength).split(" ")[0].toLowerCase();
Expand Down