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

Commit

Permalink
Version 1.2
Browse files Browse the repository at this point in the history
+ Added support for Pixelzone.io
+ Added quantize command
+ Added repeat command
+ Added ditherchart command
+ Added support for multiple language files
* Refactored rendering code to reduce repeated code
* Folded diff, preview, alertchannel, and setdefaultcanvas into
  subcommand architecture
* Rewrote all of the command help strings
* Fixed database version not initializing properly
* Logger now logs to the data folder
* Added 'name' field to config
* Updated licenses
* Updated README
- Removed all semblance of support for experimental Pixelcanvas (RIP)
  • Loading branch information
DiamondIceNS committed Apr 19, 2018
1 parent e78e3b0 commit a97223d
Show file tree
Hide file tree
Showing 24 changed files with 1,519 additions and 511 deletions.
7 changes: 6 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
"animotes.py" and its contents copyright (C) 2017 Valentijn <ev1l0rd>
"animotes.py" and its contents copyright (C) 2017 Valentijn <ev1l0rd> and DiamondIceNS
and distributed under the GNU Public License 3.0 as described in GPL3.txt.

"lzstring.py" and its contents copyright (C) 2017 Marcel Dancak and distributed
under the Do What The Fuck You Want To Public License as described in WTFPL2.txt.

All other code is authored by DiamondIceNS and is distributed under the
Creative Commons Public Domain Dedication 0 as described in CCO.txt.

Copies of these licenses can be found in the `licenses` directory.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<img align="right" width="200" height="200" src="avatar.jpg">

# Starlight Glimmer
A template utility bot based on [Alastair](Make-Alastair-Great-Again) and [Pinkie Pie](https://pastebin.com/Tg1p5AnW).

Currently supports both [Pixelcanvas.io](http://pixelcanvas.io/) and [Pixelz.io](http://pixelz.io/).
Currently supports [Pixelcanvas.io](http://pixelcanvas.io/), [Pixelz.io](http://pixelz.io/), and [Pixelzone.io](http://pixelzone.io/).

#### Requires:
- Python 3.5
- [Discord.py rewrite](https://github.com/Rapptz/discord.py/tree/rewrite)
- [Pillow](https://pillow.readthedocs.io/en/latest/installation.html)
- [aiohttp](https://aiohttp.readthedocs.io/en/stable/)
- [socketIO_client](https://github.com/invisibleroads/socketIO-client)
- [lz4](https://github.com/python-lz4/python-lz4)

#### Installation:
1. Install Python and the required libraries
Expand All @@ -15,10 +20,18 @@ Currently supports both [Pixelcanvas.io](http://pixelcanvas.io/) and [Pixelz.io]
4. `python glimmer.py`

#### Features:
- Live canvas preview
- Live template checking
- Above two features can be toggled to trigger any time a link/valid template is posted (instead of requiring a command)
- Automatic live canvas preview
- Automatic live template checking
- Color quantization of templates to canvas palette
- [Animotes](https://github.com/ev1l0rd/animotes) support, just because
- Use of cross-server emoji through Animotes (must opt-in)
- Cross-guild emoji through Animotes (must opt-in)
- Support for full language localization

### Languages:
- English (US)

If you happen to know a language that is not listed and would be willing to translate, please submit a pull request. (French and Brazilian Portuguese are specifically wanted, but no translation is a worthless translation!)

**Invite:** `https://discordapp.com/oauth2/authorize?&client_id=405480380930588682&scope=bot&permissions=35840`

**Invite:** `https://discordapp.com/oauth2/authorize?&client_id=405480380930588682&scope=bot&permissions=35840`
[avatar]: avatar.jpg
Binary file added avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 12 additions & 39 deletions commands/animotes.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import re
import discord
from discord.ext import commands
import re

import utils.sqlite as sql
from utils.channel_logger import ChannelLogger
from utils.logger import Log
from utils.exceptions import NoPermission
import utils.sqlite as sql
from utils.language import getlang
from utils.logger import Log

# Cog to reformat messages to allow for animated emotes, regardless of nitro status.
# Copyright (C) 2017 Valentijn <ev1l0rd>
# Cog to reformat messages to allow for animated emotes, regardless of nitro status
# and sharing those emotes with other servers with opt-in policy.
# Copyright (C) 2017-2018 Valentijn <ev1l0rd> and DiamondIceNS
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,64 +42,35 @@ async def on_message(self, message):

@commands.command(aliases=['unregister'])
async def register(self, ctx):
"""Toggle your opt-in status to allow this bot to replace custom emoji on your behalf.
If you opt-in to this feature, any messages you send that contain emoji that I can see will be deleted
and replaced with an identical message from the bot with that emoji properly rendered. Bots do not require
a Nitro account to access cross-server or animated emoji, so you can use this to crudely work around that
restriction if you do not have Nitro yourself. It's the poor man's Nitro!
If your server has been opted in to emoji sharing, you can use this feature to steal any emoji from any server
this bot happens to be in, provided that other server has also opted in.
Use unregister to opt out after opting in.
This feature will malfunction if you have Nitro and you use your own animated emoji in the same message. Trying
to use a Twitch integration server emoji in the same message will probably also break this feature.
This feature requires me having the Manage Messages permission."""
if not sql.is_user_animote_user(ctx.author.id):
sql.add_animote_user(ctx.author.id)
message = "Successfully opted in to animated emote conversion."
message = getlang(ctx.guild.id, "animotes.member_opt_in")
else:
sql.delete_animote_user(ctx.author.id)
message = "Successfully opted out of animated emote conversion."
message = getlang(ctx.guild.id, "animotes.member_opt_out")
await ctx.message.author.send(content=message)

@commands.command(aliases=['unregisterserver'])
@commands.guild_only()
async def registerserver(self, ctx):
"""Toggle the server's opt-in status to emoji sharing.
Opting in to emoji sharing gives you access to all the emoji I can see in every other server I am in, as long
as those servers have also opted in to emoji sharing. This also means that opting in gives those servers access
to YOUR emoji as well. You do not need to opt in to this feature to enable animated emoji replacement for emoji
unique to this server.
WARNING: Opting in to this feature will let other servers see all your custom emoji as well as your server's
name and, by extension, your server's ID. If you do not want to share your server's presence with others, DO
NOT opt in to this feature!
This command can only be used by members with the Manage Emojis permission."""
async def registerguild(self, ctx):
if not ctx.author.permissions_in(ctx.channel).manage_emojis:
raise NoPermission
if not sql.is_server_emojishare_server(ctx.guild.id):
sql.update_guild(ctx.guild.id, emojishare=1)
self.log.info("Guild {0.name} (ID: {0.id}) has opted in to emoji sharing.".format(ctx.guild))
await self.channel_logger.log_to_channel("Guild **{0.name}** (ID: `{0.id}`) has opted in to emoji sharing."
.format(ctx.guild))
message = "Successfully opted server in to emoji sharing."
message = getlang(ctx.guild.id, "animotes.guild_opt_in")
else:
sql.update_guild(ctx.guild.id, emojishare=0)
self.log.info("Guild {0.name} (ID: {0.id}) has opted out of emoji sharing.".format(ctx.guild))
await self.channel_logger.log_to_channel("Guild **{0.name}** (ID: `{0.id}`) has opted out of emoji sharing."
.format(ctx.guild))
message = "Successfully opted server out of emoji sharing."
message = getlang(ctx.guild.id, "animotes.guild_opt_out")
await ctx.send(message)

@commands.command()
async def listemotes(self, ctx):
"""Lists out all of the animated emotes that I know about"""
guilds = []
blacklist = []
whitelist = []
Expand Down
Loading

0 comments on commit a97223d

Please sign in to comment.