Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update button and .env #642

Merged
merged 11 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 21 additions & 21 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
TOKEN= "" # Your bot token.
CLIENT_ID= "" # Your bot's client ID (If this value is left blank, bots cannot be invited using /invite or /about commands.).
PREFIX= "!" # Your prefix.
OWNER_IDS= ["",""] # Your discord id (You can add multiple ids.).
GUILD_ID= "" # Your server ID (If you want to use the bot for a single server).
PRODUCTION= "true" # true for production.
TOPGG= "" # Your Top.gg API key. Obtain this from https://top.gg
KEEP_ALIVE= "false" # true for keep alive in https://replit.com
LOG_CHANNEL_ID= "" # If you enter this, you will be able to receive the status of Lavalink nodes and guild join/leave logs through the corresponding channel.
LOG_COMMANDS_ID= "" # The channel ID where command usage logs will be sent.
BOT_STATUS= "online" # Your bot status (online, dnd, idle, invisible or offline).
BOT_ACTIVITY_TYPE= 0 # Activity type is a number from 0 to 5. See more here: https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
BOT_ACTIVITY= "Lavamusic" # Your bot activity.
DATABASE_URL= "" # Your database url (If you want to use sqlite, then you can leave it blank.).
AUTO_NODE= "false" # true for auto node. It is given from lavainfo-api (https://lavainfo-api.deno.dev).
LAVALINK_URL= "localhost:2333" # Your Lavalink url (If auto node is true, then you can leave it blank).
LAVALINK_AUTH= "youshallnotpass" # Your Lavalink password (If auto node is true, then you can leave it blank.).
LAVALINK_NAME= "Lavamusic" # Your Lavalink name (If auto node is true, then you can leave it blank.).
LAVALINK_SECURE= "false" # true for secure Lavalink (If auto node is true, then you can leave it blank.).
MAX_PLAYLIST_SIZE= "100" # Max playlist size.
MAX_QUEUE_SIZE= "100" # Max queue size.
TOKEN="" # Your bot token.
CLIENT_ID="" # Your bot's client ID (If this value is left blank, bots cannot be invited using /invite or /about commands.).
PREFIX="!" # Your prefix.
OWNER_IDS=["",""] # Your discord id (You can add multiple ids.).
GUILD_ID="" # Your server ID (If you want to use the bot for a single server).
PRODUCTION="true" # true for production.
TOPGG="" # Your Top.gg API key. Obtain this from https://top.gg
KEEP_ALIVE="false" # true for keep alive in https://replit.com
LOG_CHANNEL_ID="" # If you enter this, you will be able to receive the status of Lavalink nodes and guild join/leave logs through the corresponding channel.
LOG_COMMANDS_ID="" # The channel ID where command usage logs will be sent.
BOT_STATUS="online" # Your bot status (online, dnd, idle, invisible or offline).
BOT_ACTIVITY_TYPE=0 # Activity type is a number from 0 to 5. See more here: https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
BOT_ACTIVITY="Lavamusic" # Your bot activity.
DATABASE_URL="" # Your database url (If you want to use sqlite, then you can leave it blank.).
AUTO_NODE="false" # true for auto node. It is given from lavainfo-api (https://lavainfo-api.deno.dev).
LAVALINK_URL="localhost:2333" # Your Lavalink url (If auto node is true, then you can leave it blank).
LAVALINK_AUTH="youshallnotpass" # Your Lavalink password (If auto node is true, then you can leave it blank.).
LAVALINK_NAME="Lavamusic" # Your Lavalink name (If auto node is true, then you can leave it blank.).
LAVALINK_SECURE="false" # true for secure Lavalink (If auto node is true, then you can leave it blank.).
MAX_PLAYLIST_SIZE="100" # Max playlist size.
MAX_QUEUE_SIZE="100" # Max queue size.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"main": "dist/index.js",
"type": "module",
"scripts": {
"start": "npm run clean:no-log && node .",
"start": "npm run clean && node .",
"db:push": "npx prisma db push",
"db:migrate": "npx prisma migrate dev --name init",
"build": "tsc --project tsconfig.json",
"clean": "node ./scripts/clean.js && npm run build",
"clean:no-log": "node ./scripts/clean-no-log.js && npm run build",
"lint": "biome lint --write src/",
"format": "biome format --write src/"
},
Expand Down
16 changes: 0 additions & 16 deletions scripts/clean-no-log.js

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import { rm } from "node:fs/promises";
import { resolve } from "node:path";

async function clean() {
console.log("Cleaning dist folder...");
try {
const path = resolve("dist");
if (existsSync(path)) {
await rm(path, { recursive: true, force: true });
console.log("Dist folder has been cleaned");
} else {
console.log("Dist folder does not exist");
}
} catch (error) {
console.error("Error while cleaning dist folder:", error);
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export default {
main: 0x2f3136,
},
emoji: {
// Custom emoji with ID format (e.g., <:emojiName:123456789012345678>)
// You can add custom emoji with ID format (e.g., <:emojiName:123456789012345678>)
pause: "⏸️",
resume: "▶️",
stop: "⏹️",
skip: "⏩",
previous: "⏪",
forward: "",
forward: "⏭️",
replay: "🔄",
voldown: "🔉",
volup: "🔊",
Expand All @@ -31,9 +31,9 @@ export default {
},
page: {
last: "⏩",
fast: "⏪",
back: "️",
next: "️",
first: "⏪",
back: "️",
next: "️",
cancel: "⏹️",
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/events/client/InteractionCreate.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
ActionRowBuilder,
type AutocompleteInteraction,
ButtonBuilder,
ButtonStyle,
ChannelType,
Collection,
CommandInteraction,
EmbedBuilder,
type GuildMember,
InteractionType,
PermissionFlagsBits,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
EmbedBuilder,
type TextChannel,
} from "discord.js";
import { LoadType } from "shoukaku";
Expand Down
8 changes: 4 additions & 4 deletions src/events/client/MessageCreate.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
ChannelType,
Collection,
EmbedBuilder,
type Message,
PermissionFlagsBits,
ButtonBuilder,
ActionRowBuilder,
ButtonStyle,
EmbedBuilder,
type TextChannel,
} from "discord.js";
import { Context, Event, type Lavamusic } from "../../structures/index.js";
Expand Down
2 changes: 1 addition & 1 deletion src/structures/Lavamusic.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { Api } from "@top-gg/sdk";
import {
ApplicationCommandType,
Client,
Expand All @@ -14,7 +15,6 @@ import {
Routes,
} from "discord.js";
import { Locale } from "discord.js";
import { Api } from "@top-gg/sdk";
import config from "../config.js";
import ServerData from "../database/server.js";
import loadPlugins from "../plugin/index.js";
Expand Down
4 changes: 2 additions & 2 deletions src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export class Utils {
const lastEmbed = page === embed.length - 1;
const pageEmbed = embed[page];
const first = new ButtonBuilder()
.setCustomId("fast")
.setEmoji(client.emoji.page.fast)
.setCustomId("first")
.setEmoji(client.emoji.page.first)
.setStyle(ButtonStyle.Primary)
.setDisabled(firstEmbed);
const back = new ButtonBuilder()
Expand Down