3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-17 23:25:02 +00:00

Add auto-reaction support

This commit is contained in:
Dragory 2019-01-12 13:42:11 +02:00
parent df08e12334
commit 9670a17e99
7 changed files with 233 additions and 10 deletions

View file

@ -1,5 +1,5 @@
import at = require("lodash.at");
import { Guild, GuildAuditLogEntry, TextableChannel } from "eris";
import { Emoji, Guild, GuildAuditLogEntry, TextableChannel } from "eris";
import url from "url";
import tlds from "tlds";
import emojiRegex from "emoji-regex";
@ -176,6 +176,10 @@ export function getEmojiInString(str: string): string[] {
return str.match(matchAllEmojiRegex) || [];
}
export function isEmoji(str: string): boolean {
return str.match(`^(${unicodeEmojiRegex.source})|(${customEmojiRegex.source})$`) !== null;
}
export function trimLines(str: string) {
return str
.trim()
@ -288,3 +292,7 @@ export function noop() {
}
export const DBDateFormat = "YYYY-MM-DD HH:mm:ss";
export type CustomEmoji = {
id: string;
} & Emoji;