V0.4.5 - Fix regex for not finding number emojis
This commit is contained in:
parent
2a68522abd
commit
42cb621bf6
|
@ -1,4 +1,4 @@
|
||||||
# Sweeper Bot | V0.4.4 - 2022/09/27
|
# Sweeper Bot | V0.4.5 - 2022/09/30
|
||||||
[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=SweeperBot)
|
[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=SweeperBot)
|
||||||
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=bugs)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=SweeperBot)
|
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=bugs)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=SweeperBot) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=SweeperBot&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=SweeperBot)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export const config = {
|
export const config = {
|
||||||
'name': 'Sweeper Bot', // Name of the bot
|
'name': 'Sweeper Bot', // Name of the bot
|
||||||
'version': '0.4.4', // Version of the bot
|
'version': '0.4.5', // Version of the bot
|
||||||
'token': 'the_bot_token', // Discord API Token for this bot
|
'token': 'the_bot_token', // Discord API Token for this bot
|
||||||
'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token"
|
'localtoken': 'local_testing_token', // Discord API Token for a secondary OPTIONAL testing bot, THIS MUST BE DIFFERENT FROM "token"
|
||||||
'prefix': 's!', // Prefix for all commands
|
'prefix': 's!', // Prefix for all commands
|
||||||
|
|
|
@ -10,9 +10,9 @@ import utils from '../utils.ts';
|
||||||
export const pollReactions = async (bot: Bot, message: Message, update = false) => {
|
export const pollReactions = async (bot: Bot, message: Message, update = false) => {
|
||||||
if (message.content.toLowerCase().includes('clan poll')) {
|
if (message.content.toLowerCase().includes('clan poll')) {
|
||||||
// Emoji RegExp
|
// Emoji RegExp
|
||||||
const unicodeEmojis = '(\\p{Emoji_Presentation}|\\p{Extended_Pictographic})';
|
const unicodeEmojiRX = `(\\p{RI}\\p{RI}|\\p{Emoji}(\\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u{200D}\\p{Emoji}(\\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?)+|\\p{EPres}(\\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F})?|\\p{Emoji}(\\p{EMod}+|\u{FE0F}\u{20E3}?|[\u{E0020}-\u{E007E}]+\u{E007F}))`;
|
||||||
const unicodeEmojiRX = `(${unicodeEmojis}(\u200d${unicodeEmojis})*)`;
|
|
||||||
const discordEmojiRX = '(a?:[a-zA-Z\\d_]+:\\d+)';
|
const discordEmojiRX = '(a?:[a-zA-Z\\d_]+:\\d+)';
|
||||||
|
|
||||||
const allEmojiRX = new RegExp(`${unicodeEmojiRX}|${discordEmojiRX}`, 'gu');
|
const allEmojiRX = new RegExp(`${unicodeEmojiRX}|${discordEmojiRX}`, 'gu');
|
||||||
|
|
||||||
// Get list of emojis in message
|
// Get list of emojis in message
|
||||||
|
|
Loading…
Reference in New Issue