Skip to content

Commit

Permalink
Merge pull request #395 from saiteja-madha/5.4.0-release
Browse files Browse the repository at this point in the history
5.4.0 release
  • Loading branch information
Sai Teja Madha authored Jul 15, 2023
2 parents dd09fba + 3dc9f99 commit d626814
Show file tree
Hide file tree
Showing 61 changed files with 2,716 additions and 2,252 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
node_modules/
.git/
.vscode/
docs/
*.log
*.tar.gz
*.tar
.env
89 changes: 88 additions & 1 deletion .replit
Original file line number Diff line number Diff line change
@@ -1,2 +1,89 @@
entrypoint = "bot.js"

hidden = [".config", "package-lock.json"]

[interpreter]
command = [
"prybar-nodejs",
"-q",
"--ps1",
"\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",
"-i"
]

[[hints]]
regex = "Error \\[ERR_REQUIRE_ESM\\]"
message = "We see that you are using require(...) inside your code. We currently do not support this syntax. Please use 'import' instead when using external modules. (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)"

[nix]
channel = "stable-22_11"

[env]
XDG_CONFIG_HOME = "/home/runner/$REPL_SLUG/.config"
PATH = "/home/runner/$REPL_SLUG/.config/npm/node_global/bin:/home/runner/$REPL_SLUG/node_modules/.bin"
npm_config_prefix = "/home/runner/$REPL_SLUG/.config/npm/node_global"

[gitHubImport]
requiredFiles = [".replit", "replit.nix", ".config", "package.json", "package-lock.json"]

[packager]
language = "nodejs"
run = "npm i --save-dev node@16.11.0 && npm config set prefix=$(pwd)/node_modules/node && export PATH=$(pwd)/node_modules/node/bin:$PATH && node ."

[packager.features]
packageSearch = true
guessImports = true
enabledForHosting = false

[unitTest]
language = "nodejs"

[debugger]
support = true

[debugger.interactive]
transport = "localhost:0"
startCommand = [ "dap-node" ]

[debugger.interactive.initializeMessage]
command = "initialize"
type = "request"

[debugger.interactive.initializeMessage.arguments]
clientID = "replit"
clientName = "replit.com"
columnsStartAt1 = true
linesStartAt1 = true
locale = "en-us"
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true

[debugger.interactive.launchMessage]
command = "launch"
type = "request"

[debugger.interactive.launchMessage.arguments]
args = []
console = "externalTerminal"
cwd = "."
environment = []
pauseForSourceMap = false
program = "./index.js"
request = "launch"
sourceMaps = true
stopOnEntry = false
type = "pwa-node"

[languages]

[languages.javascript]
pattern = "**/{*.js,*.jsx,*.ts,*.tsx}"

[languages.javascript.languageServer]
start = "typescript-language-server --stdio"

[deployment]
run = ["sh", "-c", "node index.js"]
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
OWNER_IDS: [], // Bot owner ID's
OWNER_IDS: [""], // Bot owner ID's
SUPPORT_SERVER: "", // Your bot support server
PREFIX_COMMANDS: {
ENABLED: true, // Enable/Disable prefix commands
Expand Down
2 changes: 1 addition & 1 deletion dashboard/routes/discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ router.get("/callback", async (req, res) => {
while (!userData.infos || !userData.guilds) {
/* User infos */
if (!userData.infos) {
response = await fetch("http://discordapp.com/api/users/@me", {
response = await fetch("https://discordapp.com/api/users/@me", {
method: "GET",
headers: { Authorization: `Bearer ${tokens.access_token}` },
});
Expand Down
40 changes: 40 additions & 0 deletions dashboard/routes/guild-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,44 @@ router.post("/:serverID/greeting", CheckAuth, async (req, res) => {
Object.prototype.hasOwnProperty.call(data, "welcomeEnable") ||
Object.prototype.hasOwnProperty.call(data, "welcomeUpdate")
) {
if (data.content !== settings.welcome.content) {
settings.welcome.content = data.content;
}

data.content = data.content.replace(/\r?\n/g, "\\n");
if (data.content && data.content !== settings.welcome.content) {
settings.welcome.content = data.content;
}

if (data.description !== settings.welcome.embed.description) {
settings.welcome.embed.description = data.description;
}

data.description = data.description?.replaceAll(/\r\n/g, "\\n");
if (data.description && data.description !== settings.welcome.embed?.description) {
settings.welcome.embed.description = data.description;
}

if (data.footer !== settings.welcome.embed.footer) {
settings.welcome.embed.footer = data.footer;
}

if (data.footer && data.footer !== settings.welcome.embed?.footer) {
settings.welcome.embed.footer = data.footer;
}

if (data.hexcolor !== settings.welcome.embed.hexcolor) {
settings.welcome.embed.hexcolor = data.hexcolor;
}

if (data.hexcolor && data.hexcolor !== settings.welcome.embed?.color) {
settings.welcome.embed.color = data.hexcolor;
}

if (data.image !== settings.welcome.embed.image) {
settings.welcome.embed.image = data.image;
}

if (data.image && data.image !== settings.welcome.embed?.image) {
settings.welcome.embed.image = data.image;
}
Expand All @@ -262,24 +282,44 @@ router.post("/:serverID/greeting", CheckAuth, async (req, res) => {
Object.prototype.hasOwnProperty.call(data, "farewellEnable") ||
Object.prototype.hasOwnProperty.call(data, "farewellUpdate")
) {
if (data.content !== settings.farewell.content) {
settings.farewell.content = data.content;
}

data.content = data.content.replace(/\r?\n/g, "\\n");
if (data.content && data.content !== settings.farewell.content) {
settings.farewell.content = data.content;
}

if (data.description !== settings.farewell.description) {
settings.farewell.description = data.description;
}

data.description = data.description?.replaceAll(/\r\n/g, "\\n");
if (data.description && data.description !== settings.farewell.embed?.description) {
settings.farewell.embed.description = data.description;
}

if (data.footer !== settings.farewell.footer) {
settings.farewell.footer = data.footer;
}

if (data.footer && data.footer !== settings.farewell.embed?.footer) {
settings.farewell.embed.footer = data.footer;
}

if (data.hexcolor !== settings.farewell.hexcolor) {
settings.farewell.hexcolor = data.hexcolor;
}

if (data.hexcolor && data.hexcolor !== settings.farewell.embed?.color) {
settings.farewell.embed.color = data.hexcolor;
}

if (data.image !== settings.farewell.image) {
settings.farewell.image = data.image;
}

if (data.image && data.image !== settings.farewell.embed?.image) {
settings.farewell.embed.image = data.image;
}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "4"

services:
discord-js-bot:
image: saitejamadha/discord-js-bot:5.1.0
image: saitejamadha/discord-js-bot:5.4.0
container_name: discord-js-bot
restart: unless-stopped
networks:
Expand Down
21 changes: 20 additions & 1 deletion dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
# Base image
FROM node:16-alpine

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the container
COPY package*.json ./

# Install only production dependencies
RUN npm ci --omit=dev

# Bundle rest of the source code
COPY . .

EXPOSE 8080-8089 449
# Environment variables
ENV BOT_TOKEN=
ENV MONGO_CONNECTION=
ENV ERROR_LOGS=
ENV JOIN_LEAVE_LOGS=
ENV BOT_SECRET=
ENV SESSION_PASSWORD=
ENV WEATHERSTACK_KEY=
ENV STRANGE_API_KEY=
ENV SPOTIFY_CLIENT_ID=
ENV SPOTIFY_CLIENT_SECRET=

# Expose port 8080 for dashboard
EXPOSE 8080

# Define the command to run your Node.js application
CMD [ "node", "bot.js" ]
1 change: 1 addition & 0 deletions docs/commands/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ _Enabling this feature will allow members to simply react to any message with a
- {member:name} : Member Name 
- {member:dis} : Member Discriminator 
- {member:tag} : Member Tag 
- {member:mention} : Member Mention 
- {member:avatar} : Member Avatar URL 
- {inviter:name} : Inviter Name 
- {inviter:tag} : Inviter Tag 
Expand Down
Loading

0 comments on commit d626814

Please sign in to comment.