From 1ddf5ed1132bc01daaab36d0fbe488bfbd942385 Mon Sep 17 00:00:00 2001 From: DiamondIceNS Date: Sat, 28 Sep 2019 11:28:53 -0500 Subject: [PATCH] Update to version 2.0 - Removed all reference to pixelplanet.fun at webmaster's request - Removed all reference to Pixelz.io in Turkish lang file - Updated to 2.0. Should have been 1.10 but I made the Version column a REAL instead of a VARCHAR like a nitwit and I don't want to fix it. --- README.md | 2 +- commands/canvas.py | 30 ++---------------------- commands/configuration.py | 8 ------- commands/template.py | 24 ++------------------ lang/en_US.py | 47 -------------------------------------- lang/pt_BR.py | 38 ------------------------------- lang/tr_TR.py | 37 ------------------------------ objects/chunks.py | 48 --------------------------------------- utils/__init__.py | 4 ---- utils/canvases.py | 6 ++--- utils/colors.py | 30 +----------------------- utils/http.py | 36 +---------------------------- utils/render.py | 15 +----------- utils/sqlite.py | 7 ++++++ utils/version.py | 2 +- 15 files changed, 18 insertions(+), 316 deletions(-) diff --git a/README.md b/README.md index 9cf1ceb..c7d6736 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Starlight Glimmer A template utility bot based on [Alastair](Make-Alastair-Great-Again) and [Pinkie Pie](https://pastebin.com/Tg1p5AnW). -Currently supports [Pixelcanvas.io](https://pixelcanvas.io/), [Pixelzone.io](https://pixelzone.io/), [Pxls.space](https://pxls.space/), and [Pixelplace.fun](https://pixelplace.fun/). +Currently supports [Pixelcanvas.io](https://pixelcanvas.io/), [Pixelzone.io](https://pixelzone.io/), and [Pxls.space](https://pxls.space/). **Invite:** `https://discordapp.com/oauth2/authorize?&client_id=405480380930588682&scope=bot&permissions=109569` diff --git a/commands/canvas.py b/commands/canvas.py index f3812b1..ee365b3 100644 --- a/commands/canvas.py +++ b/commands/canvas.py @@ -69,8 +69,7 @@ async def diff(self, ctx, *args): fetchers = { 'pixelcanvas': render.fetch_pixelcanvas, 'pixelzone': render.fetch_pixelzone, - 'pxlsspace': render.fetch_pxlsspace, - 'pixelplanet': render.fetch_pixelplanet, + 'pxlsspace': render.fetch_pxlsspace } diff_img, tot, err, bad, err_list \ @@ -123,11 +122,6 @@ async def diff_pixelzone(self, ctx, *args): async def diff_pxlsspace(self, ctx, *args): await _diff(ctx, args, "pxlsspace", render.fetch_pxlsspace, colors.pxlsspace) - @commands.cooldown(1, 5, BucketType.guild) - @diff.command(name="pixelplanet", aliases=["pp"]) - async def diff_pixelplanet(self, ctx, *args): - await _diff(ctx, args, "pixelplanet", render.fetch_pixelplanet, colors.pixelplanet) - # ======================= # PREVIEW # ======================= @@ -177,8 +171,7 @@ async def preview(self, ctx, *args): fetchers = { 'pixelcanvas': render.fetch_pixelcanvas, 'pixelzone': render.fetch_pixelzone, - 'pxlsspace': render.fetch_pxlsspace, - 'pixelplanet': render.fetch_pixelplanet + 'pxlsspace': render.fetch_pxlsspace } if preview_template_region: @@ -210,11 +203,6 @@ async def preview_pixelzone(self, ctx, *args): async def preview_pxlsspace(self, ctx, *args): await _preview(ctx, args, render.fetch_pxlsspace) - @commands.cooldown(1, 5, BucketType.guild) - @preview.command(name="pixelplanet", aliases=["pp"]) - async def preview_pixelplanet(self, ctx, *args): - await _preview(ctx, args, render.fetch_pixelplanet) - # ======================= # QUANTIZE # ======================= @@ -239,11 +227,6 @@ async def quantize_pixelzone(self, ctx, *args): async def quantize_pxlsspace(self, ctx, *args): await _quantize(ctx, args, "pxlsspace", colors.pxlsspace) - @commands.cooldown(1, 5, BucketType.guild) - @quantize.command(name="pixelplanet", aliases=["pp"]) - async def quantize_pixelplanet(self, ctx, *args): - await _quantize(ctx, args, "pixelplanet", colors.pixelplanet) - # ======================= # GRIDIFY # ======================= @@ -327,10 +310,6 @@ async def ditherchart_pixelzone(self, ctx): async def ditherchart_pxlsspace(self, ctx): await ctx.send(file=discord.File("assets/dither_chart_pxlsspace.png", "dither_chart_pxlsspace.png")) - @ditherchart.command(name="pixelplanet", aliases=["pp"]) - async def ditherchart_pixelplanet(self, ctx): - await ctx.send(file=discord.File("assets/dither_chart_pixelcanvas.png", "dither_chart_pixelcanvas.png")) - # ====================== # REPEAT # ====================== @@ -379,11 +358,6 @@ async def online_pxlsspace(self, ctx): ct = await http.fetch_online_pxlsspace() await msg.edit(content=ctx.s("canvas.online").format(ct, "Pxls.space")) - @online.command(name="pixelplanet", aliases=["pp"]) - async def online_pixelplanet(self, ctx): - ct = await http.fetch_online_pixelplanet() - await ctx.send(ctx.s("canvas.online").format(ct, "Pixelplanet")) - async def _diff(ctx, args, canvas, fetch, palette): async with ctx.typing(): diff --git a/commands/configuration.py b/commands/configuration.py index d5bb99b..1a0f68b 100644 --- a/commands/configuration.py +++ b/commands/configuration.py @@ -96,14 +96,6 @@ async def canvas_pxlsspace(self, ctx): log.info("Default canvas for {0.name} set to pxlsspace (GID:{0.id})".format(ctx.guild)) await ctx.send(ctx.s("configuration.canvas_set").format("Pxls.space")) - @checks.admin_only() - @commands.guild_only() - @canvas.command(name="pixelplanet", aliases=["pp"]) - async def canvas_pixelplanet(self, ctx): - sql.guild_update(ctx.guild.id, canvas="pixelplanet") - log.info("Default canvas for {0.name} set to pixelplanet (GID:{0.id})".format(ctx.guild)) - await ctx.send(ctx.s("configuration.canvas_set").format("Pixelplanet.fun")) - @checks.admin_only() @commands.guild_only() @commands.command() diff --git a/commands/template.py b/commands/template.py index 591d9dc..f3efcd1 100644 --- a/commands/template.py +++ b/commands/template.py @@ -17,7 +17,7 @@ from PIL import Image, ImageChops from objects import DbTemplate -from objects.chunks import BigChunk, ChunkPz, ChunkPP, PxlsBoard +from objects.chunks import BigChunk, ChunkPz, PxlsBoard from objects.errors import FactionNotFoundError, NoTemplatesError, PilImageError, TemplateNotFoundError, UrlError import utils from utils import canvases, checks, colors, config, http, render, sqlite as sql @@ -148,13 +148,6 @@ async def template_add_pixelzone(self, ctx, name: str, x: int, y: int, url=None) async def template_add_pxlsspace(self, ctx, name: str, x: int, y: int, url=None): await self.add_template(ctx, "pxlsspace", name, x, y, url) - @commands.guild_only() - @commands.cooldown(1, 5, BucketType.guild) - @checks.template_adder_only() - @template_add.command(name="pixelplanet", aliases=['pp']) - async def template_add_pixelplanet(self, ctx, name: str, x: int, y: int, url=None): - await self.add_template(ctx, "pixelplanet", name, x, y, url) - @commands.guild_only() @commands.cooldown(1, 60, BucketType.guild) @template.group(name='check') @@ -212,18 +205,6 @@ async def template_check_pxlsspace(self, ctx): await msg.delete() await _build_template_report(ctx, ts) - @commands.guild_only() - @template_check.command(name='pixelplanet', aliases=['pp']) - async def template_check_pixelplanet(self, ctx): - ts = [x for x in sql.template_get_all_by_guild_id(ctx.guild.id) if x.canvas == 'pixelplanet'] - if len(ts) <= 0: - ctx.command.parent.reset_cooldown(ctx) - raise NoTemplatesError(True) - ts = sorted(ts, key=lambda tx: tx.name) - msg = await _check_canvas(ctx, ts, "pixelplanet") - await msg.delete() - await _build_template_report(ctx, ts) - @commands.guild_only() @commands.cooldown(1, 5, BucketType.guild) @template.command(name='info', aliases=['i']) @@ -466,8 +447,7 @@ async def _check_canvas(ctx, templates, canvas, msg=None): chunk_classes = { 'pixelcanvas': BigChunk, 'pixelzone': ChunkPz, - 'pxlsspace': PxlsBoard, - 'pixelplanet': ChunkPP + 'pxlsspace': PxlsBoard } chunks = set() diff --git a/lang/en_US.py b/lang/en_US.py index 8348cc0..582a62b 100644 --- a/lang/en_US.py +++ b/lang/en_US.py @@ -181,19 +181,16 @@ "brief.canvas.pixelcanvas": "Sets the default canvas to Pixelcanvas.io.", "brief.canvas.pixelzone": "Sets the default canvas to Pixelzone.io.", "brief.canvas.pxlsspace": "Sets the default canvas to Pxls.space.", - "brief.canvas.pixelplanet": "Sets the default canvas to Pixelplanet.fun.", "brief.changelog": "Gets a link to my releases page.", "brief.diff": "Checks completion status of a template on a canvas.", "brief.diff.pixelcanvas": "Creates a diff using Pixelcanvas.io.", "brief.diff.pixelzone": "Creates a diff using Pixelzone.io.", "brief.diff.pxlsspace": "Creates a diff using Pxls.space.", - "brief.diff.pixelplanet": "Creates a diff using Pixelplanet.fun.", "brief.disband": "Disband this guild's faction.", "brief.ditherchart": "Gets a chart of canvas colors dithered together.", "brief.ditherchart.pixelcanvas": "Gets a dither chart of Pixelcanvas.io colors.", "brief.ditherchart.pixelzone": "Gets a dither chart of Pixelzone.io colors.", "brief.ditherchart.pxlsspace": "Gets a dither chart of Pxls.space colors.", - "brief.ditherchart.pixelplanet": "Gets a dither chart of Pixelplanet.fun colors.", "brief.faction": "Manages this guild's faction.", "brief.faction.name": "View or modify the name of this guild's faction.", "brief.faction.name.set": "Set the name of this guild's faction.", @@ -225,19 +222,16 @@ "brief.online.pixelcanvas": "Shows how many players are currently online on Pixelcanvas.io.", "brief.online.pixelzone": "Shows how many players are currently online on Pixelzone.io.", "brief.online.pxlsspace": "Shows how many players are currently online on Pxls.space.", - "brief.online.pixelplanet": "Shows how many players are currently online on Pixelplanet.fun.", "brief.ping": "Pong!", "brief.prefix": "Sets my command prefix for this guild.", "brief.preview": "Previews the canvas at a given coordinate or template.", "brief.preview.pixelcanvas": "Creates a preview using Pixelcanvas.io.", "brief.preview.pixelzone": "Creates a preview using Pixelzone.io.", "brief.preview.pxlsspace": "Creates a preview using Pxls.space.", - "brief.preview.pixelplanet": "Creates a preview using Pixelplanet.fun.", "brief.quantize": "Rough converts an image to the palette of a canvas.", "brief.quantize.pixelcanvas": "Quantizes colors using the palette of Pixelcanvas.io.", "brief.quantize.pixelzone": "Quantizes colors using the palette of Pixelzone.io.", "brief.quantize.pxlsspace": "Quantizes colors using the palette of Pxls.space.", - "brief.quantize.pixelplanet": "Quantizes colors using the palette of Pixelplanet.fun.", "brief.register": "Opt-in to animated emoji replacement.", "brief.repeat": "Repeats the last used canvas command.", "brief.role": "Assign bot privileges to a role.", @@ -256,13 +250,11 @@ "brief.template.add.pixelcanvas": "Adds a template for Pixelcanvas.io.", "brief.template.add.pixelzone": "Adds a template for Pixelzone.io.", "brief.template.add.pxlsspace": "Adds a template for Pxls.space.", - "brief.template.add.pixelplanet": "Adds a template for Pixelplanet.fun.", "brief.template.all": "List all templates for all factions.", "brief.template.check": "Check the completion status of all templates.", "brief.template.check.pixelcanvas": "Check the completion status of all Pixelcanvas.io templates.", "brief.template.check.pixelzone": "Check the completion status of all Pixelzone.io templates.", "brief.template.check.pxlsspace": "Check the completion status of all Pxls.space templates.", - "brief.template.check.pixelplanet": "Check the completion status of all Pixelplanet.fun templates.", "brief.template.info": "Displays info about a template.", "brief.template.remove": "Removes a template.", "brief.unhide": "Unhide a faction from public lists.", @@ -326,7 +318,6 @@ "signature.diff.pixelcanvas": "(-e) (zoom)", "signature.diff.pixelzone": "(-e) (zoom)", "signature.diff.pxlsspace": "(-e) (zoom)", - "signature.diff.pixelplanet": "(-e) (zoom)", "signature.ditherchart": "(subcommand)", "signature.faction": "(subcommand)", "signature.faction.name": "(subcommand)", @@ -350,12 +341,10 @@ "signature.preview.pixelcanvas": " (zoom)", "signature.preview.pixelzone": " (zoom)", "signature.preview.pxlsspace": " (zoom)", - "signature.preview.pixelplanet": " (zoom)", "signature.quantize": "(subcommand)", "signature.quantize.pixelcanvas": ["", "