(init): Initial files. Features not implemented.

This commit is contained in:
Nix Krystik
2026-08-26 00:02:04 +08:00
commit 8d4d99f2e8
17 changed files with 791 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"identifiers": {
"emojiId": "448912932340891670",
"targetId": "147433323503943680"
}
}
+14
View File
@@ -0,0 +1,14 @@
import { CommandClient, Event } from "athena-prime";
// ----------
class ReadyEvent extends Event<CommandClient> {
event: string = 'ready' as const;
async handle(context: CommandClient<any, any>) {
await context.deployCommands();
context.setCustomActivity("Petting the Pond!");
}
}
export default new ReadyEvent('ready');
+17
View File
@@ -0,0 +1,17 @@
// Client.
import ready from "./client/ready";
// Message.
import messageReactionAdd from "./message/messageReactionAdd";
import messageReactionRemove from "./message/messageReactionRemove";
// ----------
export default [
// Client.
ready,
// Message.
messageReactionAdd,
messageReactionRemove
];
+17
View File
@@ -0,0 +1,17 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import config from '../../config.json';
// ----------
class MessageReactionAddEvent extends Event<CommandClient> {
event: string = 'messageReactionAdd' as const;
async handle(context: CommandClient<any, any>, message: Message, emoji: Constants.APIEmoji, member: Member) {
const msg = await context.getMessage(message.channel.id, message.id);
if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return;
console.log(`[MESSAGE_REACTION_ADD] - Points: ${member.username} (ID: ${member.id})`);
}
}
export default new MessageReactionAddEvent('messageReactionAdd');
@@ -0,0 +1,17 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import config from '../../config.json';
// ----------
class MessageReactionRemoveEvent extends Event<CommandClient> {
event: string = 'messageReactionRemove' as const;
async handle(context: CommandClient<any, any>, message: Message, emoji: Constants.APIEmoji, member: Member) {
const msg = await context.getMessage(message.channel.id, message.id);
if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return;
console.log(`[MESSAGE_REACTION_REMOVE] - Points: ${member.username} (ID: ${member.id})`);
}
}
export default new MessageReactionRemoveEvent('messageReactionRemove');
+32
View File
@@ -0,0 +1,32 @@
import { CommandClient, Constants, Guild, Member, Message, NullCollection, User } from 'athena-prime';
import events from './events';
// ----------
const client: CommandClient = new CommandClient({
token: `Bot ${process.env.DISCORD_TOKEN}`,
options: {
intents: [
Constants.GatewayIntentBits.Guilds,
Constants.GatewayIntentBits.GuildMembers,
Constants.GatewayIntentBits.GuildMessages,
Constants.GatewayIntentBits.MessageContent
],
largeBotOptimizations: true,
cache: {
users: () => new NullCollection(User),
members: () => new NullCollection(Member),
messages: () => new NullCollection(Message),
guilds: () => new NullCollection(Guild)
}
}
});
events.forEach(event => client.registerEvent(event));
// ----------
client.connect();
+13
View File
@@ -0,0 +1,13 @@
// Used for typing purposes only.
// There's an expectation that the person setting up the bot isn't a complete idiot.
declare global {
namespace NodeJS {
interface ProcessEnv {
DATABASE_URL: string;
DEV_GUILD: string;
DISCORD_TOKEN: string;
}
}
}
export {};
+7
View File
@@ -0,0 +1,7 @@
import postgres from "postgres";
// ----------
const client = postgres(process.env.DATABASE_URL);
export default {};
+1
View File
@@ -0,0 +1 @@
export * from './database';