Skip to content

Commit

Permalink
feat: initial commit 🥳
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirasaki committed Jun 12, 2023
1 parent 53fa04d commit 5a70e0e
Show file tree
Hide file tree
Showing 71 changed files with 7,549 additions and 4,346 deletions.
5 changes: 4 additions & 1 deletion development.Dockerfile → .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM node:19-alpine
FROM node:19

# Create app/working/bot directory
RUN mkdir -p /app
WORKDIR /app

# Before installing ytdl mod, install ffmpeg
RUN apt-get update && apt-get install 'ffmpeg' -y

# Install app development dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
Expand Down
9 changes: 7 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# ------------------------- Required variables ------------------------- #
NODE_ENV=production
DISCORD_BOT_TOKEN=
CLIENT_ID=
TEST_SERVER_GUILD_ID=
DISCORD_CLIENT_ID=
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=

# -------------------------
# Everything else is optional - continue if you know what you're doing
# -------------------------

# ------------------------- Debug variables ------------------------- #
DEBUG_ENABLED=true
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
title: '[Feature] - '
labels: 'enhancement'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag discord-bot-template:$(date +%s)
run: docker build . --file Dockerfile --tag mirasaki-music-bot:$(date +%s)
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: mirasaki/discord-bot-template
images: mirasaki/mirasaki-music-bot

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ jobs:
- run: npm ci
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify-finish:
needs: release
runs-on: ubuntu-latest
steps:
- name: Discord Webhook - Notify Finish Release
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.GH_RELEASE_WEBHOOK_URL }}
content: "<@&975346074560634940>, a new version was just **released** - go check it out: [here](<${{ github.server_url }}/${{ github.repository }}/releases/latest>)"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ TODO.md

# In-development, Intellisense for events/listeners
typings.d.ts

# DB and db save
*.db
*.db~

TODO
17 changes: 0 additions & 17 deletions CHANGELOG.md

This file was deleted.

5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM node:19-alpine
FROM node:19

# Create app/working/bot directory
RUN mkdir -p /app
WORKDIR /app

# Before installing ytdl mod, install ffmpeg
RUN apt-get update && apt-get install 'ffmpeg' -y

# Install app production dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
Expand Down
440 changes: 265 additions & 175 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/showcase/thumbnail.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 72 additions & 14 deletions config.example.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,100 @@
/**
* @type {@type {module:Client~ClientConfiguration}}
*/

const { PermissionsBitField } = require('discord.js');

const config = {
// Array of Intents your bot needs
// https://discord.com/developers/docs/topics/gateway#gateway-intents
intents: [ 'Guilds' ],
// Note: all the default# properties all configurable by commands
// This is here so that you can configure everything in one go
// without having to figure out different commands,
// if you're not comfortable editing this, use the commands

// Note: default# properties only take affect the first time
// playback is initialized in your server/guild

// Between 0 and 100
// 100 is obnoxiously loud and will f*** your ears
defaultVolume: 5,

// The default repeat mode
// 0 - Off | Don't repeat
// 1 - Track | Repeat current track, always - until skipped
// 2 - Queue | Repeat the entire queue, finished songs get added back at the end of the current queue
// 3 - Autoplay | Autoplay recommended music when queue is empty
//
// 3 = 24/7 autoplay/continuous radio if uninterrupted - only use if you have
// bandwidth for days
defaultRepeatMode: 0,

// Amount of seconds to stay in the voice channel
// when playback is finished
// Default: 2 minutes
defaultLeaveOnEndCooldown: 120,

// When true, will create a thread when the voice session is first initialized
// and continue to send music/queue events in that thread instead of flooding
// the channel
defaultUseThreadSessions: true,

// When true, and defaultUseThreadSessions is true, will only allow commands involving
// the current session to be used in the created session Thread channel
defaultThreadSessionStrictCommandChannel: true,

// Plugins/Music source extractors
plugins: {
youtube: true,
fileAttachments: true,

appleMusic: true,
vimeo: true,
reverbNation: true,
// To disable Spotify:
// spotify: false,
spotify: {
clientId: process.env.SPOTIFY_CLIENT_ID,
clientSecret: process.env.SPOTIFY_CLIENT_SECRET
},

// Problematic, slows queries down by ~3 seconds
// if enabled, and you can no longer query with
// /play, use /search instead, grab the desired link
// and /play that instead
soundCloud: false
},

// Bot activity
presence: {
// One of online, idle, invisible, dnd
status: 'online',
activities: [
{
name: '/help',
name: '/play',
// One of Playing, Streaming, Listening, Watching
type: 'Listening'
}
]
},

// Additional permissions that are considered required when generating
// the bot invite link with /invite
permissionsBase: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.SendMessagesInThreads
],

// Permission config
permissions: {
// Bot Owner, highest permission level (5)
ownerId: '290182686365188096',

// Bot developers, second to highest permission level (4)
developers: [ '625286565375246366' ]
developers: [ '' ]
},

// The Discord server invite to your Support server
supportServerInviteLink: 'https://discord.mirasaki.dev'
supportServerInviteLink: 'https://discord.gg/mirasaki',

// Additional permissions that are considered required when generating
// the bot invite link with /invite
permissionsBase: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.SendMessagesInThreads
]
};

module.exports = config;
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ services:
- ./:/app:ro
# Anonymous volume
- /app/node_modules
env_file:
- ./.env
environment:
- NODE_ENV=production
- DISCORD_BOT_TOKEN=
- DISCORD_CLIENT_ID=
- SPOTIFY_CLIENT_ID=
- SPOTIFY_CLIENT_SECRET=
59 changes: 0 additions & 59 deletions jsdoc.json

This file was deleted.

0 comments on commit 5a70e0e

Please sign in to comment.