1
0
Fork 0
mirror of https://github.com/myned/modufur.git synced 2024-11-01 13:02:38 +00:00

Remove periods from responses

This commit is contained in:
Myned 2022-03-03 23:57:35 -06:00
parent e9a284fa99
commit 41b3577bd8
No known key found for this signature in database
GPG key ID: 33790F979F7A28B8
3 changed files with 18 additions and 18 deletions

View file

@ -21,7 +21,7 @@ async def reverse(context):
urls = extractor.find_urls(context.options.url or "", only_unique=True, with_schema_only=True) urls = extractor.find_urls(context.options.url or "", only_unique=True, with_schema_only=True)
if not urls: if not urls:
await context.respond("**Invalid URL(s).**") await context.respond("***Invalid URL(s)***")
return return
await _reverse(context, urls) await _reverse(context, urls)
@ -30,7 +30,7 @@ async def reverse(context):
urls += [attachment.url for attachment in context.options.target.attachments if attachment.url not in urls] urls += [attachment.url for attachment in context.options.target.attachments if attachment.url not in urls]
if not urls: if not urls:
await context.respond("**No images found.**") await context.respond("***No images found***")
return return
selector = None selector = None
@ -49,7 +49,7 @@ async def reverse(context):
await selector.wait() await selector.wait()
if selector.timed_out: if selector.timed_out:
await context.interaction.edit_initial_response("**Timed out.**", components=None) await context.interaction.edit_initial_response("***Timed out***", components=None)
return return
urls = selector.selected urls = selector.selected
@ -63,17 +63,17 @@ async def on_reverse_error(event):
match event.exception.__cause__: match event.exception.__cause__:
case pysaucenao.ShortLimitReachedException(): case pysaucenao.ShortLimitReachedException():
error = "**API limit reached. Please try again in a minute.**" error = "***API limit reached. Please try again in a minute***"
case pysaucenao.DailyLimitReachedException(): case pysaucenao.DailyLimitReachedException():
error = "**Daily API limit reached. Please try again tomorrow.**" error = "***Daily API limit reached. Please try again tomorrow***"
case pysaucenao.FileSizeLimitException() as url: case pysaucenao.FileSizeLimitException() as url:
error = f"**Image file size too large.**\n{url}" error = f"***Image file size too large***\n{url}"
case pysaucenao.ImageSizeException() as url: case pysaucenao.ImageSizeException() as url:
error = f"**Image resolution too small.**\n{url}" error = f"***Image resolution too small***\n{url}"
case pysaucenao.InvalidImageException() as url: case pysaucenao.InvalidImageException() as url:
error = f"**Invalid image.**\n{url}" error = f"***Invalid image***\n{url}"
case pysaucenao.UnknownStatusCodeException(): case pysaucenao.UnknownStatusCodeException():
error = "**An unknown SauceNAO error has occurred. The service may be down.**" error = "***An unknown SauceNAO error has occurred. The service may be down***"
if error: if error:
try: try:
@ -92,9 +92,9 @@ async def _reverse(context, urls, *, selector=None):
if not matches: if not matches:
if selector: if selector:
await context.interaction.edit_initial_response("**No matches found.**", components=None) await context.interaction.edit_initial_response("***No matches found***", components=None)
else: else:
await context.respond("**No matches found.**") await context.respond("***No matches found***")
return return
pages = [ pages = [
@ -109,7 +109,7 @@ async def _reverse(context, urls, *, selector=None):
.set_footer(match["source"]) .set_footer(match["source"])
) )
if match if match
else f"**No match found.**\n{urls[index]}" else f"***No match found***\n{urls[index]}"
for index, match in enumerate(matches) for index, match in enumerate(matches)
] ]

View file

@ -20,19 +20,19 @@ async def master(context):
extensions = [os.path.splitext(extension)[1][1:] for extension in context.bot.extensions] extensions = [os.path.splitext(extension)[1][1:] for extension in context.bot.extensions]
await context.respond( await context.respond(
f"**Reloaded `{'`, `'.join(extensions[:-1])}`, and `{extensions[-1]}` for you, master.**" f"**Reloaded `{'`, `'.join(extensions[:-1])}`, and `{extensions[-1]}` for you, master**"
) )
case "sleep": case "sleep":
await context.respond("**Goodnight, master.**") await context.respond("**Goodnight, master**")
await context.bot.close() await context.bot.close()
case "invite": case "invite":
await context.respond( await context.respond(
f"https://discord.com/api/oauth2/authorize?client_id={c.config['client']}&permissions=1024&scope=bot%20applications.commands" f"https://discord.com/api/oauth2/authorize?client_id={c.config['client']}&permissions=1024&scope=bot%20applications.commands"
) )
case _: case _:
await context.respond(f"**Hello, master.**") await context.respond(f"**Hello, master**")
else: else:
await context.respond(f"**{context.bot.application.owner.mention} is my master. 🐺**") await context.respond(f"**{context.bot.application.owner.mention} is my master 🐺**")
def load(bot): def load(bot):

View file

@ -3,7 +3,7 @@ import hikari
ACTIVITY = hikari.ActivityType.LISTENING ACTIVITY = hikari.ActivityType.LISTENING
ERROR = "```❗ An internal error has occurred. This has been reported to my master. 🐺```" ERROR = "```❗ An internal error has occurred. This has been reported to my master 🐺```"
CONFIG = """\ CONFIG = """\
guilds = [] # guild IDs to register commands, empty for global guilds = [] # guild IDs to register commands, empty for global
master = 0 # guild ID to register owner commands master = 0 # guild ID to register owner commands
@ -20,7 +20,7 @@ try:
except FileNotFoundError: except FileNotFoundError:
with open("config.toml", "w") as f: with open("config.toml", "w") as f:
f.write(CONFIG) f.write(CONFIG)
print("config.toml created with default values. Restart when modified.") print("config.toml created with default values. Restart when modified")
exit() exit()