-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
208 lines (189 loc) · 5.08 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
/* eslint-disable */
const { Plugin } = require('powercord/entities');
const uwufy = require('./uwufy');
//Non repeating code but complex > repeating code shut up
let functions = {};
createMapper(require('./maps'));
function createMapper(mod) {
for (const [key, value] of Object.entries(mod)) {
functions[key] = (input) =>
[...input.toLowerCase()].map((l) => value[l] || l).join('');
}
}
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: functions.fullWidthLetters(args.join(' ')),
}),
});
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: functions.emojiLetters(
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: functions.fullWidthLetters(args.join(' ')),
}),
});
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: functions.smallLetters(args.join(' ')),
}),
});
powercord.api.commands.registerCommand({
command: 'smaller',
description: 'Makes your text tiny',
usage: '{c} [tiny input]',
executor: (args) => ({
send: true,
result: functions.smallerLetters(args.join(' ')),
}),
});
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: functions.flipLetters(
args.join(' ').split('').reverse().join('')
),
}),
});
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: functions.flipLetters(args.join(' ')),
}),
});
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),
}),
});
}
pluginWillUnload() {
for (const command of [
'flip',
'fw',
'clap',
'reflip',
'reverse',
'small',
'smaller',
'shrug',
'fullwidth',
'emoji',
'uwufy',
'space',
]) {
powercord.api.commands.unregisterCommand(command);
}
}
};
function space(args) {
const char = args[0];
const str = args.slice(1).join(char);
return str + char;
}