Denim-Bot/src/modules/onReady.ts
Histmy feec9bd6ab Better type defs for OutputRunFunkce and Modul
& added type for module exports
& removed unnecessary function parameters in modules
2021-10-28 20:40:26 +02:00

19 lines
661 B
TypeScript

// Až se bot načte tak to napíše do konzole a jestli pošel, tak to oznámí adminům
import { Client } from "discord.js";
import { Modul } from "../utils/types";
const exp: Modul = {
on_ready: async () => {
console.log("A jedeš!");
if (process.argv.length < 3) return;
const client: Client = module.exports.client;
const admin = client.users.cache.get(process.env.adminID ?? "");
if (admin) (await admin.createDM()).send("pošel jsem ty magore");
const channel = client.channels.cache.get(process.env.adminChannel ?? "");
if (channel && channel.isText()) channel.send("pošel jsem magoří");
}
};
module.exports = exp;