Improve Pastebin.com detection

Signed-off-by: pandaninjas <101084582+pandaninjas@users.noreply.github.com>
This commit is contained in:
pandaninjas 2022-11-06 11:25:44 -08:00 committed by GitHub
parent 4e2afcc7f8
commit dec4d8c986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,7 +226,7 @@ const providers: LogProvider[] = [
]; ];
export async function parseLog(s: string): Promise<EmbedBuilder | null> { export async function parseLog(s: string): Promise<EmbedBuilder | null> {
if (s.includes('https://pastebin.com/')) { if (/(https?:\/\/)?pastebin\.com\/(raw\/)?[^/\s]{8}/g.test(s)) {
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle('pastebin.com detected') .setTitle('pastebin.com detected')
.setDescription( .setDescription(