Skip to content

Commit

Permalink
=)
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Feb 17, 2024
1 parent e56a56e commit 5401221
Showing 1 changed file with 57 additions and 58 deletions.
115 changes: 57 additions & 58 deletions src/discord/events/messageCreate.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
// import {
// ChannelType,
// } from 'discord-api-types/v10';
Expand Down Expand Up @@ -55,72 +56,70 @@ async function getCategory(channel:TextChannel):Promise<experience_category> {
export const messageCreate: MessageCreateEvent = {
name: 'messageCreate',
async execute(message) {
messageCommand(message);
bridgeMessage(message);
// messageCommand(message);
// bridgeMessage(message);
// awayMessage(message);
// Only run on Tripsit or DM, we don't want to snoop on other guilds ( ͡~ ͜ʖ ͡°)
if (message.guild && message.guild.id !== env.DISCORD_GUILD_ID) {
return;
}

return;

const userData = await db.users.upsert({
where: {
discord_id: message.author.id,
},
create: {
discord_id: message.author.id,
},
update: {},
});

if (userData && userData.discord_bot_ban) {
return;
}

// log.debug(F, `Message: ${JSON.stringify(message, null, 2)}`);

// This needs to run here because the widget bot peeps will use this and they are "bot users"
// This handles ~ commands

// Don't run on bots
if (message.author.bot) return;
countMessage(message);
youAre(message);
karma(message);
imagesOnly(message);
discordAiModerate(message);

// Disabled for testing
// thoughtPolice(message);
// if (message.guild && message.guild.id !== env.DISCORD_GUILD_ID) {
// return;
// }

// // If this is a DM, run the modmail function.
// if (message.channel.type === ChannelType.DM) {
// await modmailDMInteraction(message);
// const userData = await db.users.upsert({
// where: {
// discord_id: message.author.id,
// },
// create: {
// discord_id: message.author.id,
// },
// update: {},
// });

// if (userData && userData.discord_bot_ban) {
// return;
// }

// Determine if the bot should give exp
if (
message.member // Is not a member of a guild
&& message.channel // Was not sent in a channel
&& (message.channel instanceof TextChannel) // Was not sent in a text channel
&& message.guild // Was not sent in a guild
&& !ignoredRoles.some(role => message.member?.roles.cache.has(role)) // Has a role that should be ignored
) {
// Determine what kind of experience to give
const experienceCategory = await getCategory(message.channel);
// Run this now, so that when you're helping in the tech/tripsit rooms you'll always get exp
experience(message.member, experienceCategory, 'TEXT' as experience_type, message.channel);
}
// // log.debug(F, `Message: ${JSON.stringify(message, null, 2)}`);

// // This needs to run here because the widget bot peeps will use this and they are "bot users"
// // This handles ~ commands

// // Don't run on bots
// if (message.author.bot) return;
// countMessage(message);
// youAre(message);
// karma(message);
// imagesOnly(message);
// discordAiModerate(message);

// // Disabled for testing
// // thoughtPolice(message);

// // // If this is a DM, run the modmail function.
// // if (message.channel.type === ChannelType.DM) {
// // await modmailDMInteraction(message);
// // }

// // Determine if the bot should give exp
// if (
// message.member // Is not a member of a guild
// && message.channel // Was not sent in a channel
// && (message.channel instanceof TextChannel) // Was not sent in a text channel
// && message.guild // Was not sent in a guild
// && !ignoredRoles.some(role => message.member?.roles.cache.has(role)) // Has a role that should be ignored
// ) {
// // Determine what kind of experience to give
// const experienceCategory = await getCategory(message.channel);
// // Run this now, so that when you're helping in the tech/tripsit rooms you'll always get exp
// experience(message.member, experienceCategory, 'TEXT' as experience_type, message.channel);
// }

// Check if the message came in a thread in the helpdesk channel
// // Check if the message came in a thread in the helpdesk channel

// if (message.channel.isThread()) {
// modmailThreadInteraction(message);
// }
// // if (message.channel.isThread()) {
// // modmailThreadInteraction(message);
// // }

announcements(message);
// announcements(message);
},
};

Expand Down

0 comments on commit 5401221

Please sign in to comment.