mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-21 21:25:37 +01:00
fixed two minor issues...
* Regex misuse in server.ts (matching media URL) * Dead value assignment in quote.ts
This commit is contained in:
parent
89ed704d09
commit
1c5236345c
@ -2,7 +2,7 @@ import discord = require('discord.js');
|
||||
|
||||
export const roles = ['Admins', 'Moderators'];
|
||||
export function command (message: discord.Message, reply: string) {
|
||||
let replyMessage = 'Hello.';
|
||||
let replyMessage;
|
||||
if (reply == null) {
|
||||
replyMessage = message.content.substr(message.content.indexOf(' ') + 1);
|
||||
} else {
|
||||
|
@ -145,7 +145,7 @@ client.on('message', message => {
|
||||
return;
|
||||
}
|
||||
if (!findArray(authorRoles, AllowedMediaRoles)) {
|
||||
const urlRegex = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi);
|
||||
const urlRegex = new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_+.~#?&\/=]*)/gi);
|
||||
if (message.attachments.size > 0 || message.content.match(urlRegex)) {
|
||||
mediaUsers.set(message.author.id, true);
|
||||
} else if (mediaUsers.get(message.author.id)) {
|
||||
|
Loading…
Reference in New Issue
Block a user