Skip to content

Commit

Permalink
bot.status will prevent startup if wrong method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leref committed Sep 27, 2023
1 parent c35ccec commit d0c9ed4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/handler/status.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
const createCustomBoxedMessage = require('../utils/CustomBox.js');

let recommendationLogged = false;

module.exports = async (statuses, client) => {
if (statuses.size !== 0) {
let y = 0;
Expand Down Expand Up @@ -35,16 +31,7 @@ module.exports = async (statuses, client) => {
stats.activity.name = status[y].activity.name;
}
} else {
if (!recommendationLogged) {
const recommendationMessage = `Use the name method or provide a name for status[${y}]`;
createCustomBoxedMessage([{ text: recommendationMessage, textColor: 'red' }], 'white', {
text: 'AoiWarning',
textColor: 'yellow',
})
recommendationLogged = true;
}

stats.activity.name = "Using aoi.js";
throw new TypeError(`Use the name method or provide a name for status[${y}]`);
}

client.user.setPresence({
Expand Down

0 comments on commit d0c9ed4

Please sign in to comment.