update notes and alias for yt

This commit is contained in:
Zodiac 2025-02-18 06:48:02 -08:00
parent 34abd50f95
commit fcd8b4de17
2 changed files with 16 additions and 5 deletions

View File

@ -168,7 +168,7 @@ class YouTubePlugin:
f"\x0312https://youtu.be/{info['videoId']}\x0F\x03"
)
@command(options_first=True, use_shlex=True)
@command(options_first=True, use_shlex=True, aliases=['y'],)
async def yt(self, mask, target, args):
"""
%%yt [--<amount>] <search_query>...

View File

@ -168,7 +168,8 @@ class NoteTaking:
self.User = Query()
self.log = logging.getLogger(__name__)
@command
@command(aliases=['notes'], public=True)
async def note(self, mask, target, args):
"""
Unified note command.
@ -189,7 +190,18 @@ class NoteTaking:
<keyword> Keyword to search in notes.
"""
try:
if args.get('today'):
if not args:
# Display the help message if no arguments are provided
help_msg = ircstyle.style("Usage: !note <subcommand> [options]\n", fg="red", bold=True)
help_msg += "Subcommands:\n"
help_msg += ircstyle.style("today", fg="yellow") + " - View or update today's daily note.\n"
help_msg += ircstyle.style("daily [--date <date>]", fg="yellow") + " - View or update a daily note for a specific date (default is today).\n"
help_msg += ircstyle.style("general <title> [--tags <tags>]", fg="yellow") + " - View or update a general note with the given title. Optionally, specify tags.\n"
help_msg += ircstyle.style("list [daily|general]", fg="yellow") + " - List all notes of a specific type (either 'daily' or 'general').\n"
help_msg += ircstyle.style("search <type> <keyword>", fg="yellow") + " - Search for a keyword in notes of a specific type.\n"
help_msg += ircstyle.style("summary", fg="yellow") + " - Display a summary of note counts.\n"
self.bot.privmsg(target, help_msg)
elif args.get('today'):
await self._note_today(mask, target, args)
elif args.get('daily'):
await self._note_daily(mask, target, args)
@ -202,8 +214,7 @@ class NoteTaking:
elif args.get('summary'):
await self._note_summary(target)
else:
help_msg = ircstyle.style("Usage: !note <subcommand> [options]\n", fg="red", bold=True)
help_msg += "Subcommands: today, daily, general, list, search, summary"
help_msg = ircstyle.style("Invalid subcommand! Use !note for a list of available commands.\n", fg="red", bold=True)
self.bot.privmsg(target, help_msg)
except Exception as e:
self.bot.log.error(f"Error processing note command: {e}", exc_info=True)