mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-08-30 05:37:59 +00:00
Misc
This commit is contained in:
parent
3d751b7704
commit
e54719ad11
@ -81,6 +81,7 @@ const addCommandHandler = async (ctx) => {
|
||||
'/removecommand <code><name></code>' +
|
||||
' - to remove a command.',
|
||||
Markup.keyboard([ [ `/addcommand -replace ${newCommand}` ] ])
|
||||
.selective()
|
||||
.oneTime()
|
||||
.resize()
|
||||
.extra(),
|
||||
|
@ -2,6 +2,7 @@
|
||||
'use strict';
|
||||
|
||||
// Utils
|
||||
const { inspect } = require('util');
|
||||
const { displayUser, scheduleDeletion } = require('../../utils/tg');
|
||||
const { html, lrm, TgHtml } = require('../../utils/html');
|
||||
const { isMaster, isWarnNotExpired } = require('../../utils/config');
|
||||
@ -21,7 +22,7 @@ const formatEntry = async (entry, defaultVal) => {
|
||||
if (!entry || !entry.by_id) return html`${defaultVal}`;
|
||||
const { first_name } = await getUser({ id: entry.by_id }) || {};
|
||||
if (!first_name) return html`${lrm}${entry.reason} (${formatDate(entry.date)})`;
|
||||
return html`${lrm};${entry.reason} (${first_name}, ${formatDate(entry.date)})`;
|
||||
return html`${lrm}${entry.reason} (${first_name}, ${formatDate(entry.date)})`;
|
||||
};
|
||||
|
||||
const formatWarn = async (warn, i) =>
|
||||
@ -56,7 +57,7 @@ const getWarnsHandler = async ({ from, message, replyWithHTML }) => {
|
||||
).then(scheduleDeletion());
|
||||
}
|
||||
|
||||
const { targets } = parse(message);
|
||||
const { flags, targets } = parse(message);
|
||||
|
||||
if (targets.length > 1) {
|
||||
return replyWithHTML(
|
||||
@ -74,6 +75,12 @@ const getWarnsHandler = async ({ from, message, replyWithHTML }) => {
|
||||
).then(scheduleDeletion());
|
||||
}
|
||||
|
||||
if (flags.has('raw') && from.status === 'admin') {
|
||||
return replyWithHTML(
|
||||
TgHtml.pre(inspect(theUser)),
|
||||
).then(scheduleDeletion());
|
||||
}
|
||||
|
||||
const header = html`${title(theUser)} ${displayUser(theUser)}`;
|
||||
const banReason = optional(
|
||||
html`🚫 <b>Ban reason:</b>`,
|
||||
|
@ -14,7 +14,6 @@ const { deleteJoinsAfter = '2 minutes' } = require('../../utils/config').config;
|
||||
|
||||
const addedToGroupHandler = require('./addedToGroup');
|
||||
const antibotHandler = require('./antibot');
|
||||
const antifloodHandler = require('./antiflood');
|
||||
const checkLinksHandler = require('./checkLinks');
|
||||
const commandButtons = require('./commandButtons');
|
||||
const kickBannedHandler = require('./kickBanned');
|
||||
|
@ -47,4 +47,4 @@ export class TgHtml {
|
||||
export const html = (raw: TemplateStringsArray, ...subs: Sub[]) =>
|
||||
TgHtml.tag(raw, ...subs);
|
||||
|
||||
export const lrm = html`‎`;
|
||||
export const lrm = "\u200E";
|
||||
|
Loading…
x
Reference in New Issue
Block a user