Skip to content

Commit

Permalink
fixed circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherBThai committed Jul 21, 2024
1 parent 1a5d649 commit e09f330
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/owo.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ class OwO extends Base {

this.animalUtil = require('./utils/animalInfoUtil.js');

this.rewardUtil = require('./utils/rewardUtil.js');

this.event = require('./utils/eventUtil.js');
this.event.init(this);

// Message sender helper methods
this.sender = require('./utils/sender.js');
Expand Down
6 changes: 5 additions & 1 deletion src/utils/eventUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
const events = require('../data/event.json');
//const itemUtil = require('../commands/commandList/shop/util/itemUtil.js');
const rewardUtil = require('./rewardUtil.js');
let rewardUtil;
const eventMax = 10;
const itemToEvents = {};
for (const key in events) {
Expand Down Expand Up @@ -249,3 +249,7 @@ async function getEventRewards(user, con, event, override) {
rewardSql: result.sql,
};
}

exports.init = async function (main) {
rewardUtil = main.rewardUtil;
};

0 comments on commit e09f330

Please sign in to comment.