mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Braille Command
This commit is contained in:
@@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"a": "⠁",
|
||||||
|
"b": "⠃",
|
||||||
|
"c": "⠉",
|
||||||
|
"d": "⠙",
|
||||||
|
"e": "⠑",
|
||||||
|
"f": "⠋",
|
||||||
|
"g": "⠛",
|
||||||
|
"h": "⠓",
|
||||||
|
"i": "⠊",
|
||||||
|
"j": "⠚",
|
||||||
|
"k": "⠅",
|
||||||
|
"l": "⠇",
|
||||||
|
"m": "⠍",
|
||||||
|
"n": "⠝",
|
||||||
|
"o": "⠕",
|
||||||
|
"p": "⠏",
|
||||||
|
"q": "⠟",
|
||||||
|
"r": "⠗",
|
||||||
|
"s": "⠎",
|
||||||
|
"t": "⠞",
|
||||||
|
"u": "⠥",
|
||||||
|
"v": "⠧",
|
||||||
|
"w": "⠺",
|
||||||
|
"x": "⠭",
|
||||||
|
"y": "⠽",
|
||||||
|
"z": "⠵",
|
||||||
|
"A": "⠠⠁",
|
||||||
|
"B": "⠠⠃",
|
||||||
|
"C": "⠠⠉",
|
||||||
|
"D": "⠠⠙",
|
||||||
|
"E": "⠠⠑",
|
||||||
|
"F": "⠠⠋",
|
||||||
|
"G": "⠠⠛",
|
||||||
|
"H": "⠠⠓",
|
||||||
|
"I": "⠠⠊",
|
||||||
|
"J": "⠠⠚",
|
||||||
|
"K": "⠠⠅",
|
||||||
|
"L": "⠠⠇",
|
||||||
|
"M": "⠠⠍",
|
||||||
|
"N": "⠠⠝",
|
||||||
|
"O": "⠠⠕",
|
||||||
|
"P": "⠠⠏",
|
||||||
|
"Q": "⠠⠟",
|
||||||
|
"R": "⠠⠗",
|
||||||
|
"S": "⠠⠎",
|
||||||
|
"T": "⠠⠞",
|
||||||
|
"U": "⠠⠥",
|
||||||
|
"V": "⠠⠧",
|
||||||
|
"W": "⠠⠺",
|
||||||
|
"X": "⠠⠭",
|
||||||
|
"Y": "⠠⠽",
|
||||||
|
"Z": "⠠⠵",
|
||||||
|
"0": "⠼⠚",
|
||||||
|
"1": "⠼⠁",
|
||||||
|
"2": "⠼⠃",
|
||||||
|
"3": "⠼⠉",
|
||||||
|
"4": "⠼⠙",
|
||||||
|
"5": "⠼⠑",
|
||||||
|
"6": "⠼⠋",
|
||||||
|
"7": "⠼⠛",
|
||||||
|
"8": "⠼⠓",
|
||||||
|
"9": "⠼⠊",
|
||||||
|
".": "⠲",
|
||||||
|
",": "⠂",
|
||||||
|
"!": "⠖",
|
||||||
|
"?": "⠦",
|
||||||
|
"'": "⠄",
|
||||||
|
"\"": "⠄⠶",
|
||||||
|
":": "⠒",
|
||||||
|
";": "⠆",
|
||||||
|
"-": "⠤",
|
||||||
|
"(": "⠐⠣",
|
||||||
|
")": "⠐⠜"
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
const { Command } = require('discord.js-commando');
|
||||||
|
const { letterTrans } = require('custom-translate');
|
||||||
|
const dictionary = require('../../assets/json/braille');
|
||||||
|
|
||||||
|
module.exports = class BrailleCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'braille',
|
||||||
|
group: 'text-edit',
|
||||||
|
memberName: 'braille',
|
||||||
|
description: 'Converts text to braille.',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'text',
|
||||||
|
prompt: 'What text would you like to convert to braille?',
|
||||||
|
type: 'string',
|
||||||
|
validate: text => {
|
||||||
|
if (letterTrans(text, dictionary).length < 2000) return true;
|
||||||
|
return 'Invalid text, your text is too long.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(msg, { text }) {
|
||||||
|
return msg.say(letterTrans(text, dictionary));
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "44.4.3",
|
"version": "44.5.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user