Converted main codebase to typescript
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
module.exports = {
|
||||
name: "conolelog",
|
||||
description: "console log",
|
||||
type: "event",
|
||||
event: "ready",
|
||||
|
||||
/** @param { import('discord.js').Client } client */
|
||||
execute(client) {
|
||||
console.log("Logged in as " + client.user.tag + "!")
|
||||
}
|
||||
}
|
||||
15
src/events/server/ready/consolelog.ts
Normal file
15
src/events/server/ready/consolelog.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Event } from "../../../interfaces"
|
||||
import { ExtendedClient as Client } from "../../../utils/Client"
|
||||
|
||||
const event: Event = {
|
||||
name: "conolelog",
|
||||
description: "console log",
|
||||
type: "event",
|
||||
event: "ready",
|
||||
|
||||
execute(client: Client) {
|
||||
console.log("Logged in as " + client.user!.tag + "!")
|
||||
}
|
||||
}
|
||||
|
||||
export = event
|
||||
@@ -1,12 +1,15 @@
|
||||
const { onlineLogChannel, color } = require("../../../../config/options.json")
|
||||
import { onlineLogChannel, color } from "../../../../config/options.json"
|
||||
import { Event } from "../../../interfaces"
|
||||
import { ExtendedClient as Client } from "../../../utils/Client"
|
||||
import { ChannelType } from "discord.js"
|
||||
|
||||
module.exports = {
|
||||
const event: Event = {
|
||||
name: "sendonlinemessage",
|
||||
description: "send an online message",
|
||||
type: "event",
|
||||
event: "ready",
|
||||
|
||||
execute(client) {
|
||||
execute(client: Client) {
|
||||
if (process.env.NODE_ENV === "dev") return
|
||||
|
||||
const channel = client.channels.cache.get(onlineLogChannel)
|
||||
@@ -17,6 +20,11 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
|
||||
if (channel.type !== ChannelType.GuildText) {
|
||||
console.log("[ERROR] Online message channel is not a text channel.")
|
||||
return
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
description: "Bot is online!",
|
||||
@@ -25,3 +33,5 @@ module.exports = {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export = event
|
||||
@@ -1,14 +1,14 @@
|
||||
const statuses = require("../../../../config/statuses.json")
|
||||
import statuses = require("../../../../config/statuses.json")
|
||||
import { Event } from "../../../interfaces"
|
||||
import { ExtendedClient as Client } from "../../../utils/Client"
|
||||
|
||||
module.exports = {
|
||||
const event: Event = {
|
||||
name: "status",
|
||||
description: "Sets the status of the bot",
|
||||
type: "event",
|
||||
event: "ready",
|
||||
|
||||
/** @param { import('discord.js').Client } client */
|
||||
|
||||
execute(client) {
|
||||
execute(client: Client) {
|
||||
|
||||
// Playing 0
|
||||
// Streaming 1
|
||||
@@ -17,18 +17,22 @@ module.exports = {
|
||||
// Custom 4
|
||||
// Competing 5
|
||||
|
||||
client.user.setActivity(
|
||||
const user = client.user!
|
||||
|
||||
user.setActivity(
|
||||
{ name: statuses[0].name, type: statuses[0].type }
|
||||
)
|
||||
|
||||
let i = 1
|
||||
setInterval(() =>
|
||||
client.user.setActivity(
|
||||
statuses[i, i++ % statuses.length]
|
||||
user.setActivity(
|
||||
statuses[i++ % statuses.length]
|
||||
),
|
||||
1000 * 60 * 10
|
||||
)
|
||||
|
||||
client.user.setStatus("dnd")
|
||||
user.setStatus("dnd")
|
||||
}
|
||||
}
|
||||
|
||||
export = event
|
||||
Reference in New Issue
Block a user