|
56 | 56 | $.setIniDbBoolean('clipsSettings', 'toggle', toggle);
|
57 | 57 | $.say($.whisperPrefix(sender) + (toggle ? $.lang.get('cliphandler.toggle.on') : $.lang.get('cliphandler.toggle.off')));
|
58 | 58 | }
|
59 |
| - |
60 | 59 |
|
61 | 60 | /*
|
62 | 61 | * @commandpath clipsmessage - Sets a message for when someone creates a clip.
|
|
71 | 70 | $.setIniDbString('clipsSettings', 'message', message);
|
72 | 71 | $.say($.whisperPrefix(sender) + $.lang.get('cliphandler.message.set', message));
|
73 | 72 | }
|
| 73 | + |
| 74 | + /* |
| 75 | + * @commandpath lastclip - Displays information about the last clip captured. |
| 76 | + */ |
| 77 | + if (command.equalsIgnoreCase('lastclip')) { |
| 78 | + var url = $.getIniDbString('streamInfo', 'last_clip_url', $.lang.get('cliphandler.noclip')); |
| 79 | + $.say($.whisperPrefix(sender) + $.lang.get('cliphandler.lastclip', url)); |
| 80 | + } |
| 81 | + |
| 82 | + /* |
| 83 | + * @commandpath topclip - Displays the top clip from the past day. |
| 84 | + */ |
| 85 | + if (command.equalsIgnoreCase('topclip')) { |
| 86 | + var url = $.getIniDbString('streamInfo', 'most_viewed_clip_url', $.lang.get('cliphandler.noclip')); |
| 87 | + $.say($.whisperPrefix(sender) + $.lang.get('cliphandler.topclip', url)); |
| 88 | + } |
74 | 89 | });
|
75 | 90 |
|
76 | 91 | /*
|
77 | 92 | * @event initReady
|
78 | 93 | */
|
79 | 94 | $.bind('initReady', function() {
|
80 |
| - $.registerChatCommand('./handlers/clipHandler.js', 'clipstoggle', 1); |
81 |
| - $.registerChatCommand('./handlers/clipHandler.js', 'clipsmessage', 1); |
| 95 | + if ($.bot.isModuleEnabled('./handlers/clipHandler.js')) { |
| 96 | + $.registerChatCommand('./handlers/clipHandler.js', 'clipstoggle', 1); |
| 97 | + $.registerChatCommand('./handlers/clipHandler.js', 'clipsmessage', 1); |
| 98 | + $.registerChatCommand('./handlers/clipHandler.js', 'lastclip', 7); |
| 99 | + $.registerChatCommand('./handlers/clipHandler.js', 'topclip', 7); |
| 100 | + } |
82 | 101 | });
|
83 | 102 |
|
84 | 103 | $.reloadClips = reloadClips;
|
|
0 commit comments