update notes and alias for yt
This commit is contained in:
parent
34abd50f95
commit
fcd8b4de17
@ -168,7 +168,7 @@ class YouTubePlugin:
|
|||||||
f"\x0312https://youtu.be/{info['videoId']}\x0F\x03"
|
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):
|
async def yt(self, mask, target, args):
|
||||||
"""
|
"""
|
||||||
%%yt [--<amount>] <search_query>...
|
%%yt [--<amount>] <search_query>...
|
||||||
|
@ -168,7 +168,8 @@ class NoteTaking:
|
|||||||
self.User = Query()
|
self.User = Query()
|
||||||
self.log = logging.getLogger(__name__)
|
self.log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@command
|
|
||||||
|
@command(aliases=['notes'], public=True)
|
||||||
async def note(self, mask, target, args):
|
async def note(self, mask, target, args):
|
||||||
"""
|
"""
|
||||||
Unified note command.
|
Unified note command.
|
||||||
@ -189,7 +190,18 @@ class NoteTaking:
|
|||||||
<keyword> Keyword to search in notes.
|
<keyword> Keyword to search in notes.
|
||||||
"""
|
"""
|
||||||
try:
|
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)
|
await self._note_today(mask, target, args)
|
||||||
elif args.get('daily'):
|
elif args.get('daily'):
|
||||||
await self._note_daily(mask, target, args)
|
await self._note_daily(mask, target, args)
|
||||||
@ -202,8 +214,7 @@ class NoteTaking:
|
|||||||
elif args.get('summary'):
|
elif args.get('summary'):
|
||||||
await self._note_summary(target)
|
await self._note_summary(target)
|
||||||
else:
|
else:
|
||||||
help_msg = ircstyle.style("Usage: !note <subcommand> [options]\n", fg="red", bold=True)
|
help_msg = ircstyle.style("Invalid subcommand! Use !note for a list of available commands.\n", fg="red", bold=True)
|
||||||
help_msg += "Subcommands: today, daily, general, list, search, summary"
|
|
||||||
self.bot.privmsg(target, help_msg)
|
self.bot.privmsg(target, help_msg)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.bot.log.error(f"Error processing note command: {e}", exc_info=True)
|
self.bot.log.error(f"Error processing note command: {e}", exc_info=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user