This commit is contained in:
2021-03-04 03:33:54 +03:00
parent 368382f63c
commit 5ac17d713f
67 changed files with 1824 additions and 119 deletions
+21
View File
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("../base/base");
const net_1 = require("../base/net");
class RandomString {
constructor() {
this.regexp = /^\/randomstring\s(\d+)/i;
}
async execute(context, params) {
const l = parseInt(params[1]);
const length = l > 100 && context.senderId != base_1.CREATOR_ID ? 100 : l;
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя0123456789';
for (let i = 0; i < length; i++) {
result += characters.charAt(base_1.getRandomInt(characters.length));
}
await net_1.sendMessage(context, result);
}
}
exports.RandomString = RandomString;
//# sourceMappingURL=randomString.js.map