Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2aea03e
Remove dotenv-vault files
pfist Jun 6, 2025
c21b695
Update .gitignore
pfist Jun 6, 2025
3b281c4
Upgrade dependencies
pfist Jun 6, 2025
fae423d
Update package description
pfist Jun 6, 2025
e053441
Use Bun in GitHub Actions
pfist Jun 6, 2025
62d2d55
Remove obsolete 'claim' command
pfist Jun 6, 2025
590e581
Remove importJson utility
pfist Jun 6, 2025
dc7bf9c
hiei v2
pfist Jun 7, 2025
d6ef49f
Modify logger for Fastify v5 compatibility
pfist Jun 7, 2025
4af97dd
Move old commands and event listeners
pfist Jun 7, 2025
99123b8
v2 command: bot-ping
pfist Jun 7, 2025
aae0366
v2 event: client-ready
pfist Jun 7, 2025
c1250fd
Remove old modules
pfist Jun 7, 2025
03c5e4f
v2 command: bot-version
pfist Jun 7, 2025
2f6d34a
v2 command: bot-uptime
pfist Jun 7, 2025
b53b39b
v2 command: server-limits
pfist Jun 7, 2025
b00c459
Tweak code format for message component builders
pfist Jun 7, 2025
5b2b461
v2 command: bot-info
pfist Jun 19, 2025
2f39cc0
Upgrade to hiei.js 2.0.0 beta 2
pfist Jun 20, 2025
5475519
bot-info: Better formatting
pfist Jun 20, 2025
49a4a32
Remove server info commands
pfist Jun 20, 2025
df75823
v2 command: coin-toss
pfist Jun 20, 2025
73a2c3c
Remove old coin-toss command
pfist Jun 20, 2025
bb30092
v2 command: game-idea
pfist Jun 20, 2025
e37aab8
Upgrade dependencies
pfist Jul 2, 2025
5e2ba21
v2 command: magic-8-ball
pfist Jul 2, 2025
7479ccd
Remove old 8-ball command
pfist Jul 2, 2025
40f46da
v2 command: roll-dice
pfist Jul 2, 2025
ea68325
Minor formatting changes
pfist Jul 2, 2025
0206373
v2 command: server-invite
pfist Jul 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .env.vault

This file was deleted.

26 changes: 13 additions & 13 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ name: Lint code with Standard

on:
push:
branches:
- main
branches: [main]
pull_request:
branches:
- main
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
- name: Run Standard
uses: actions/setup-node@v3
with:
node-version: '16'
- run: |
npm ci
npm run lint
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Run linter
run: bun lint
133 changes: 31 additions & 102 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,112 +1,41 @@
# Logs
logs
*.log
# Node modules and dependencies
node_modules/
bower_components/
jspm_packages/
web_modules/

# Build output
dist/
build/
out/
.next/
.nuxt/
.vuepress/dist
.docusaurus

# Caches and logs
.cache/
.parcel-cache/
.pnpm-debug.log*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
logs/
*.log

# Coverage directory used by tools like istanbul
coverage
# Coverage and test output
coverage/
.nyc_output/
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Environment files
.env*
.env

# TypeScript cache
# Miscellaneous
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.stylelintcache
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Scratch file
scratch.md

.env*
.flaskenv*
!.env.project
!.env.vault
.vscode-test
.pnp.*
2,047 changes: 2,047 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
{
"name": "manny",
"version": "3.3.0",
"description": "Everyone's favorite mannequin",
"version": "4.0.0",
"description": "Everyone's favorite mannequin. Made to serve Unreal Source.",
"type": "module",
"main": "src/manny.js",
"engines": {
"node": ">=16.9.0"
},
"scripts": {
"dev": "node -r dotenv/config src/manny.js",
"dev": "bun src/manny.js",
"proxy": "ngrok http 3000",
"lint": "standard | snazzy",
"start": "node src/manny.js"
"start": "bun src/manny.js"
},
"dependencies": {
"@axiomhq/pino": "^0.1.3",
"@fastify/cors": "^9.0.1",
"@fastify/helmet": "^11.1.1",
"@fastify/rate-limit": "^9.1.0",
"@prisma/client": "^5.11.0",
"@sentry/node": "^7.99.0",
"discord.js": "^14.14.1",
"dotenv": "^16.4.5",
"fastify": "^4.26.2",
"hiei.js": "^1.1.0",
"html-to-md": "^0.8.5",
"@axiomhq/pino": "^1.3.1",
"@fastify/cors": "^11.0.1",
"@fastify/helmet": "^13.0.1",
"@fastify/rate-limit": "^10.3.0",
"@prisma/client": "^6.11.0",
"@sentry/node": "^9.27.0",
"discord.js": "^14.21.0",
"fastify": "^5.4.0",
"hiei.js": "^2.0.0-beta.2",
"html-to-md": "^0.8.8",
"js-yaml": "^4.1.0",
"ms": "^2.1.3",
"pino": "^8.19.0"
"pino": "^9.7.0"
},
"devDependencies": {
"ngrok": "^5.0.0-beta.2",
"pino-pretty": "^10.3.1",
"prisma": "^5.11.0",
"pino-pretty": "^13.0.0",
"prisma": "^6.11.0",
"snazzy": "^9.0.0",
"standard": "^17.1.0"
"standard": "^17.1.2"
}
}
74 changes: 74 additions & 0 deletions src/commands/cmd.bot-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import metadata from '../../package.json'
import { dedent } from '../utilities/string-util.js'
import {
ActionRowBuilder,
ContainerBuilder,
MessageFlags,
PermissionFlagsBits,
SectionBuilder,
SeparatorBuilder,
TextDisplayBuilder,
ThumbnailBuilder
} from 'discord.js'

export default {
interaction: 'slash',
name: 'about',
description: 'Learn more about Manny',
defaultMemberPermissions: PermissionFlagsBits.SendMessages,
async execute ({ interaction, client, components }) {
await client.application.fetch()
const name = client.application.name
const description = client.application.description
const version = metadata.version
const sourceCodeButton = components.get('button:view-source-code')
const issuesButton = components.get('button:report-issue')
const patronageButton = components.get('button:become-patron')

return interaction.reply({
components: [
new ContainerBuilder()
.addSectionComponents(
new SectionBuilder()
.setThumbnailAccessory(
new ThumbnailBuilder()
.setURL(client.user.displayAvatarURL())
)
.addTextDisplayComponents(
new TextDisplayBuilder()
.setContent(dedent`
# ${name} ${version}
${description}
### Features
- Allows members to stream in voice chat
- Manages the job board
- Answers frequently-asked questions
- Provides information about the server
- Generates random game ideas`)
)
)
.addSeparatorComponents(
new SeparatorBuilder()
.setSpacing('Small')
.setDivider(false)
)
.addTextDisplayComponents(
new TextDisplayBuilder()
.setContent(dedent`
### Credits
Created by pfist. Code contributed by Matt Boatswain and KaosSpectrum.`)
)
.addSeparatorComponents(
new SeparatorBuilder()
.setSpacing('Large')
.setDivider(true)
)
.addActionRowComponents(
new ActionRowBuilder()
.addComponents(sourceCodeButton.data, issuesButton.data, patronageButton.data)
)
],
flags: [MessageFlags.Ephemeral, MessageFlags.IsComponentsV2]
})
}
}
21 changes: 21 additions & 0 deletions src/commands/cmd.bot-ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MessageFlags, PermissionFlagsBits } from 'discord.js'

export default {
interaction: 'slash',
name: 'ping',
description: 'Check Manny\'s latency.',
defaultMemberPermissions: PermissionFlagsBits.BanMembers,
async execute ({ interaction, client }) {
const response = await interaction.reply({
content: ':ping_pong: Ping...',
flags: MessageFlags.Ephemeral,
withResponse: true
})

const heartbeat = client.ws.ping
const heartbeatDisplay = client.ws.ping === -1 ? 'Pending...' : `${heartbeat}ms`
const latency = response.resource.message.createdTimestamp - interaction.createdTimestamp

return interaction.editReply({ content: `:ping_pong: Ping... Pong!\nManny → Discord server: \`${latency}ms\`\nDiscord API → Manny: \`${heartbeatDisplay}\`.` })
}
}
13 changes: 13 additions & 0 deletions src/commands/cmd.bot-uptime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MessageFlags, PermissionFlagsBits } from 'discord.js'
import ms from 'ms'

export default {
interaction: 'slash',
name: 'uptime',
description: 'Check how long Manny has been online.',
defaultMemberPermissions: PermissionFlagsBits.ManageGuild,
async execute ({ interaction, client }) {
const uptime = ms(client.uptime, { long: true })
return interaction.reply({ content: `:stopwatch: I have been online for \`${uptime}\``, flags: MessageFlags.Ephemeral })
}
}
12 changes: 12 additions & 0 deletions src/commands/cmd.bot-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { MessageFlags, PermissionFlagsBits } from 'discord.js'
import metadata from '../../package.json'

export default {
interaction: 'slash',
name: 'version',
description: 'Check which version of Manny is currently running.',
defaultMemberPermissions: PermissionFlagsBits.ManageGuild,
async execute ({ interaction }) {
return interaction.reply({ content: `Currently running version \`${metadata.version}\``, flags: MessageFlags.Ephemeral })
}
}
Loading