diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..204bd2e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.git +config.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bbc6163..e9373c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:latest +FROM node:25 RUN mkdir -p /usr/scr/bot WORKDIR /usr/src/bot COPY . /usr/src/bot diff --git a/config.json.default b/config.json.default new file mode 100644 index 0000000..5fd00f0 --- /dev/null +++ b/config.json.default @@ -0,0 +1,8 @@ +{ + "token": "bot token go here", + "status": "looking for x.com links", + "parentsAndOrGuardians": [ + "230659159450845195", + "297983197990354944" + ] +} \ No newline at end of file diff --git a/index.js b/index.js index 7cfc10d..de85068 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ -const token = process.env.DISCORD_TOKEN - +const config = require('./config.json'); // the basic discord setup stuff yoinked from their guide const { Client, Events, GatewayIntentBits, Partials, ActivityType, MessageFlags } = require('discord.js'); const client = new Client({ @@ -15,14 +14,13 @@ const client = new Client({ Partials.Message, Partials.Reaction, Partials.User - ] + ] }); client.once(Events.ClientReady, readyClient => { - console.log(`Discord: Connected as ${readyClient.user.tag}`); - client.user.setActivity('for x.com links', { type: ActivityType.Watching }); + console.log(`Discord: Connected as ${readyClient.user.tag}`); + client.user.setActivity(config.status, { type: ActivityType.Custom }); }); -client.login(token); - +client.login(config.token); client.on(Events.MessageCreate, message => { // if we smell a twitter link, girlcock it! @@ -41,9 +39,8 @@ client.on(Events.MessageCreate, message => { ) } - // hehe an eval :3 yeah im hardcoding myself - const peopleWhoCanFunnyEval = ['230659159450845195', '297983197990354944'] - if (message.content.startsWith('!eval') && peopleWhoCanFunnyEval.includes(message.author.id)) { + // hehe an eval :3 + if (message.content.startsWith('!eval') && config.parentsAndOrGuardians.includes(message.author.id)) { let code = message.content.substring('!eval'.length).trim(); // yeah a machine may have wrote this part @@ -60,6 +57,12 @@ client.on(Events.MessageCreate, message => { console.error(err); } } + // hehe we do a little if stacking + if (message.content.startsWith('!status') && config.parentsAndOrGuardians.includes(message.author.id)) { + let status = message.content.substring('!status'.length).trim(); + client.user.setActivity(status, { type: ActivityType.Custom }); + config.status = status; + } // wouldnt it be funny to react to 1 in like 10000 messages with emoji from a list if (Math.random() < 0.0001 && !message.author.bot) {