Skip to content

Commit

Permalink
fixed cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed Nov 8, 2024
1 parent 96ce116 commit 7288000
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
19 changes: 19 additions & 0 deletions src/listeners/cron.ready.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// system file, please don't modify it

import * as app from "#app"
import logger from "#logger"

/**
* See the {@link https://ghom.gitbook.io/bot.ts/usage/create-a-listener listener guide} for more information.
*/
export default new app.Listener({
event: "ready",
description: "Launch all cron jobs",
async run() {
for (const cron of app.cronList.values()) {
cron.start()
}

logger.success("All cron jobs launched")
},
})
2 changes: 1 addition & 1 deletion src/listeners/traffic.guildMemberAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default new app.Listener({
if (config.member_role_id)
await member.roles
.add(config.member_role_id)
.catch((error) => app.error(error, __filename))
.catch((error) => app.error(error, __filename, true))

if (config.member_welcome_direct_message) {
try {
Expand Down
8 changes: 4 additions & 4 deletions src/namespaces/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type * as app from "#app"

import { code } from "#src/app/util.ts"

import { ResponseCache } from "#database"
import client from "#client"
import { ResponseCache } from "#database"
import env from "#env"

import users, { User } from "#tables/user.ts"
import guilds, { Guild } from "#tables/guild.ts"
import autoRole from "#tables/autoRole.ts"
import guilds, { Guild } from "#tables/guild.ts"
import users, { User } from "#tables/user.ts"

import { emote } from "./emotes.ts"

Expand Down Expand Up @@ -160,7 +160,7 @@ export async function applyAutoRoles(member: app.GuildMember) {

if (member.roles.cache.hasAll(...autoRoles) || autoRoles.length === 0) return

await member.roles.add(autoRoles).catch()
await member.roles.add(autoRoles)
}

/**
Expand Down

0 comments on commit 7288000

Please sign in to comment.