im trying to create an unmute task but it doesnt seems to get triggered that reliably
I also tried copy pasting the documentation code for manual and it also gets triggered rarely
here are some snippets of my code
UnmuteUserTask.ts
And i call it in a Class i have named Modlog
Modlog.ts
export class Modlog {
// code
public async createMute(data: MuteCreateInput) {
const mute = await container.db.mute.create({
data: {
expiresAt: data.expiresAt,
memberId: this.memberId,
removedRoles: data.removedRoles ? data.removedRoles : [],
modlog: {
create: await this.createModlog()
}
}
});
if (data.expiresAt) {
const offset = data.expiresAt.getTime() - Date.now();
console.log(offset);
container.tasks.create('UnmuteMemberTask', { muteId: mute.id }, offset);
}
await this.sendModlog(mute.modlogId);
return this;
}
// code
}
and this class is called in the mute command
Here my are versions
"@sapphire/plugin-scheduled-tasks": "^8.0.0"
"@sapphire/framework": "^4.5.1"