Mercurial > codedump
changeset 24:7eccf59ddec0
Update pixivimageposter.py
- replace "No Category" with "Commands"
- replace english pixiv link with a more non-english speaker friendly link (nobody who uses this will speak anything but english anyway but who knows)
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Fri, 09 Apr 2021 23:31:47 -0400 |
parents | f29f1441f146 |
children | 704432ea7eac |
files | pixivimageposter.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/pixivimageposter.py Fri Apr 09 23:15:09 2021 -0400 +++ b/pixivimageposter.py Fri Apr 09 23:31:47 2021 -0400 @@ -1,13 +1,14 @@ import glob, os, random, discord from discord.ext import commands -client = commands.Bot(command_prefix = '!!') +help_command = commands.DefaultHelpCommand(no_category="Commands") +client = commands.Bot(command_prefix = '!!',help_command = help_command) @client.event async def on_ready(): print("Ready!") -@client.command() +@client.command(help = "Posts a random image from my pixiv bookmarks") async def pixiv(ctx): files = glob.glob("*.png") files.extend(glob.glob("*.jpg")) @@ -23,7 +24,7 @@ it then removes "p" which just gets in the way, converts it to an integer, and adds 1 to it because pixivutil2 uses an initial zero in numbering ''' link1 = file.split("_", 1)[0] - link2 = int(file.split("_", 1)[1].split(" ", 1)[0].replace('p', '')) + 1 - await ctx.send("https://pixiv.net/en/artworks/" + link1 + ", Image " + str(link2),file = discord.File(file)) + link2 = int(file.split("_", 1)[1].split(" ", 1)[0].replace('p', ''))+1 + await ctx.send("https://pixiv.net/member_illust.php?mode=medium&illust_id=" + link1 + ", Image " + str(link2),file = discord.File(file)) client.run("token")