diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f8e8e99 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2017 The Fuel Rats Mischief, +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/sopel-modules/rat-board.py b/sopel-modules/rat-board.py index 06ee5f6..8933480 100644 --- a/sopel-modules/rat-board.py +++ b/sopel-modules/rat-board.py @@ -1010,14 +1010,24 @@ def cmd_grab(bot, trigger, client): @commands('inject') +@parameterize("wT", usage=" ") +@require_rat('Sorry, you need to be a registered and drilled Rat to use this command.') +# Using this to prevent cases from created if they are not found, therefor created, but no line to add was specified. +def cmd_inject(bot, trigger, case, line): + """ + Inject a custom line of text into the client's case. + required parameters: Client name or case number, quote to add. + """ + func_inject(bot, trigger) + @ratlib.sopel.filter_output @parameterize('FT', usage=' ') -@require_rat('Sorry, you need to be a registered and drilled Rat to use this command.') -def cmd_inject(bot, trigger, find_result, line): +def func_inject(bot, trigger, find_result, line): """ Inject a custom line of text into the client's case. required parameters: Client name or case number, quote to add. """ + # Can probably be removed, keeping it with the above comment so s/o else later understands it. if not line: raise UsageError() result = append_quotes(bot, find_result, line, create=True) @@ -1490,6 +1500,7 @@ def cmd_reopen(bot, trigger, id): try: result = callapi(bot, 'PUT', data={'open': True}, uri='/rescues/' + str(id), triggernick=str(trigger.nick)) refresh_cases(bot, force=True) + updateBoardIndexes(bot) bot.say('Reopened case. Cases refreshed, care for your case numbers!') except ratlib.api.http.APIError: # print('[RatBoard] apierror.') @@ -1545,6 +1556,7 @@ def cmd_mdlist(bot, trigger): @commands('quoteid') @require_overseer(message='Sorry pal, you\'re not an overseer or higher!') @parameterize('+', usage='') +@ratlib.sopel.filter_output def cmd_quoteid(bot, trigger, id): """ Quotes a case by its database id diff --git a/sopel-modules/rat-facts.py b/sopel-modules/rat-facts.py index 9bb3819..f529ae0 100644 --- a/sopel-modules/rat-facts.py +++ b/sopel-modules/rat-facts.py @@ -339,10 +339,14 @@ def _translation_stats(exists, missing, s='translation', p='translations'): _translation_stats(exists, missing, s=opposite_name_s, p=opposite_name_p) ) if full: - pm(summary) + lines = textwrap.wrap(summary, 400, break_long_words=False) + for l in lines: + pm(l) return NOLIMIT else: - bot.say(summary) + lines = textwrap.wrap(summary, 400, break_long_words=False) + for l in lines: + bot.say(l) return NOLIMIT bot.reply("'{}' is not a known fact, language, or subcommand".format(command))