Skip to content

Commit e54719a

Browse files
committed
Misc
1 parent 3d751b7 commit e54719a

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

handlers/commands/addCommand.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const addCommandHandler = async (ctx) => {
8181
'/removecommand <code>&lt;name&gt;</code>' +
8282
' - to remove a command.',
8383
Markup.keyboard([ [ `/addcommand -replace ${newCommand}` ] ])
84+
.selective()
8485
.oneTime()
8586
.resize()
8687
.extra(),

handlers/commands/user.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
'use strict';
33

44
// Utils
5+
const { inspect } = require('util');
56
const { displayUser, scheduleDeletion } = require('../../utils/tg');
67
const { html, lrm, TgHtml } = require('../../utils/html');
78
const { isMaster, isWarnNotExpired } = require('../../utils/config');
@@ -21,7 +22,7 @@ const formatEntry = async (entry, defaultVal) => {
2122
if (!entry || !entry.by_id) return html`${defaultVal}`;
2223
const { first_name } = await getUser({ id: entry.by_id }) || {};
2324
if (!first_name) return html`${lrm}${entry.reason} (${formatDate(entry.date)})`;
24-
return html`${lrm};${entry.reason} (${first_name}, ${formatDate(entry.date)})`;
25+
return html`${lrm}${entry.reason} (${first_name}, ${formatDate(entry.date)})`;
2526
};
2627

2728
const formatWarn = async (warn, i) =>
@@ -56,7 +57,7 @@ const getWarnsHandler = async ({ from, message, replyWithHTML }) => {
5657
).then(scheduleDeletion());
5758
}
5859

59-
const { targets } = parse(message);
60+
const { flags, targets } = parse(message);
6061

6162
if (targets.length > 1) {
6263
return replyWithHTML(
@@ -74,6 +75,12 @@ const getWarnsHandler = async ({ from, message, replyWithHTML }) => {
7475
).then(scheduleDeletion());
7576
}
7677

78+
if (flags.has('raw') && from.status === 'admin') {
79+
return replyWithHTML(
80+
TgHtml.pre(inspect(theUser)),
81+
).then(scheduleDeletion());
82+
}
83+
7784
const header = html`${title(theUser)} ${displayUser(theUser)}`;
7885
const banReason = optional(
7986
html`🚫 <b>Ban reason:</b>`,

handlers/middlewares/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const { deleteJoinsAfter = '2 minutes' } = require('../../utils/config').config;
1414

1515
const addedToGroupHandler = require('./addedToGroup');
1616
const antibotHandler = require('./antibot');
17-
const antifloodHandler = require('./antiflood');
1817
const checkLinksHandler = require('./checkLinks');
1918
const commandButtons = require('./commandButtons');
2019
const kickBannedHandler = require('./kickBanned');

utils/html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ export class TgHtml {
4747
export const html = (raw: TemplateStringsArray, ...subs: Sub[]) =>
4848
TgHtml.tag(raw, ...subs);
4949

50-
export const lrm = html`&#8206;`;
50+
export const lrm = "\u200E";

0 commit comments

Comments
 (0)