mirror of
https://github.com/nx-bat/pet-the-pond.git
synced 2026-09-22 10:29:11 -04:00
(init): Initial files. Features not implemented.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"identifiers": {
|
||||
"emojiId": "448912932340891670",
|
||||
"targetId": "147433323503943680"
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
@@ -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
|
||||
];
|
||||
@@ -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');
|
||||
@@ -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();
|
||||
Vendored
+13
@@ -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 {};
|
||||
@@ -0,0 +1,7 @@
|
||||
import postgres from "postgres";
|
||||
|
||||
// ----------
|
||||
|
||||
const client = postgres(process.env.DATABASE_URL);
|
||||
|
||||
export default {};
|
||||
@@ -0,0 +1 @@
|
||||
export * from './database';
|
||||
Reference in New Issue
Block a user