mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-10 19:04:42 +02:00
Format Upvotes like real reddit in subreddit commands
This commit is contained in:
@@ -72,6 +72,10 @@ module.exports = class Util {
|
||||
});
|
||||
}
|
||||
|
||||
static formatNumberK(number) {
|
||||
return number > 999 ? `${(number / 1000).toLocaleString(undefined, { maximumFractionDigits: 1 })}K` : number;
|
||||
}
|
||||
|
||||
static base64(text, mode = 'encode') {
|
||||
if (mode === 'encode') return Buffer.from(text).toString('base64');
|
||||
if (mode === 'decode') return Buffer.from(text, 'base64').toString('utf8') || null;
|
||||
|
||||
Reference in New Issue
Block a user