mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
21 lines
559 B
TypeScript
21 lines
559 B
TypeScript
import { GatewayIntents, Session } from "./deps.ts";
|
|
|
|
if (!Deno.args[0]) {
|
|
throw new Error("Please provide a token");
|
|
}
|
|
|
|
const intents = GatewayIntents.MessageContent | GatewayIntents.Guilds | GatewayIntents.GuildMessages;
|
|
const session = new Session({ token: Deno.args[0], intents });
|
|
|
|
session.on("ready", (_shardId, payload) => {
|
|
console.log("Logged in as:", payload.user.username);
|
|
});
|
|
|
|
session.on("messageCreate", (message) => {
|
|
if (message.content === "!ping") {
|
|
message.reply({ content: "pong!" });
|
|
}
|
|
});
|
|
|
|
await session.start();
|