Skip to content

Commit 8c572f3

Browse files
committed
[ns] improve error for non-owners
1 parent 811ba0f commit 8c572f3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

nationstates/nationstates.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,15 @@ async def cog_command_error(self, ctx: commands.Context, error: commands.Command
181181
f"{original.response.status_code}: {' '.join(original.args)}"
182182
)
183183
elif isinstance(original, sans.AgentNotSetError):
184+
if await ctx.bot.is_owner(ctx.author):
185+
return await ctx.send(
186+
f"User agent has not yet been set. Set it with `{ctx.clean_prefix}agent`.\n"
187+
"```The API Terms of Use require your script to supply a useful UserAgent string, "
188+
"so we can contact you in the event of problems. Please give your script a UserAgent "
189+
"that includes your contact details, such as an email, URL, or nation name.```"
190+
)
184191
return await ctx.send(
185-
f"User agent has not yet been set. Set it with `{ctx.clean_prefix}agent`.\n"
186-
"```The API Terms of Use require your script to supply a useful UserAgent string, "
187-
"so we can contact you in the event of problems. Please give your script a UserAgent "
188-
"that includes your contact details, such as an email, URL, or nation name.```"
192+
"User agent has not yet been set. Please contact my owner to set it."
189193
)
190194
return await ctx.bot.on_command_error(ctx, error, unhandled_by_cog=True) # type: ignore
191195

0 commit comments

Comments
 (0)