fixed an issue.

This commit is contained in:
2026-08-26 10:05:50 +08:00
parent 8d4d99f2e8
commit 00c64f449a
9 changed files with 25 additions and 24 deletions
+5
View File
@@ -0,0 +1,5 @@
NODE_ENV=production
DATABASE_URL=
DEV_GUILD=
DISCORD_TOKEN=
+1 -1
View File
@@ -11,7 +11,7 @@
}, },
"scripts": { "scripts": {
"start": "node dist/index.js", "start": "NODE_ENV=production node dist/index.js",
"build": "esbuild 'src/**/*.ts' --platform=node --format=cjs --outdir=dist" "build": "esbuild 'src/**/*.ts' --platform=node --format=cjs --outdir=dist"
} }
} }
-6
View File
@@ -1,6 +0,0 @@
{
"identifiers": {
"emojiId": "448912932340891670",
"targetId": "147433323503943680"
}
}
+6
View File
@@ -0,0 +1,6 @@
export default {
identifiers: {
emojiId: "448912932340891670",
targetId: "1363132678022631428"
}
}
+3 -8
View File
@@ -1,17 +1,12 @@
// Client.
import ready from "./client/ready";
// Message.
import messageReactionAdd from "./message/messageReactionAdd"; import messageReactionAdd from "./message/messageReactionAdd";
import messageReactionRemove from "./message/messageReactionRemove"; import messageReactionRemove from "./message/messageReactionRemove";
import ready from "./client/ready";
// ---------- // ----------
export default [ export default [
// Client. // Client.
ready,
// Message.
messageReactionAdd, messageReactionAdd,
messageReactionRemove messageReactionRemove,
ready,
]; ];
+2 -2
View File
@@ -1,5 +1,5 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime"; import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import config from '../../config.json'; import config from '../../config';
// ---------- // ----------
@@ -10,7 +10,7 @@ class MessageReactionAddEvent extends Event<CommandClient> {
const msg = await context.getMessage(message.channel.id, message.id); const msg = await context.getMessage(message.channel.id, message.id);
if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return; if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return;
console.log(`[MESSAGE_REACTION_ADD] - Points: ${member.username} (ID: ${member.id})`); console.log(`[MESSAGE_REACTION_ADD] - ID: ${member.id}`);
} }
} }
+3 -3
View File
@@ -1,16 +1,16 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime"; import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import config from '../../config.json'; import config from '../../config';
// ---------- // ----------
class MessageReactionRemoveEvent extends Event<CommandClient> { class MessageReactionRemoveEvent extends Event<CommandClient> {
event: string = 'messageReactionRemove' as const; event: string = 'messageReactionRemove' as const;
async handle(context: CommandClient<any, any>, message: Message, emoji: Constants.APIEmoji, member: Member) { async handle(context: CommandClient<any, any>, message: { id: string, channel: { id: string }}, emoji: Constants.APIEmoji, user: string) {
const msg = await context.getMessage(message.channel.id, message.id); const msg = await context.getMessage(message.channel.id, message.id);
if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return; if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return;
console.log(`[MESSAGE_REACTION_REMOVE] - Points: ${member.username} (ID: ${member.id})`); console.log(`[MESSAGE_REACTION_REMOVE] - ID: ${user}`);
} }
} }
+5 -3
View File
@@ -1,3 +1,5 @@
import 'dotenv/config';
import { CommandClient, Constants, Guild, Member, Message, NullCollection, User } from 'athena-prime'; import { CommandClient, Constants, Guild, Member, Message, NullCollection, User } from 'athena-prime';
import events from './events'; import events from './events';
@@ -11,7 +13,7 @@ const client: CommandClient = new CommandClient({
Constants.GatewayIntentBits.Guilds, Constants.GatewayIntentBits.Guilds,
Constants.GatewayIntentBits.GuildMembers, Constants.GatewayIntentBits.GuildMembers,
Constants.GatewayIntentBits.GuildMessages, Constants.GatewayIntentBits.GuildMessages,
Constants.GatewayIntentBits.MessageContent Constants.GatewayIntentBits.GuildMessageReactions
], ],
largeBotOptimizations: true, largeBotOptimizations: true,
@@ -21,8 +23,8 @@ const client: CommandClient = new CommandClient({
members: () => new NullCollection(Member), members: () => new NullCollection(Member),
messages: () => new NullCollection(Message), messages: () => new NullCollection(Message),
guilds: () => new NullCollection(Guild) guilds: () => new NullCollection(Guild)
} },
} },
}); });
events.forEach(event => client.registerEvent(event)); events.forEach(event => client.registerEvent(event));
-1
View File
@@ -4,7 +4,6 @@ declare global {
namespace NodeJS { namespace NodeJS {
interface ProcessEnv { interface ProcessEnv {
DATABASE_URL: string; DATABASE_URL: string;
DEV_GUILD: string;
DISCORD_TOKEN: string; DISCORD_TOKEN: string;
} }
} }