Skip to content

Commit

Permalink
Merge pull request #7 from NID-roid/feat/add-sasudai-command
Browse files Browse the repository at this point in the history
Add sasudaiReaction function to react to messages
  • Loading branch information
k-taro56 authored May 31, 2024
2 parents b977b72 + 4e4cf34 commit 0787de6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import { ChannelType, Client, Partials } from 'discord.js';
import { ChannelType, Client, type Message, Partials } from 'discord.js';
import dotenv from 'dotenv';

dotenv.config();

export const sasudaiReaction = (message: Message) => {
message.react('1223834970863177769');
message.react('🔥');
};

const client = new Client({
intents: ['DirectMessages', 'Guilds', 'GuildMessages'],
partials: [Partials.Channel],
});

client.on('messageCreate', async (message) => {
if (message.channel.type === ChannelType.DM) {
if (message.content === '!sasudai') {
message.reply('https://x.com/STECH_FES/status/1773995315420631265');
sasudaiReaction(message);
} else if (message.channel.type === ChannelType.DM) {
// biome-ignore lint:noNonNullAssertion - We know this is defined
await fetch(process.env.AUDIT_LOG_WEBHOOK!, {
method: 'POST',
Expand Down

0 comments on commit 0787de6

Please sign in to comment.