forked from Tricked-dev/texter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
277 lines (253 loc) · 7.06 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/* eslint-disable */
const { Plugin } = require('powercord/entities');
const {
smallLetters,
smallerLetters,
flipLetters,
fullWidthLetters,
emojiLetters,
omegalul,
omegaclown,
} = require('./maps');
const pasta = require('./emojimixer');
const uwufy = require('./uwufy');
module.exports = class Texter extends Plugin {
startPlugin() {
powercord.api.commands.registerCommand({
command: 'fw',
description: 'full widths your text',
usage: '{c} [Text you want to flip]',
executor: (args) => ({
send: true,
result: args.join(' ').fullWidth(),
}),
});
powercord.api.commands.registerCommand({
command: 'zwsit',
description:
'Add zero width spaces between your message useful in some cases',
usage: '{c} [ZWS]',
executor: (args) => ({
send: true,
result: '\u200b' + args.join(' ').split('').join('\u200b') + '\u200b',
}),
});
powercord.api.commands.registerCommand({
command: 'nozws',
description: 'Removes all the zero width spaces from your message',
usage: '{c} [ZWS]',
executor: (args) => ({
send: true,
result: args.join(' ').replace(/\u200b/gi, ''),
}),
});
powercord.api.commands.registerCommand({
command: 'emoji',
description: 'Turn your text into big emoji letters',
usage: '{c} [Text to Emojify]',
executor: (args) => ({
send: true,
result: args.join(' ').split('').join(' ').emoji(),
}),
});
powercord.api.commands.registerCommand({
command: 'fullwidth',
description: 'full widths your text',
usage: '{c} [Text you want to flip]',
executor: (args) => ({
send: true,
result: args.join(' ').fullWidth(),
}),
});
powercord.api.commands.registerCommand({
command: 'omegalul',
description: 'replaces "o" with :omegalul:',
usage: '{c} [Text you want to flip]',
executor: (args) => ({
send: true,
result: args.join(' ').omegalul(),
}),
});
powercord.api.commands.registerCommand({
command: 'omegaclown',
description: 'replaces "o" with :omegaclown:',
usage: '{c} [Text you want to flip]',
executor: (args) => ({
send: true,
result: args.join(' ').omegaclown(),
}),
});
powercord.api.commands.registerCommand({
command: 'shrug',
description: 'appends ¯\\_(ツ)_/¯ to you message',
usage: '{c} [.shrug]',
executor: (args) => ({
send: true,
result: args.join(' ') + '¯\\_(ツ)_/¯',
}),
});
powercord.api.commands.registerCommand({
command: 'small',
description: 'makes your text smaller',
usage: '{c} [text that you want to make small]',
executor: (args) => ({
send: true,
result: args.join(' ').small(),
}),
});
powercord.api.commands.registerCommand({
command: 'smaller',
description: 'Makes your text tiny',
usage: '{c} [tiny input]',
executor: (args) => ({
send: true,
result: args.join(' ').smaller(),
}),
});
powercord.api.commands.registerCommand({
command: 'reverse',
description: 'Reverse some text',
usage: '{c} [text to reverse!]',
executor: (args) => ({
send: true,
result: args.join(' ').split('').reverse().join(''),
}),
});
powercord.api.commands.registerCommand({
command: 'reflip',
description: 'reflips your text',
usage: '{c} [text to reflip!]',
executor: (args) => ({
send: true,
result: args.join(' ').split('').reverse().join('').flip(),
}),
});
powercord.api.commands.registerCommand({
command: 'encode',
description: 'Encodes your text with base64 encoding',
usage: '{c} [Text to encode]',
executor: (args) => ({
send: true,
result: Buffer.from(args.join(' '), 'utf-8').toString('base64'),
}),
});
powercord.api.commands.registerCommand({
command: 'decode',
description: 'Decodes your text from base64 encoding',
usage: '{c} [Text to encode]',
executor: (args) => ({
send: true,
result: Buffer.from(args.join(' '), 'base64').toString('utf-8'),
}),
});
powercord.api.commands.registerCommand({
command: 'uwufy',
description: 'Not even gonna bother explaining this one',
usage: '{c} [...........]]',
executor: (args) => ({
send: true,
result: uwufy(args.join(' ')),
}),
});
powercord.api.commands.registerCommand({
command: 'clap',
description: 'adds clap emojis to your text',
usage: '{c} [Text to clap]',
executor: (args) => ({
send: true,
result: '👏' + args.join('👏') + '👏',
}),
});
powercord.api.commands.registerCommand({
command: 'flip',
description: 'flips your text',
usage: '{c} [input]',
executor: (args) => ({
send: true,
result: args.join(' ').flip(),
}),
});
powercord.api.commands.registerCommand({
command: 'space',
description:
'Like .clap except it lets you pick anything you want to put inbetween the words.',
usage: '{c} [space <char> [sentence...]]',
executor: (args) => ({
send: true,
result: space(args),
}),
});
powercord.api.commands.registerCommand({
command: 'pasta',
description: 'Paste emojis',
usage: '{c} [...things]',
executor: (args) => ({
send: true,
result: pasta(args.join(' ')),
}),
});
}
pluginWillUnload() {
for (const command of [
'flip',
'fw',
'clap',
'reflip',
'reverse',
'small',
'smaller',
'shrug',
'fullwidth',
'emoji',
'uwufy',
'omegalul',
'omegaclown',
'space',
'pasta',
]) {
powercord.api.commands.unregisterCommand(command);
}
}
};
function space(args) {
const char = args[0];
const str = args.slice(1).join(char);
return str + char;
}
/**
* @returns ǫ ᴡ ᴇ ʀ ᴛ ʏ ᴜ ɪ ᴏ ᴘ ᴀ s ᴅ ꜰ ɢ ʜ ᴊ ᴋ ʟ ᴢ x ᴄ ᴠ ʙ ɴ ᴍ
*/
String.prototype.small = function () {
return [...this.toLowerCase()].map((l) => smallLetters[l] || l).join('');
};
/**
* @returns ᑫ ʷ ᵉ ʳ ᵗ ʸ ᵘ ᶦ ᵒ ᵖ ᵃ ˢ ᵈ ᶠ ᵍ ʰ ʲ ᵏ ˡ ᶻ ˣ ᶜ ᵛ ᵇ ⁿ ᵐ
*/
String.prototype.smaller = function () {
return [...this.toLowerCase()].map((l) => smallerLetters[l] || l).join('');
};
/**
* @returns q ʍ ǝ ɹ ʇ ʎ u ı o d ɐ s d ɟ ƃ ɥ ɾ ʞ l z x ɔ ʌ q u ɯ
*/
String.prototype.flip = function () {
return [...this.toLowerCase()].map((l) => flipLetters[l] || l).join('');
};
/**
* @returns cant document this ffs
*/
String.prototype.emoji = function () {
return [...this.toLowerCase()].map((l) => emojiLetters[l] || l).join('');
};
/**
* //0123456789
* @returns q w e r t y u i o p a s d f g h j k l z x c v b n m || Q W E R T Y U I O P A S D F G H J K L Z X C V B N M
*/
String.prototype.fullWidth = function () {
return [...this].map((l) => fullWidthLetters[l] || l).join('');
};
String.prototype.omegalul = function () {
return [...this].map((l) => omegalul[l] || l).join('');
};
String.prototype.omegaclown = function () {
return [...this].map((l) => omegaclown[l] || l).join('');
};