emotes => emojis
This commit is contained in:
@@ -24,11 +24,11 @@
|
|||||||
* %repeat - repeat last analysis (adding supplied arguments)
|
* %repeat - repeat last analysis (adding supplied arguments)
|
||||||
* %mobile - fix @invalid-user for last command but mentions users
|
* %mobile - fix @invalid-user for last command but mentions users
|
||||||
* %gdpr - displays GDPR information
|
* %gdpr - displays GDPR information
|
||||||
* %emojis - rank emotes by their usage
|
* %emojis - rank emojis by their usage
|
||||||
* arguments:
|
* arguments:
|
||||||
* <n> - top <n> emojis, default is 20
|
* <n> - top <n> emojis, default is 20
|
||||||
* all - list all common emojis in addition to this guild's
|
* all - list all common emojis in addition to this guild's
|
||||||
* members - show top member for each emote
|
* members - show top member for each emoji
|
||||||
* sort:usage/reaction - other sorting methods
|
* sort:usage/reaction - other sorting methods
|
||||||
* %mentions - rank mentions by their usage
|
* %mentions - rank mentions by their usage
|
||||||
* arguments:
|
* arguments:
|
||||||
@@ -150,7 +150,7 @@ python3 src/main.py
|
|||||||
* more scans: `%scan`, `%freq`, `%compo`, `%pres`
|
* more scans: `%scan`, `%freq`, `%compo`, `%pres`
|
||||||
* huge bug fix
|
* huge bug fix
|
||||||
* **v1.5**:
|
* **v1.5**:
|
||||||
* top <n> emotes
|
* top <n> emojis
|
||||||
* bug fix
|
* bug fix
|
||||||
* **v1.4**:
|
* **v1.4**:
|
||||||
* integrate miniscord
|
* integrate miniscord
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from .emote import Emote, get_emote_dict
|
from .emoji import Emoji, get_emoji_dict
|
||||||
from .frequency import Frequency
|
from .frequency import Frequency
|
||||||
from .composition import Composition
|
from .composition import Composition
|
||||||
from .presence import Presence
|
from .presence import Presence
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ class Composition:
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.total_characters = 0
|
self.total_characters = 0
|
||||||
self.plain_text = 0
|
self.plain_text = 0
|
||||||
self.emote_msg = 0
|
self.emoji_msg = 0
|
||||||
self.emote_only = 0
|
self.emoji_only = 0
|
||||||
self.emotes = defaultdict(int)
|
self.emojis = defaultdict(int)
|
||||||
self.edited = 0
|
self.edited = 0
|
||||||
self.everyone = 0
|
self.everyone = 0
|
||||||
self.answers = 0
|
self.answers = 0
|
||||||
@@ -23,8 +23,8 @@ class Composition:
|
|||||||
self.spoilers = 0
|
self.spoilers = 0
|
||||||
|
|
||||||
def to_string(self, msg_count: int) -> List[str]:
|
def to_string(self, msg_count: int) -> List[str]:
|
||||||
total_emotes = val_sum(self.emotes)
|
total_emojis = val_sum(self.emojis)
|
||||||
top_emote = top_key(self.emotes)
|
top_emoji = top_key(self.emojis)
|
||||||
ret = [
|
ret = [
|
||||||
f"- **avg. characters / message**: {self.total_characters/msg_count:.2f}",
|
f"- **avg. characters / message**: {self.total_characters/msg_count:.2f}",
|
||||||
f"- **plain text messages**: {self.plain_text:,} ({percent(self.plain_text/msg_count)})"
|
f"- **plain text messages**: {self.plain_text:,} ({percent(self.plain_text/msg_count)})"
|
||||||
@@ -42,14 +42,14 @@ class Composition:
|
|||||||
f"- **answers**: {self.answers:,} ({percent(self.answers/msg_count)})"
|
f"- **answers**: {self.answers:,} ({percent(self.answers/msg_count)})"
|
||||||
if self.answers > 0
|
if self.answers > 0
|
||||||
else "",
|
else "",
|
||||||
f"- **emojis**: {total_emotes:,} (in {percent(self.emote_msg/msg_count)} of msg, avg. {precise(total_emotes/msg_count)}/msg)"
|
f"- **emojis**: {total_emojis:,} (in {percent(self.emoji_msg/msg_count)} of msg, avg. {precise(total_emojis/msg_count)}/msg)"
|
||||||
if total_emotes > 0
|
if total_emojis > 0
|
||||||
else "",
|
else "",
|
||||||
f"- **most used emoji**: {top_emote} ({plural(self.emotes[top_emote], 'time')}, {percent(self.emotes[top_emote]/total_emotes)})"
|
f"- **most used emoji**: {top_emoji} ({plural(self.emojis[top_emoji], 'time')}, {percent(self.emojis[top_emoji]/total_emojis)})"
|
||||||
if total_emotes > 0
|
if total_emojis > 0
|
||||||
else "",
|
else "",
|
||||||
f"- **emoji-only messages**: {self.emote_only:,} ({percent(self.emote_only/msg_count)})"
|
f"- **emoji-only messages**: {self.emoji_only:,} ({percent(self.emoji_only/msg_count)})"
|
||||||
if self.emote_only > 0
|
if self.emoji_only > 0
|
||||||
else "",
|
else "",
|
||||||
f"- **images**: {self.images:,} ({percent(self.images/msg_count)})"
|
f"- **images**: {self.images:,} ({percent(self.images/msg_count)})"
|
||||||
if self.images > 0
|
if self.images > 0
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Counter:
|
|||||||
|
|
||||||
def score(self) -> float:
|
def score(self) -> float:
|
||||||
# Score is compose of usages + reactions
|
# Score is compose of usages + reactions
|
||||||
# When 2 emotes have the same score,
|
# When 2 emojis have the same score,
|
||||||
# the days since last use is stored in the digits
|
# the days since last use is stored in the digits
|
||||||
# (more recent first)
|
# (more recent first)
|
||||||
return self.all_usages() + 1 / (
|
return self.all_usages() + 1 / (
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import discord
|
|||||||
from utils import mention, plural, from_now, top_key, percent
|
from utils import mention, plural, from_now, top_key, percent
|
||||||
|
|
||||||
|
|
||||||
class Emote:
|
class Emoji:
|
||||||
"""
|
"""
|
||||||
Custom class to store emotes data
|
Custom class to store emojis data
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, emoji: Optional[discord.Emoji] = None):
|
def __init__(self, emoji: Optional[discord.Emoji] = None):
|
||||||
@@ -34,7 +34,7 @@ class Emote:
|
|||||||
|
|
||||||
def score(self, *, usage_weight: int = 1, react_weight: int = 1) -> float:
|
def score(self, *, usage_weight: int = 1, react_weight: int = 1) -> float:
|
||||||
# Score is compose of usages + reactions
|
# Score is compose of usages + reactions
|
||||||
# When 2 emotes have the same score,
|
# When 2 emojis have the same score,
|
||||||
# the days since last use is stored in the digits
|
# the days since last use is stored in the digits
|
||||||
# (more recent first)
|
# (more recent first)
|
||||||
return (
|
return (
|
||||||
@@ -99,8 +99,8 @@ class Emote:
|
|||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def get_emote_dict(guild: discord.Guild) -> Dict[str, Emote]:
|
def get_emoji_dict(guild: discord.Guild) -> Dict[str, Emoji]:
|
||||||
emotes = defaultdict(Emote)
|
emojis = defaultdict(Emoji)
|
||||||
for emoji in guild.emojis:
|
for emoji in guild.emojis:
|
||||||
emotes[str(emoji)] = Emote(emoji)
|
emojis[str(emoji)] = Emoji(emoji)
|
||||||
return emotes
|
return emojis
|
||||||
+3
-3
@@ -8,7 +8,7 @@ if sys.version_info < (3, 7):
|
|||||||
|
|
||||||
from utils import emojis, gdpr, command_cache
|
from utils import emojis, gdpr, command_cache
|
||||||
from scanners import (
|
from scanners import (
|
||||||
EmotesScanner,
|
EmojisScanner,
|
||||||
FullScanner,
|
FullScanner,
|
||||||
FrequencyScanner,
|
FrequencyScanner,
|
||||||
CompositionScanner,
|
CompositionScanner,
|
||||||
@@ -115,9 +115,9 @@ bot.register_command(
|
|||||||
)
|
)
|
||||||
bot.register_command(
|
bot.register_command(
|
||||||
"(emojis?|emotes?)",
|
"(emojis?|emotes?)",
|
||||||
lambda *args: EmotesScanner().compute(*args),
|
lambda *args: EmojisScanner().compute(*args),
|
||||||
"emojis: rank emojis by their usage",
|
"emojis: rank emojis by their usage",
|
||||||
EmotesScanner.help(),
|
EmojisScanner.help(),
|
||||||
)
|
)
|
||||||
bot.register_command(
|
bot.register_command(
|
||||||
"(react(ions?)?)",
|
"(react(ions?)?)",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from .scanner import Scanner
|
from .scanner import Scanner
|
||||||
from .emotes_scanner import EmotesScanner
|
from .emojis_scanner import EmojisScanner
|
||||||
from .frequency_scanner import FrequencyScanner
|
from .frequency_scanner import FrequencyScanner
|
||||||
from .composition_scanner import CompositionScanner
|
from .composition_scanner import CompositionScanner
|
||||||
from .presence_scanner import PresenceScanner
|
from .presence_scanner import PresenceScanner
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class ChannelsScanner(Scanner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
# get max emotes to view
|
|
||||||
self.top = 10
|
self.top = 10
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
|
|||||||
@@ -57,19 +57,19 @@ class CompositionScanner(Scanner):
|
|||||||
impacted = True
|
impacted = True
|
||||||
compo.total_characters += len(message.content)
|
compo.total_characters += len(message.content)
|
||||||
|
|
||||||
emotes_found = emojis.regex.findall(message.content)
|
emojis_found = emojis.regex.findall(message.content)
|
||||||
without_emote = message.content
|
without_emoji = message.content
|
||||||
for name in emotes_found:
|
for name in emojis_found:
|
||||||
if name in emojis.unicode_list or re.match(
|
if name in emojis.unicode_list or re.match(
|
||||||
r"(<a?:[\w\-\~]+:\d+>|:[\w\\-\~]+:)", name
|
r"(<a?:[\w\-\~]+:\d+>|:[\w\\-\~]+:)", name
|
||||||
):
|
):
|
||||||
compo.emotes[name] += 1
|
compo.emojis[name] += 1
|
||||||
i = without_emote.index(name)
|
i = without_emoji.index(name)
|
||||||
without_emote = without_emote[:i] + without_emote[i + len(name) :]
|
without_emoji = without_emoji[:i] + without_emoji[i + len(name) :]
|
||||||
if len(message.content.strip()) > 0 and len(without_emote.strip()) == 0:
|
if len(message.content.strip()) > 0 and len(without_emoji.strip()) == 0:
|
||||||
compo.emote_only += 1
|
compo.emoji_only += 1
|
||||||
if len(emotes_found) > 0:
|
if len(emojis_found) > 0:
|
||||||
compo.emote_msg += 1
|
compo.emoji_msg += 1
|
||||||
|
|
||||||
links_found = re.findall(r"https?:\/\/", message.content)
|
links_found = re.findall(r"https?:\/\/", message.content)
|
||||||
compo.links += len(links_found)
|
compo.links += len(links_found)
|
||||||
@@ -102,7 +102,7 @@ class CompositionScanner(Scanner):
|
|||||||
compo.tts += 1
|
compo.tts += 1
|
||||||
|
|
||||||
if (
|
if (
|
||||||
len(emotes_found) == 0
|
len(emojis_found) == 0
|
||||||
and message.reference is None
|
and message.reference is None
|
||||||
and not message.image
|
and not message.image
|
||||||
and len(message.mentions) == 0
|
and len(message.mentions) == 0
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ import discord
|
|||||||
# Custom libs
|
# Custom libs
|
||||||
|
|
||||||
from logs import ChannelLogs, MessageLog
|
from logs import ChannelLogs, MessageLog
|
||||||
from data_types import Emote, get_emote_dict
|
from data_types import Emoji, get_emoji_dict
|
||||||
from .scanner import Scanner
|
from .scanner import Scanner
|
||||||
from utils import emojis, generate_help, plural, precise
|
from utils import emojis, generate_help, plural, precise
|
||||||
|
|
||||||
|
|
||||||
class EmotesScanner(Scanner):
|
class EmojisScanner(Scanner):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def help() -> str:
|
def help() -> str:
|
||||||
return generate_help(
|
return generate_help(
|
||||||
@@ -31,13 +31,13 @@ class EmotesScanner(Scanner):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
has_digit_args=True,
|
has_digit_args=True,
|
||||||
valid_args=["all", "members", "sort:usage", "sort:reaction", "everyone"],
|
valid_args=["all", "members", "sort:usage", "sort:reaction", "everyone"],
|
||||||
help=EmotesScanner.help(),
|
help=EmojisScanner.help(),
|
||||||
intro_context="Emoji usage",
|
intro_context="Emoji usage",
|
||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
guild = message.channel.guild
|
guild = message.channel.guild
|
||||||
# get max emotes to view
|
# get max emojis to view
|
||||||
self.top = 20
|
self.top = 20
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
@@ -47,8 +47,8 @@ class EmotesScanner(Scanner):
|
|||||||
self.show_members = "members" in args and (
|
self.show_members = "members" in args and (
|
||||||
len(self.members) == 0 or len(self.members) > 1
|
len(self.members) == 0 or len(self.members) > 1
|
||||||
)
|
)
|
||||||
# Create emotes dict from custom emojis of the guild
|
# Create emojis dict from custom emojis of the guild
|
||||||
self.emotes = get_emote_dict(guild)
|
self.emojis = get_emoji_dict(guild)
|
||||||
self.sort = None
|
self.sort = None
|
||||||
if "sort:usage" in args:
|
if "sort:usage" in args:
|
||||||
self.sort = "usage"
|
self.sort = "usage"
|
||||||
@@ -58,36 +58,36 @@ class EmotesScanner(Scanner):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def compute_message(self, channel: ChannelLogs, message: MessageLog):
|
def compute_message(self, channel: ChannelLogs, message: MessageLog):
|
||||||
return EmotesScanner.analyse_message(
|
return EmojisScanner.analyse_message(
|
||||||
message,
|
message,
|
||||||
self.emotes,
|
self.emojis,
|
||||||
self.raw_members,
|
self.raw_members,
|
||||||
all_emojis=self.all_emojis,
|
all_emojis=self.all_emojis,
|
||||||
all_messages=self.all_messages,
|
all_messages=self.all_messages,
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_results(self, intro: str) -> List[str]:
|
def get_results(self, intro: str) -> List[str]:
|
||||||
names = [name for name in self.emotes]
|
names = [name for name in self.emojis]
|
||||||
names.sort(
|
names.sort(
|
||||||
key=lambda name: self.emotes[name].score(
|
key=lambda name: self.emojis[name].score(
|
||||||
usage_weight=(0 if self.sort == "reaction" else 1),
|
usage_weight=(0 if self.sort == "reaction" else 1),
|
||||||
react_weight=(0 if self.sort == "usage" else 1),
|
react_weight=(0 if self.sort == "usage" else 1),
|
||||||
),
|
),
|
||||||
reverse=True,
|
reverse=True,
|
||||||
)
|
)
|
||||||
names = names[: self.top]
|
names = names[: self.top]
|
||||||
# Get the total of all emotes used
|
# Get the total of all emojis used
|
||||||
usage_count = 0
|
usage_count = 0
|
||||||
reaction_count = 0
|
reaction_count = 0
|
||||||
for name in self.emotes:
|
for name in self.emojis:
|
||||||
usage_count += self.emotes[name].usages
|
usage_count += self.emojis[name].usages
|
||||||
reaction_count += self.emotes[name].reactions
|
reaction_count += self.emojis[name].reactions
|
||||||
res = [intro]
|
res = [intro]
|
||||||
allow_unused = self.full and len(self.members) == 0
|
allow_unused = self.full and len(self.members) == 0
|
||||||
if self.sort is not None:
|
if self.sort is not None:
|
||||||
res += [f"(Sorted by {self.sort})"]
|
res += [f"(Sorted by {self.sort})"]
|
||||||
res += [
|
res += [
|
||||||
self.emotes[name].to_string(
|
self.emojis[name].to_string(
|
||||||
names.index(name),
|
names.index(name),
|
||||||
name,
|
name,
|
||||||
total_usage=usage_count,
|
total_usage=usage_count,
|
||||||
@@ -96,7 +96,7 @@ class EmotesScanner(Scanner):
|
|||||||
show_members=self.show_members or len(self.raw_members) == 0,
|
show_members=self.show_members or len(self.raw_members) == 0,
|
||||||
)
|
)
|
||||||
for name in names
|
for name in names
|
||||||
if allow_unused or self.emotes[name].used()
|
if allow_unused or self.emojis[name].used()
|
||||||
]
|
]
|
||||||
res += [
|
res += [
|
||||||
f"Total: {plural(usage_count,'time')} ({precise(usage_count/self.msg_count)}/msg)"
|
f"Total: {plural(usage_count,'time')} ({precise(usage_count/self.msg_count)}/msg)"
|
||||||
@@ -108,7 +108,7 @@ class EmotesScanner(Scanner):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def analyse_message(
|
def analyse_message(
|
||||||
message: MessageLog,
|
message: MessageLog,
|
||||||
emotes: Dict[str, Emote],
|
emojis_dict: Dict[str, Emoji],
|
||||||
raw_members: List[int],
|
raw_members: List[int],
|
||||||
*,
|
*,
|
||||||
all_emojis: bool,
|
all_emojis: bool,
|
||||||
@@ -122,27 +122,29 @@ class EmotesScanner(Scanner):
|
|||||||
or message.author in raw_members
|
or message.author in raw_members
|
||||||
):
|
):
|
||||||
impacted = True
|
impacted = True
|
||||||
# Find all emotes un the current message in the form "<:emoji:123456789>"
|
# Find all emojis un the current message in the form "<:emoji:123456789>"
|
||||||
# Filter for known emotes
|
# Filter for known emojis
|
||||||
found = emojis.regex.findall(message.content)
|
found = emojis.regex.findall(message.content)
|
||||||
# For each emote, update its usage
|
# For each emoji, update its usage
|
||||||
for name in found:
|
for name in found:
|
||||||
if name not in emotes:
|
if name not in emojis_dict:
|
||||||
if not all_emojis or name not in emojis.unicode_list:
|
if not all_emojis or name not in emojis.unicode_list:
|
||||||
continue
|
continue
|
||||||
emotes[name].usages += 1
|
emojis_dict[name].usages += 1
|
||||||
emotes[name].update_use(message.created_at, [message.author])
|
emojis_dict[name].update_use(message.created_at, [message.author])
|
||||||
# For each reaction of this message, test if known emote and update when it's the case
|
# For each reaction of this message, test if known emoji and update when it's the case
|
||||||
for name in message.reactions:
|
for name in message.reactions:
|
||||||
if name not in emotes:
|
if name not in emojis_dict:
|
||||||
if not all_emojis or name not in emojis.unicode_list:
|
if not all_emojis or name not in emojis.unicode_list:
|
||||||
continue
|
continue
|
||||||
if len(raw_members) == 0:
|
if len(raw_members) == 0:
|
||||||
emotes[name].reactions += len(message.reactions[name])
|
emojis_dict[name].reactions += len(message.reactions[name])
|
||||||
emotes[name].update_use(message.created_at, message.reactions[name])
|
emojis_dict[name].update_use(
|
||||||
|
message.created_at, message.reactions[name]
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
for member in raw_members:
|
for member in raw_members:
|
||||||
if member in message.reactions[name]:
|
if member in message.reactions[name]:
|
||||||
emotes[name].reactions += 1
|
emojis_dict[name].reactions += 1
|
||||||
emotes[name].update_use(message.created_at, [member])
|
emojis_dict[name].update_use(message.created_at, [member])
|
||||||
return impacted
|
return impacted
|
||||||
@@ -31,7 +31,6 @@ class MentionedScanner(Scanner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
# get max emotes to view
|
|
||||||
self.top = 10
|
self.top = 10
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
@@ -55,7 +54,6 @@ class MentionedScanner(Scanner):
|
|||||||
names = [name for name in self.mentions]
|
names = [name for name in self.mentions]
|
||||||
names.sort(key=lambda name: self.mentions[name].score(), reverse=True)
|
names.sort(key=lambda name: self.mentions[name].score(), reverse=True)
|
||||||
names = names[: self.top]
|
names = names[: self.top]
|
||||||
# Get the total of all emotes used
|
|
||||||
usage_count = Counter.total(self.mentions)
|
usage_count = Counter.total(self.mentions)
|
||||||
res = [intro]
|
res = [intro]
|
||||||
res += [
|
res += [
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ class MentionsScanner(Scanner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
# get max emotes to view
|
|
||||||
self.top = 10
|
self.top = 10
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
@@ -67,7 +66,6 @@ class MentionsScanner(Scanner):
|
|||||||
names = [name for name in self.mentions]
|
names = [name for name in self.mentions]
|
||||||
names.sort(key=lambda name: self.mentions[name].score(), reverse=True)
|
names.sort(key=lambda name: self.mentions[name].score(), reverse=True)
|
||||||
names = names[: self.top]
|
names = names[: self.top]
|
||||||
# Get the total of all emotes used
|
|
||||||
usage_count = Counter.total(self.mentions)
|
usage_count = Counter.total(self.mentions)
|
||||||
res = [intro]
|
res = [intro]
|
||||||
res += [
|
res += [
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ class MessagesScanner(Scanner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
# get max emotes to view
|
|
||||||
self.top = 10
|
self.top = 10
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ class ReactionsScanner(Scanner):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def init(self, message: discord.Message, *args: str) -> bool:
|
async def init(self, message: discord.Message, *args: str) -> bool:
|
||||||
# get max emotes to view
|
|
||||||
self.top = 10
|
self.top = 10
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.isdigit():
|
if arg.isdigit():
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ class WordsScanner(Scanner):
|
|||||||
words = [word for word in self.words]
|
words = [word for word in self.words]
|
||||||
words.sort(key=lambda word: self.words[word].score(), reverse=True)
|
words.sort(key=lambda word: self.words[word].score(), reverse=True)
|
||||||
words = words[: self.top]
|
words = words[: self.top]
|
||||||
# Get the total of all emotes used
|
|
||||||
usage_count = Counter.total(self.words)
|
usage_count = Counter.total(self.words)
|
||||||
print(len(self.words))
|
print(len(self.words))
|
||||||
res = [intro.format(self.letters)]
|
res = [intro.format(self.letters)]
|
||||||
|
|||||||
Reference in New Issue
Block a user