Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: Catch set commands without arguments #1520

Merged
merged 1 commit into from
Apr 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sopel/modules/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def set_config(bot, trigger):
If value is None, the option will be deleted.
"""
# Get section and option from first argument.
arg1 = trigger.group(3).split('.')
match = trigger.group(3)
if match is None:
bot.reply("Usage: .set section.option value")
return
arg1 = match.split('.')
if len(arg1) == 1:
section_name, option = "core", arg1[0]
elif len(arg1) == 2:
Expand Down