Skip to content

Commit 54be826

Browse files
committed
+ More info about highlight and made highlight case-insensitive
1 parent 780100f commit 54be826

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/zibot/exts/meta/meta.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,19 @@ async def invite(self, ctx: Context):
283283

284284
@commands.group(aliases=("hl",))
285285
async def highlight(self, ctx):
286-
"""Group root for highlights"""
286+
"""Manage your highlight words
287+
288+
When a highlight word/phrase is found, the bot will send you a private
289+
message with the message that triggered it along with contexts."""
287290
pass
288291

289292
@highlight.command()
290293
async def add(self, ctx, *, text: str):
294+
"""Add a new highlight word/phrase
295+
296+
Note, highlight words/phrases are NOT case-sensitive!"""
297+
text = text.lower()
298+
291299
# TODO: Actually add the text to highlights db
292300
await ctx.try_reply(text)
293301

@@ -303,11 +311,11 @@ async def onHighlight(self, message: discord.Message):
303311
return
304312

305313
for hl, owners in guildHighlight.items():
306-
if hl not in message.content:
314+
if hl not in message.content.lower():
307315
continue
308316

309317
# Getting context
310-
msgs: list[discord.Message] = [message]
318+
msgs: List[discord.Message] = [message]
311319
async for history in channel.history(limit=4, before=message.created_at):
312320
msgs.append(history)
313321

0 commit comments

Comments
 (0)