Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Update to version 2.0
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
DiamondIceNS committed Sep 28, 2019
1 parent fa8b7ba commit 1ddf5ed
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 316 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
30 changes: 2 additions & 28 deletions commands/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
# =======================
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
# =======================
Expand All @@ -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
# =======================
Expand Down Expand Up @@ -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
# ======================
Expand Down Expand Up @@ -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():
Expand Down
8 changes: 0 additions & 8 deletions commands/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
24 changes: 2 additions & 22 deletions commands/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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'])
Expand Down Expand Up @@ -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()
Expand Down
47 changes: 0 additions & 47 deletions lang/en_US.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand All @@ -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.",
Expand Down Expand Up @@ -326,7 +318,6 @@
"signature.diff.pixelcanvas": "(-e) <coordinates> (zoom)",
"signature.diff.pixelzone": "(-e) <coordinates> (zoom)",
"signature.diff.pxlsspace": "(-e) <coordinates> (zoom)",
"signature.diff.pixelplanet": "(-e) <coordinates> (zoom)",
"signature.ditherchart": "(subcommand)",
"signature.faction": "(subcommand)",
"signature.faction.name": "(subcommand)",
Expand All @@ -350,12 +341,10 @@
"signature.preview.pixelcanvas": "<coordinates> (zoom)",
"signature.preview.pixelzone": "<coordinates> (zoom)",
"signature.preview.pxlsspace": "<coordinates> (zoom)",
"signature.preview.pixelplanet": "<coordinates> (zoom)",
"signature.quantize": "(subcommand)",
"signature.quantize.pixelcanvas": ["", "<template>"],
"signature.quantize.pixelzone": ["", "<template>"],
"signature.quantize.pxlsspace": ["", "<template>"],
"signature.quantize.pixelplanet": ["", "<template>"],
"signature.role": "(role)",
"signature.role.botadmin": "(subcommand)",
"signature.role.botadmin.set": "<role>",
Expand All @@ -369,7 +358,6 @@
"signature.template.add.pixelcanvas": "<name> <x> <y> (url)",
"signature.template.add.pixelzone": "<name> <x> <y> (url)",
"signature.template.add.pxlsspace": "<name> <x> <y> (url)",
"signature.template.add.pixelplanet": "<name> <x> <y> (url)",
"signature.template.check": "(subcommand)",
"signature.template.info": "(-r) (-f faction) <template> (zoom)",
"signature.template.remove": "<template>",
Expand All @@ -395,8 +383,6 @@
("100 100 7", "(with an attachment) Check an image against Pixelzone.io at (100, 100) and magnify the result 7 times")],
"example.diff.pxlsspace": [("100 100", "(with an attachment) Check an image against Pxls.space at (100, 100)"),
("100 100 7", "(with an attachment) Check an image against Pxls.space at (100, 100) and magnify the result 7 times")],
"example.diff.pixelplanet": [("100 100", "(with an attachment) Check an image against Pixelplanet.fun at (100, 100)"),
("100 100 7", "(with an attachment) Check an image against Pixelplanet.fun at (100, 100) and magnify the result 7 times")],
"example.ditherchart": [("pc", "Get the ditherchart for Pixelcanvas.io")],
"example.faction": [("name", "Print your faction's current name"),
("desc set Hello World!", "Sets your faction's description to 'Hello World!'"),
Expand Down Expand Up @@ -446,9 +432,6 @@
"example.preview.pxlsspace": [("900 900", "Preview Pxls.space centered on (900, 900)"),
("900 900 7", "Preview Pxls.space centered on (900, 900) magnified 7 times"),
("900 900 -7", "Preview Pxls.space centered on (900, 900) zoomed out 7 times")],
"example.preview.pixelplanet": [("900 900", "Preview Pixelplanet.fun centered on (900, 900)"),
("900 900 7", "Preview Pixelplanet.fun centered on (900, 900) magnified 7 times"),
("900 900 -7", "Preview Pixelplanet.fun centered on (900, 900) zoomed out 7 times")],
"example.quantize": [("", "(with an attachment) Quantize an attachment to the palette of the default canvas"),
("pc", "(with an attachment) Quantize an attachment to the palette of Pixelcanvas.io"),
("pc MyTemplate", "Quantize a template named 'MyTemplate' to the palette of Pixelcanvas.io")],
Expand All @@ -458,8 +441,6 @@
("MyTemplate", "Quantize a template named 'MyTemplate' to the palette of Pixelzone.io")],
"example.quantize.pxlsspace": [("", "(with an attachment) Quantize an attachment to the palette of Pxls.space"),
("MyTemplate", "Quantize a template named 'MyTemplate' to the palette of Pxls.space")],
"example.quantize.pixelplanet": [("", "(with an attachment) Quantize an attachment to the palette of Pixelplanet.fun"),
("MyTemplate", "Quantize a template named 'MyTemplate' to the palette of Pixelplanet.fun")],
"example.role": [("", "Show the available permissions"),
("botadmin", "Show the role tied to the botadmin permission"),
("botadmin set admin-role", "Set the botadmin permission to a role called 'admin-role'")],
Expand Down Expand Up @@ -489,8 +470,6 @@
("MyTemplate 100 100 https://cdn.discordapp.com/.../avatar.jpg", "Create a template named 'MyTemplate' for Pixelzone.io at (100, 100) using the image at the URL")],
"example.template.add.pxlsspace": [("MyTemplate 100 100", "(with an attachment) Create a template named 'MyTemplate' for Pxls.space at (100, 100)"),
("MyTemplate 100 100 https://cdn.discordapp.com/.../avatar.jpg", "Create a template named 'MyTemplate' for Pxls.space at (100, 100) using the image at the URL")],
"example.template.add.pixelplanet": [("MyTemplate 100 100", "(with an attachment) Create a template named 'MyTemplate' for Pixelplanet.fun at (100, 100)"),
("MyTemplate 100 100 https://cdn.discordapp.com/.../avatar.jpg", "Create a template named 'MyTemplate' for Pixelplanet.fun at (100, 100) using the image at the URL")],
"example.template.check": [("", "Check completion status of all this guild's templates"),
("pc", "Check completion status of all this guild's Pixelcanvas.io templates")],
"example.template.info": [("MyTemplate", "Get info on a template named 'MyTemplate'"),
Expand Down Expand Up @@ -564,30 +543,4 @@
"color.pxlssapce.22": "Magenta",
"color.pxlssapce.23": "Purple",

"color.pixelplanet.0": "White",
"color.pixelplanet.1": "White",
"color.pixelplanet.2": "Light Grey",
"color.pixelplanet.3": "Grey",
"color.pixelplanet.4": "Dark Grey",
"color.pixelplanet.5": "Black",
"color.pixelplanet.6": "Light Pink",
"color.pixelplanet.7": "Pink",
"color.pixelplanet.8": "Peach",
"color.pixelplanet.9": "Red",
"color.pixelplanet.10": "Light Brown",
"color.pixelplanet.11": "Orange",
"color.pixelplanet.12": "Brown",
"color.pixelplanet.13": "Sand",
"color.pixelplanet.14": "Yellow",
"color.pixelplanet.15": "Light Green",
"color.pixelplanet.16": "Green",
"color.pixelplanet.17": "Dark Green",
"color.pixelplanet.18": "Sky Blue",
"color.pixelplanet.19": "Cyan",
"color.pixelplanet.20": "Teal",
"color.pixelplanet.21": "Blue",
"color.pixelplanet.22": "Dark Blue",
"color.pixelplanet.23": "Light Purple",
"color.pixelplanet.24": "Purple",

}
Loading

0 comments on commit 1ddf5ed

Please sign in to comment.