mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
23 lines
625 B
JavaScript
23 lines
625 B
JavaScript
import { GatewayIntents, Session } from "./deps.ts";
|
|
|
|
const token = "lol";
|
|
const intents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMessages;
|
|
const session = new Session({ token, intents });
|
|
|
|
// uncomment to debug stuff
|
|
// session.on("debug", (any) => {
|
|
// console.debug(any);
|
|
// })
|
|
|
|
session.on("ready", (payload) => {
|
|
console.log("Logged in as:", payload.user.username);
|
|
});
|
|
|
|
session.on("messageCreate", (message) => {
|
|
if (message.content.startsWith("ping")) {
|
|
message.reply({ content: "pong!" }).catch((err) => console.error(err));
|
|
}
|
|
});
|
|
|
|
await session.start();
|