-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22fd601
commit 1a5d649
Showing
4 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* OwO Bot for Discord | ||
* Copyright (C) 2024 Christopher Thai | ||
* This software is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International | ||
* For more information, see README.md and LICENSE | ||
*/ | ||
|
||
const CommandInterface = require('../../CommandInterface.js'); | ||
|
||
module.exports = new CommandInterface({ | ||
alias: ['refreshanimals', 'ra'], | ||
|
||
owner: true, | ||
|
||
execute: function (p) { | ||
let animalName; | ||
if (p.args[0]) { | ||
animalName = p.args[0]; | ||
} | ||
p.send('Refreshing all animals'); | ||
p.pubsub.publish('refreshAnimals', { animalName }); | ||
}, | ||
}); |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* OwO Bot for Discord | ||
* Copyright (C) 2024 Christopher Thai | ||
* This software is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International | ||
* For more information, see README.md and LICENSE | ||
*/ | ||
|
||
exports.handle = async function (main, message) { | ||
const { animalName } = JSON.parse(message); | ||
await main.animalUtil.reinitialize(animalName); | ||
if (animalName) { | ||
console.log(`Succesfully reinitialized animal: ${animalName}`); | ||
} else { | ||
console.log('Succesfully reinitialized animals'); | ||
} | ||
}; |