Fixing "security issue" no. 2 and no. 3

This commit is contained in:
Lucas Gabriel 2024-09-29 11:05:55 -03:00
parent 9d73a1d03f
commit 1331fd1940
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -4,6 +4,7 @@ const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch); const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
const os = require('os'); const os = require('os');
const { exec } = require('child_process'); const { exec } = require('child_process');
const { error } = require('console');
function getGitCommitHash() { function getGitCommitHash() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -126,7 +127,7 @@ module.exports = (bot) => {
const botName = ctx.message.text.split(' ').slice(1).join(' '); const botName = ctx.message.text.split(' ').slice(1).join(' ');
handleAdminCommand(ctx, async () => { handleAdminCommand(ctx, async () => {
await ctx.telegram.setMyName(botName); await ctx.telegram.setMyName(botName);
}, Strings.botNameChanged.replace('{botName}', botName), Strings.botNameErr.replace('{error}', '{error}')); }, Strings.botNameChanged.replace('{botName}', botName), Strings.botNameErr.replace('{error}', error));
}); });
bot.command('setbotdesc', spamwatchMiddleware, async (ctx) => { bot.command('setbotdesc', spamwatchMiddleware, async (ctx) => {
@ -134,7 +135,7 @@ module.exports = (bot) => {
const botDesc = ctx.message.text.split(' ').slice(1).join(' '); const botDesc = ctx.message.text.split(' ').slice(1).join(' ');
handleAdminCommand(ctx, async () => { handleAdminCommand(ctx, async () => {
await ctx.telegram.setMyDescription(botDesc); await ctx.telegram.setMyDescription(botDesc);
}, Strings.botDescChanged.replace('{botDesc}', botDesc), Strings.botDescErr.replace('{error}', '{error}')); }, Strings.botDescChanged.replace('{botDesc}', botDesc), Strings.botDescErr.replace('{error}', error));
}); });
bot.command('botkickme', spamwatchMiddleware, async (ctx) => { bot.command('botkickme', spamwatchMiddleware, async (ctx) => {