functioning start

This commit is contained in:
2025-10-21 22:40:42 -04:00
commit 480de70b39
6 changed files with 1726 additions and 0 deletions

37
index.js Normal file
View File

@@ -0,0 +1,37 @@
const config = require('./config.json');
// the basic discord setup stuff yoinked from their guide
const { Client, Events, GatewayIntentBits, Partials } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.MessageContent
],
partials: [
Partials.Channel,
Partials.Message
]
});
client.once(Events.ClientReady, readyClient => {
console.log(`Discord: Connected as ${readyClient.user.tag}`);
});
client.login(config.token);
client.on(Events.MessageCreate, message => {
// if we smell a twitter link, girlcock it!
const regexProfile = /https?:\/\/x\.com\/(.*?)\/status\/(\d+)/;
if (message.content.match(regexProfile)) {
const original = message.content.match(regexProfile)[0]
const profile = message.content.match(regexProfile)[1]
const stub = message.content.match(regexProfile)[2]
console.log(`Chat: Detected ${original}, girlcocking it!`);
const cocklink = `https://girlcockx.com/${profile}/status/${stub}`
console.log(`Girlcock: Converted to ${cocklink}`)
message.channel.send(cocklink)
message.suppressEmbeds().catch(err => // this bit is ai generated because i am lazy
console.error(err.stack?.split('\n')[0] || err.message || String(err).split('\n')[0])
)
}
});