Skip to content

Commit

Permalink
Edited the checkGiveaway function
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezzud authored Sep 22, 2021
1 parent aee36ab commit b01212a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GiveawaysManager extends EventEmitter {
if (!giveaway.options.langfile) {
giveaway.options.langfile = require(`../lang/${giveaway.lang}.json`);
}
if(giveaway.options.shardID !== this.client.shard.ids[0]) return;
if(!this.client.guilds.cache.get(giveaway.guildID)) return;
await this._markAsEnded(giveaway.messageID);
var requirements = "";
if (giveaway.options.IsRequiredRole === true) {
Expand Down Expand Up @@ -265,7 +265,7 @@ class GiveawaysManager extends EventEmitter {
if (!giveaway.ended) {
return reject(`GiveawayNotEnded`);
}
if(giveaway.options.shardID !== this.client.shard.ids[0]) return;
if(!this.client.guilds.cache.get(giveaway.guildID)) return;
if (!giveaway.channel) {
return reject(`GiveawayUnknownChannel`);
}
Expand Down Expand Up @@ -304,7 +304,7 @@ class GiveawaysManager extends EventEmitter {
if (giveaway.ended) {
return reject(`GiveawayAlreadyEnded`);
}
if(giveaway.options.shardID !== this.client.shard.ids[0]) return;
if(!this.client.guilds.cache.get(giveaway.guildID)) return;
if (!giveaway.channel) {
return reject(`GiveawayUnknownChannel`);
}
Expand Down Expand Up @@ -438,7 +438,7 @@ class GiveawaysManager extends EventEmitter {
if(giveaway.options.shardID === undefined) {
giveawayData.shardID = 0
}
if(giveawayData.shardID !== this.client.shard.ids[0]) return;
if(!this.client.guilds.cache.get(giveaway.guildID)) return;
await this.giveaways.push(giveawayData);
await db.set("giveaways", this.giveaways);
await this._checkGiveaway()
Expand Down

0 comments on commit b01212a

Please sign in to comment.