Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: twohoursonelife/junior
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.14.2
Choose a base ref
...
head repository: twohoursonelife/junior
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 17 commits
  • 21 files changed
  • 3 contributors

Commits on Dec 21, 2023

  1. Update dynamite to explosives in minitech command

    Thanks Freddy
    connorhsm committed Dec 21, 2023
    Copy the full SHA
    cca4cfd View commit details

Commits on Jan 4, 2024

  1. Update yum foods list.

    Up to date with version 20309
    TanyaPegasus committed Jan 4, 2024
    Copy the full SHA
    df405e3 View commit details

Commits on Jan 14, 2024

  1. Copy the full SHA
    44945b3 View commit details

Commits on Jan 21, 2024

  1. Update linking

    connorhsm committed Jan 21, 2024
    Copy the full SHA
    ef5b907 View commit details

Commits on Mar 14, 2024

  1. Copy the full SHA
    1007ce5 View commit details

Commits on Mar 15, 2024

  1. btw

    connorhsm committed Mar 15, 2024
    Copy the full SHA
    b042e75 View commit details
  2. well

    connorhsm committed Mar 15, 2024
    Copy the full SHA
    bbe4e7f View commit details

Commits on Oct 3, 2024

  1. Copy the full SHA
    72a596d View commit details
  2. Refresh release workflow

    connorhsm committed Oct 3, 2024
    Copy the full SHA
    f88efc0 View commit details

Commits on Oct 24, 2024

  1. Goodbye, btw

    connorhsm committed Oct 24, 2024
    Copy the full SHA
    8458a48 View commit details
  2. Node 20

    connorhsm committed Oct 24, 2024
    Copy the full SHA
    d772a75 View commit details
  3. Update birthday commands #35

    connorhsm committed Oct 24, 2024
    Copy the full SHA
    1b98bb0 View commit details
  4. Update README.md

    connorhsm committed Oct 24, 2024
    Copy the full SHA
    4f36897 View commit details
  5. loves a typo

    connorhsm committed Oct 24, 2024
    Copy the full SHA
    53d22ec View commit details

Commits on Oct 27, 2024

  1. Copy the full SHA
    dd1c79c View commit details
  2. Add Fly.io config

    connorhsm committed Oct 27, 2024
    Copy the full SHA
    4daad21 View commit details

Commits on Nov 28, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    90a3b6e View commit details
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,5 @@
deploy-commands.js
utils
node_modules
.nvmrc
*.env
18 changes: 18 additions & 0 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# # See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/

# name: Fly Deploy
# on:
# push:
# branches:
# - main
# jobs:
# deploy:
# name: Deploy app
# runs-on: ubuntu-latest
# concurrency: deploy-group # optional: ensure only one action runs at a time
# steps:
# - uses: actions/checkout@v4
# - uses: superfly/flyctl-actions/setup-flyctl@master
# - run: flyctl deploy --remote-only
# env:
# FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Publish Junior container
name: Release Junior

on:
release:
types:
- created
workflow_dispatch:

jobs:
publish-container:
@@ -38,30 +37,31 @@ jobs:
run: git describe --tags --abbrev=0 > version.txt

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
context: . # Intentionally using Path context to include version.txt
push: true
tags: ${{ steps.meta.outputs.tags }}, ghcr.io/twohoursonelife/junior:latest
labels: ${{ steps.meta.outputs.labels }}
#cache-from: type=gha
#cache-to: type=gha,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max

deploy-commands:
runs-on: ubuntu-latest
environment: prod-commands
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'
node-version: "20"

- name: Install dependencies
run: npm ci

- name: Deploy commands
run: node deploy-commands.js
env:
PROD_TOKEN: ${{ secrets.PROD_BOT_TOKEN }}
PROD_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.2
11 changes: 4 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM node:18-alpine
FROM oven/bun:alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile --production
COPY . .

CMD ["node", "junior.js"]
CMD ["bun", "run", "junior.js"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 2HOL
Copyright (c) 2021 Connor Smith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# junior
Non-C Junior: Automating the life's work of MVP community member Non Creative Guy. *Supplies helpful information and guides to players upon a phrase in the Discord, amongst other helpful things*

**Always check the Dockerfile for the current version of Node this project is developed against.**

### How to deploy and release a new version
### Deploy and release a new version
- Make desired changes/commits
- Create a new release via Github, naming the tag in the example format 1.0.0
- Create a new release via GitGub, naming the tag in the example format 1.0.0
- Github action Deploy will trigger, building the image, pushing it to GHCR and finally will redeploy it.
- Voila, bot is now updated in Discord. Check with /version

@@ -25,25 +23,20 @@ When **DEV_TOKEN** is set, **PROD_TOKEN** will not be checked to prevent deployi
- Dev Junior: 912705407850532904
- Dev 2HOL Discord: 678098930503909386

### Command cheat sheet

Build Docker container, leave pushing to the workflow for proper tagging
`docker build . --tag ghcr.io/twohoursonelife/junior`
### Dev command cheat sheet

Run latest dev image
`docker run --detach --env DEV_TOKEN=thetoken ghcr.io/twohoursonelife/junior`
- `bun run build`
- `bun run start`

Deploy commands
GUILDID and CLIENTID defaults to dev token if unset
```bash
export DEV/PROD_TOKEN=
export GUILDID=
export CLIENTID=
node deploy-commands.js
bun run commands
```

Update packages
`npm update`

Better way to update packages (Will tell you about any new versions, including major)
`npx npm-check-updates` provide `-u` for the program to update them itself
`bun update`
`bun npm-check-updates -u`
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion commands/birthday.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ module.exports = {
.setDescription('My Birthday!'),
async execute(interaction) {
return interaction.reply({
content: 'My birthday is September 18th! I am 2 years old! I\'d like to thank everyone who came to my party! Shoutout to <@313791022121615361> for winning the most points at my recent party!',
content: 'My birthday is September 18th! I am 3 years old! I\'d like to thank everyone who came to my party! Lemon (fajny33336) for winning the most points at my recent party!',
});
},
};
2 changes: 1 addition & 1 deletion commands/birthdaywinners.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ module.exports = {
.setDescription('Birthday winners'),
async execute(interaction) {
return interaction.reply({
content: 'These are the first place winners of my past birthday parties!\n\nhelenbrait\njohnnychaotic',
content: 'These are the first place winners of my past birthday parties!\n\n- 2022: helenbrait\n- 2023: johnnychaotic\n- 2024: fajny33336',
});
},
};
2 changes: 1 addition & 1 deletion commands/cool.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,6 @@ module.exports = {
.setName('cool')
.setDescription('How 2 b kool'),
async execute(interaction) {
return interaction.reply('How to be cool on the 2HOL Discord\n\n**1.** Join and immediately say “Wow this game is dead.”\n**2.** Ignore literally the 3 years of hard work from the devs only to focus on the fact that no one has sent a discord message in 2 hours and there\'s 5 people in game.\n**3.** Don\'t listen to the people defending the game and call them toxic.\n**4.** Accept help from no one in this game that revolves around people working together.\n**5.** Call the game a shameless rip off of OHOL, disregarding the premise of open source.\n**6.** Leave the server in anger at the \'toxic community\'.');
return interaction.reply('How to be cool on the 2HOL Discord\n\n**1.** Join and immediately say “Wow this game is dead.”\n**2.** Ignore literally the 6 years of hard work from the devs only to focus on the fact that no one has sent a discord message in 2 hours and there\'s 5 people in game.\n**3.** Don\'t listen to the people defending the game and call them toxic.\n**4.** Accept help from no one in this game that revolves around people working together.\n**5.** Call the game a shameless rip off of OHOL, disregarding the premise of open source.\n**6.** Leave the server in anger at the \'toxic community\'.');
},
};
2 changes: 1 addition & 1 deletion commands/difference.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion commands/minitech.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions commands/solo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { SlashCommandBuilder } = require('@discordjs/builders');

module.exports = {
data: new SlashCommandBuilder()
.setName('solo')
.setDescription('How to play 2HOL solo'),
async execute(interaction) {
return interaction.reply('How to play solo or as a single player\n\nUsing a spawn code is the easiest way to play alone. While you will be on the same map as other players, a spawn code allows you to find an isolated space to play. **Say \"no bb\"** in game each life to become infertile. If you decide you\'d like to have children later \"yes bb\" will make you fertile again.\n\nUse /spawncodes to find out more.\n\nIf you want a completely isolated experience you will need to [set up your own server](<https://github.com/risvh/miniOneLifeCompile>), this is a technically advanced process.');
},
};
2 changes: 1 addition & 1 deletion commands/yfg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
version: '3'
services:
junior:
image: ghcr.io/twohoursonelife/junior:latest
image: ghcr.io/twohoursonelife/junior
build:
context: .
restart: always
env_file:
- .env
logging:
driver: awslogs
options:
awslogs-region: "us-east-1"
awslogs-create-group: "true"
awslogs-group: "junior"
awslogs-stream: "junior"
13 changes: 0 additions & 13 deletions events/spawn-code.js

This file was deleted.

13 changes: 13 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
app = "junior"
primary_region = "iad"
swap_size_mb = 512

[build]
image = "ghcr.io/twohoursonelife/junior:latest"

[[restart]]
policy = "on-failure"

[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
2 changes: 1 addition & 1 deletion junior.js
Original file line number Diff line number Diff line change
@@ -39,4 +39,4 @@ client.on('interactionCreate', async interaction => {
}
});

client.login(process.env.DEV_TOKEN ? process.env.DEV_TOKEN : process.env.PROD_TOKEN);
client.login(process.env.DEV_TOKEN ? process.env.DEV_TOKEN : process.env.PROD_TOKEN);
Loading