diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..bdb0cab
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,17 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..62048de
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,51 @@
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+# Windows shortcuts
+*.lnk
+
+# =========================
+# Operating System Files
+# =========================
+
+# OSX
+# =========================
+
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Thumbnails
+._*
+
+# Files that might appear in the root of a volume
+.DocumentRevisions-V100
+.fseventsd
+.Spotlight-V100
+.TemporaryItems
+.Trashes
+.VolumeIcon.icns
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+__pycache__/
+audiotest/
+trusty-cogs.sublime-workspace
+*.sublime-workspace
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..6e1b765
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 TrustyJAID
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 5b4738a..0863034 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,85 @@
-# Trusty-cogs
\ No newline at end of file
+# Trusty-cogs V3
+TrustyJAID's Cogs for [Red-DiscordBot](https://github.com/Cog-Creators/Red-DiscordBot/tree/V3/develop).
+To add the cogs to your instance please do: `[p]repo add Trusty-cogs https://github.com/TrustyJAID/Trusty-cogs/ V3`
+
+## About Cogs
+
+| Name | Status | Description (Click to see full status)
+| --- | --- | --- |
+| Hockey | **Release** | A cog to gather hockey scores, schedules, player data and more!
If you would like to use the built in emoljis, ask me (TrustyJAID#0001) on discord to add your bot to my server hosting the emojis used in this cog. |
+| Tarot | **Release** | Find your tarot reading, your life reading, or pull a random tarot card! Can also search for a card. |
+| Faces | **Release** | Find your own Japanese style emoji face courtesy of the CIA. |
+| REKT | **Release** | a command to see how rekt someone is. |
+| Weather | **Release** | check the current weather in many cities around the world including in Kelvin. |
+| Starboad | **Release** | add a starboard channel with custom reaction's. |
+| Imgflip | **release** | A recreation of the meme generator from red V1. |
+| Imagemaker | **Release** | A cog to paste avatars onto images like beautiful and pepe.
Requirements: pillow, opencv-python, and numpy |
+| Conversions | **Release** | Currency, crypto, and stocks commands. |
+| Emojireact | **Release** | Have your bot react to emojis in messages with the emoji! |
+| Badges | **Release** | Create your own badge with from discord information.
Includes templates for fake CIA, NSA, FBI, Discord, and every NHL hockey team. Requirements: pillow, pybarcode |
+| Tweets | **Release** | A modified version of Palmtree5's twitter cog utilising twitter streams to setup a twitter channel to post user tweets.
Requirements: tweepy |
+| Mock | **Release** | Mock the user who last posted!
Note: This requires not having the `--dev` flag enabled, however if you need both install the dev cog in my repo. |
+| Translate | **Release** | Add flag emojis to messages to translate to that language or translate messages by command. (Uses Google Translate and may incur some fees) |
+| AddImage | **Release** | Allows you to add images to be posted on command.
Stores the image in the bot folder then uploads the image directly. Owners may add images globally. |
+| Triggersize | **Release** | Posts various sized images based on specific triggered command lengths.
May be customized manually for different images or by default express ones true rage. |
+| Encoding | **Release** | Allows one to encode or decode in Binary and DNA sequencing (ACGT). As well has hashing strings and caeser cipher text. |
+| Compliment | **Release** | Compliment a user! |
+| ServerStats | **Release** | This cog provides a ton of useful development functions for gathering channel data and user data as well as providing a way to setup a channel to monitor which servers are adding the bot. |
+| Runescape | **Beta** | a cog to grab Runescape 3 stats and profile information. |
+| Fun | **Release**| The fun cog from Appu's Selfbot rewritten for redbot V3 including adding reactions and other "fun" commands. |
+| Gabai | **Beta** | A cog to verify a user is on gab before letting them join the server. |
+| Notsobot | **Beta**| Working cog for many of NotSoBot's commands. Has lots of requirements, view the cog README.md for details. |
+| Spoiler | **Beta**| Post spoiler messages in chat and react to the message to view the spoilers. |
+| ReTrigger | **Release** | Trigger events based on regex!
Note: This repo requires pillow to allow resizing of images similar to triggersize cog. |
+
+
+
+## Works in Progress
+*These Cogs are a work in progress and have limited to no functionality at the moment. Feel free to leave ideas or suggestions!*
+
+| Name | Status | Description (Click to see full status)
+| --- | --- | --- |
+| Anime | **Alpha**| A cog that gets what current anime episodes are airing and posts them on discord when they start airing.
There was an update to the API being used and I need to rewrite for the new API. |
+| Halo | **Work in Progress**| Cogs for accessing information from the Halo video games API systems. |
+| Chatterbot | **Alpha** | Teach your bot how to talk by watching conversations on servers and reply. Uses chatterbot library. NOTE: This cog is not recommended to be used at this time. After a month of usage it caused the whole bot to slow down while it searched for responses. I recommend looking at cleverbot for the time being. |
+
+
+## Rewritten Cogs Originally Made by others
+*These cogs were originally written by others for V2. As they were used frequently on TrustyBot I ported them over quickly for V3. A better version may be available.*
+
+| Name | Status | Description (Click to see full status)
+| --- | --- | --- |
+| Autorole | **Release**| Automatically apply roles when a user joins the server. |
+| Stickyroles | **Release**| Keep user roles when they leave the server and re-join. Useful for muted roles. |
+| Welcome | **Beta**| Welcomes users to the server. |
+| Modlogs | **Beta**| A more in-depth modlog cog for more information about users joining/leaving and messages edited/deleted. |
+| Cleverbot | **Release**| Have your bot respond with cleverbot responses.
Cleverbot.com requires a paid API key, cleverbot.io is supported |
+| Insult | **Release**| Insult a user! |
+
+## Special cogs
+*These cogs are not meant for mainstream use but may provide some useful functions for some people. Support may be limited.*
+
+| Name | Status | Description (Click to see full status)
+| --- | --- | --- |
+| Backup | **Release** | Backs up all messages on a server. Use with caution and ensure any backups are stored on an encrypted drive. |
+| Juche | **Release** | Corrects dates posted in discord with the current Juche year. |
+| Dev | **Release** | A copy of the developer commands in redbot with `sudo` replacing `mock` like V2. NOTE:This bypasses the `--dev` flag and is not recommended unless you know what you're doing. |
+| Hue | **Release** | A cog to control Philips Hue lights through discord. Not tested with bots outside the home network. |
+
+Any questions you can find me and TrustyBot over on [my server](https://discord.gg/wVVrqej) or on the [Redbot Cog Support server](https://discord.gg/GET4DVk)
+
+## Credits
+
+* Twentysix - Cleverbot cog, imgflip cog, Stickyroles cog
+* Lunar Dust - Autorole cog
+* Arien - Compliments cog, Insult cog
+* JennJenn - Compliments cog, Insult cog
+* Appu - Fun cog
+* Ivan Seidel (isnowillegal.com) - Trump command
+* Bruno Lemos (isnowillegal.com) - Trump command
+* João Pedro (isnowillegal.com) - Trump command
+* RePulsR - Modlogs cog
+* NotSoSuper - Notsobot cog
+* Aziz - Translate cog
+* Palmtree5 - Tweets cog
+* irdumb - Welcome cog
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..b32f9a2
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,22 @@
+# TODO list for Trusty-cogs
+*These are planned updates I would like to complete for each cog*
+
+## Hockey
+> Image only based on channel permissions
+
+> Game day threads from associated subreddit
+
+## Anime
+> Rewrite for new API
+
+## Activity
+>Check for users last post on refresh and startup (allows for quicker kicking of inactive users)
+
+## Badges
+> Allow creation of templates through discord
+
+## Starboard
+> Allow multiple starboards per server
+
+## Chatter
+> Optimize for v3 and utilize async to get responses
diff --git a/addimage/__init__.py b/addimage/__init__.py
new file mode 100644
index 0000000..d8a2800
--- /dev/null
+++ b/addimage/__init__.py
@@ -0,0 +1,5 @@
+from .addimage import AddImage
+
+def setup(bot):
+ n = AddImage(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/addimage/addimage.py b/addimage/addimage.py
new file mode 100644
index 0000000..79aa8a2
--- /dev/null
+++ b/addimage/addimage.py
@@ -0,0 +1,419 @@
+from random import choice, randint
+import random
+import aiohttp
+import discord
+import asyncio
+from redbot.core import commands
+from redbot.core import checks
+from redbot.core import Config
+from redbot.core.data_manager import cog_data_path
+from pathlib import Path
+import os
+import string
+from redbot.core.i18n import Translator
+
+_ = Translator("Alias", __file__)
+
+class AddImage(getattr(commands, "Cog", object)):
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ temp_folder = cog_data_path(self) /"global"
+ temp_folder.mkdir(exist_ok=True, parents=True)
+ default_global = {"images":[]}
+ default_guild = {"images":[]}
+ self.config = Config.get_conf(self, 16446735546)
+ self.config.register_global(**default_global)
+ self.config.register_guild(**default_guild)
+
+ async def first_word(self, msg):
+ return msg.split(" ")[0].lower()
+
+ async def get_prefix(self, message: discord.Message) -> str:
+ """
+ From Redbot Alias Cog
+ Tries to determine what prefix is used in a message object.
+ Looks to identify from longest prefix to smallest.
+ Will raise ValueError if no prefix is found.
+ :param message: Message object
+ :return:
+ """
+ content = message.content
+ prefix_list = await self.bot.command_prefix(self.bot, message)
+ prefixes = sorted(prefix_list,
+ key=lambda pfx: len(pfx),
+ reverse=True)
+ for p in prefixes:
+ if content.startswith(p):
+ return p
+ raise ValueError(_("No prefix found."))
+
+ async def part_of_existing_command(self, alias):
+ '''Command or alias'''
+ command = self.bot.get_command(alias)
+ return command is not None
+
+
+ async def make_guild_folder(self, directory):
+ if not directory.is_dir():
+ print("Creating guild folder")
+ directory.mkdir(exist_ok=True, parents=True)
+
+ async def get_image(self, alias, guild=None)-> dict:
+ if guild is None:
+ list_images = await self.config.images()
+ for image in await self.config.images():
+ if image["command_name"].lower() == alias.lower():
+ return image
+ else:
+ list_images = await self.config.guild(guild).images()
+ for image in await self.config.guild(guild).images():
+ # print(image)
+ if image["command_name"].lower() == alias.lower():
+ return image
+
+ async def local_perms(self, message):
+ """Check the user is/isn't locally whitelisted/blacklisted.
+ https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/core/global_checks.py
+ """
+ if await self.bot.is_owner(message.author):
+ return True
+ elif message.guild is None:
+ return True
+ guild_settings = self.bot.db.guild(message.guild)
+ local_blacklist = await guild_settings.blacklist()
+ local_whitelist = await guild_settings.whitelist()
+
+ _ids = [r.id for r in message.author.roles if not r.is_default()]
+ _ids.append(message.author.id)
+ if local_whitelist:
+ return any(i in local_whitelist for i in _ids)
+
+ return not any(i in local_blacklist for i in _ids)
+
+ async def global_perms(self, message):
+ """Check the user is/isn't globally whitelisted/blacklisted.
+ https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/core/global_checks.py
+ """
+ if await self.bot.is_owner(message.author):
+ return True
+
+ whitelist = await self.bot.db.whitelist()
+ if whitelist:
+ return message.author.id in whitelist
+
+ return message.author.id not in await self.bot.db.blacklist()
+
+ async def check_ignored_channel(self, message):
+ """https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/cogs/mod/mod.py#L1273"""
+ channel = message.channel
+ guild = channel.guild
+ author = message.author
+ mod = self.bot.get_cog("Mod")
+ perms = channel.permissions_for(author)
+ surpass_ignore = (
+ isinstance(channel, discord.abc.PrivateChannel)
+ or perms.manage_guild
+ or await self.bot.is_owner(author)
+ or await self.bot.is_admin(author)
+ )
+ if surpass_ignore:
+ return True
+ guild_ignored = await mod.settings.guild(guild).ignored()
+ chann_ignored = await mod.settings.channel(channel).ignored()
+ return not (guild_ignored or chann_ignored and not perms.manage_channels)
+
+
+ async def on_message(self, message):
+ if len(message.content) < 2 or message.guild is None:
+ return
+
+ msg = message.content
+ guild = message.guild
+ channel = message.channel
+ try:
+ prefix = await self.get_prefix(message)
+ except ValueError:
+ return
+ alias = await self.first_word(msg[len(prefix):])
+ if not await self.local_perms(message):
+ return
+ if not await self.global_perms(message):
+ return
+ if not await self.check_ignored_channel(message):
+ return
+
+ if alias in [x["command_name"] for x in await self.config.images()]:
+ if channel.permissions_for(channel.guild.me).attach_files:
+ await channel.trigger_typing()
+ image = await self.get_image(alias)
+ list_images = await self.config.images()
+ list_images.remove(image)
+ image["count"] += 1
+ list_images.append(image)
+ await self.config.images.set(list_images)
+ file = discord.File(image["file_loc"])
+ await channel.send(file=file)
+
+ elif alias in [x["command_name"] for x in await self.config.guild(guild).images()]:
+ if channel.permissions_for(channel.guild.me).attach_files:
+ await channel.trigger_typing()
+ image = await self.get_image(alias, guild)
+ guild_images = await self.config.guild(guild).images()
+ guild_images.remove(image)
+ image["count"] += 1
+ guild_images.append(image)
+ await self.config.guild(guild).images.set(guild_images)
+ file = discord.File(image["file_loc"])
+ await channel.send(file=file)
+
+ async def check_command_exists(self, command, guild):
+ if command in [x["command_name"] for x in await self.config.guild(guild).images()]:
+ return True
+ elif await self.part_of_existing_command(command):
+ return True
+ elif command in [x["command_name"] for x in await self.config.images()]:
+ return True
+ else:
+ return False
+
+ async def image_menu(self, ctx:commands.Context, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ post = post_list[page]
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = discord.Embed(timestamp=ctx.message.created_at)
+ for image in post:
+ info = "__Author__: <@{}>\n__Count__: **{}**".format(image["author"], image["count"])
+ em.add_field(name=image["command_name"], value=info)
+ em.set_author(name=self.bot.user.display_name, icon_url=self.bot.user.avatar_url)
+ em.set_footer(text="Page {}/{}".format(page+1, len(post_list)))
+ else:
+ await ctx.send("I need embed_links permission to use this command.")
+ return
+ if len(post_list) == 1:
+ # No need to offer multiple pages if they don't exist
+ await ctx.send(embed=em)
+ return
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await ctx.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.guild.me)
+ await message.remove_reaction("❌", ctx.guild.me)
+ await message.remove_reaction("➡", ctx.guild.me)
+ return None
+ else:
+ if react.emoji == "➡":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ try:
+ await message.remove_reaction("➡", ctx.message.author)
+ except:
+ pass
+ return await self.image_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react.emoji == "⬅":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ try:
+ await message.remove_reaction("⬅", ctx.message.author)
+ except:
+ pass
+ return await self.image_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @commands.group()
+ @commands.guild_only()
+ async def addimage(self, ctx):
+ """
+ Add an image for the bot to directly upload
+ """
+ pass
+
+ @addimage.command(name="list")
+ async def listimages(self, ctx, image_loc="guild", server_id:int=None):
+ """List images added to bot"""
+ msg = ""
+ if image_loc in ["global"]:
+ image_list = await self.config.images()
+ elif image_loc in ["guild", "server"]:
+ if server_id is None:
+ guild = ctx.message.guild
+ else:
+ guild = self.bot.get_guild(server_id)
+ image_list = await self.config.guild(guild).images()
+
+ if image_list == []:
+ await ctx.send("{} does not have any images saved!".format(self.bot.user.display_name))
+ return
+ post_list = [image_list[i:i + 25] for i in range(0, len(image_list), 25)]
+ await self.image_menu(ctx, post_list)
+
+
+ @addimage.command()
+ async def clear_list(self, ctx):
+ await self.config.images.set([])
+ await self.config.guild(ctx.guild).images.set([])
+
+ @addimage.command(name="delete", aliases=["remove", "rem", "del"])
+ async def remimage(self, ctx, cmd):
+ """Remove a selected images"""
+ author = ctx.message.author
+ guild = ctx.message.guild
+ channel = ctx.message.channel
+ cmd = cmd.lower()
+ if cmd not in [x["command_name"] for x in await self.config.guild(guild).images()]:
+ await ctx.send("{} is not an image for this guild!".format(cmd))
+ return
+
+ await channel.trigger_typing()
+ all_imgs = await self.config.guild(guild).images()
+ image = await self.get_image(cmd, guild)
+ all_imgs.remove(image)
+ try:
+ os.remove(image.file_loc)
+ except:
+ pass
+ await self.config.guild(guild).images.set(all_imgs)
+ await ctx.send("{} has been deleted from this guild!".format(cmd))
+
+
+ @checks.is_owner()
+ @addimage.command(hidden=True, name="deleteglobal", aliases=["dg", "delglobal"])
+ async def rem_image_global(self, ctx, cmd):
+ """Remove a selected images"""
+ author = ctx.message.author
+ guild = ctx.message.guild
+ channel = ctx.message.channel
+ cmd = cmd.lower()
+ if cmd not in [x["command_name"] for x in await self.config.images()]:
+ await ctx.send("{} is not a global image!".format(cmd))
+ return
+
+ await channel.trigger_typing()
+ all_imgs = await self.config.images()
+ image = await self.get_image(cmd)
+ all_imgs.remove(image)
+ try:
+ os.remove(image.file_loc)
+ except:
+ pass
+ await self.config.images.set(all_imgs)
+ await ctx.send("{} has been deleted globally!".format(cmd))
+
+ async def save_image_location(self, msg, cmd, guild=None):
+ seed = ''.join(random.sample(string.ascii_uppercase + string.digits, k=5))
+ filename = "{}-{}".format(seed, msg.attachments[0].filename)
+ if guild is not None:
+ directory = cog_data_path(self) /str(guild.id)
+ cur_images = await self.config.guild(guild).images()
+ else:
+ directory = cog_data_path(self) /"global"
+ cur_images = await self.config.images()
+ await self.make_guild_folder(directory)
+ cmd = cmd.lower()
+
+ file_path = "{}/{}".format(str(directory), filename)
+
+ new_entry = {"command_name": cmd,
+ "count": 0,
+ "file_loc": file_path,
+ "author": msg.author.id}
+
+ cur_images.append(new_entry)
+ async with self.session.get(msg.attachments[0].url) as resp:
+ test = await resp.read()
+ with open(file_path, "wb") as f:
+ f.write(test)
+ if guild is not None:
+ await self.config.guild(guild).images.set(cur_images)
+ else:
+ await self.config.images.set(cur_images)
+
+ async def wait_for_image(self, ctx):
+ msg = None
+ while msg is None:
+ check = lambda m: m.author == ctx.message.author and m.attachments != []
+ try:
+ msg = await self.bot.wait_for("message", check=check, timeout=60)
+ except asyncio.TimeoutError:
+ await ctx.send("Image adding timed out.")
+ break
+ if msg.content.lower().strip() == "exit":
+ await ctx.send("Image adding cancelled.")
+ break
+ return msg
+
+ @addimage.command(pass_context=True, name="add")
+ async def add_image_guild(self, ctx, cmd):
+ """Add an image to direct upload."""
+ author = ctx.message.author
+ guild = ctx.message.guild
+ channel = ctx.message.channel
+ if cmd.lower() == "global":
+ await ctx.send("global is not a valid command name! Try something else.")
+ return
+ if await self.check_command_exists(cmd, guild):
+ await ctx.send("{} is already in the list, try another!".format(cmd))
+ return
+ else:
+ await ctx.send("{} added as the command!".format(cmd))
+ if ctx.message.attachments == []:
+ await ctx.send("Upload an image for me to use! Type `exit` to cancel.")
+ msg = await self.wait_for_image(ctx)
+ if msg is None:
+ return
+ await self.save_image_location(msg, cmd, guild)
+ await ctx.send("{} has been added to my files!".format(cmd))
+ else:
+ await self.save_image_location(ctx.message, cmd, guild)
+
+
+ @checks.is_owner()
+ @addimage.command(hidden=True, pass_context=True, name="addglobal")
+ async def add_image_global(self, ctx, cmd):
+ """Add an image to direct upload."""
+ author = ctx.message.author
+ guild = ctx.message.guild
+ channel = ctx.message.channel
+ msg = ctx.message
+ if cmd.lower() == "global":
+ await ctx.send("global is not a valid command name! Try something else.")
+ return
+ if await self.check_command_exists(cmd, guild):
+ await ctx.send("{} is already in the list, try another!".format(cmd))
+ return
+ else:
+ await ctx.send("{} added as the command!".format(cmd))
+ if ctx.message.attachments == []:
+ await ctx.send("Upload an image for me to use! Type `exit` to cancel.")
+ msg = await self.wait_for_image(ctx)
+ if msg is None:
+ return
+ await self.save_image_location(msg, cmd)
+ await ctx.send("{} has been added to my files!".format(cmd))
+ else:
+ await self.save_image_location(ctx.message, cmd)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/addimage/info.json b/addimage/info.json
new file mode 100644
index 0000000..f9095f4
--- /dev/null
+++ b/addimage/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Add image for the bot to directly upload similar to alias.",
+ "install_msg":"[p]addimage to add an image to the guild. Owner can add global bot images.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"AddImage",
+ "permissions":[
+ "attach_files"
+ ],
+ "requirements":[],
+ "short":"Add images for direct upload per guild and globally.",
+ "tags":[
+ "utility",
+ "images"
+ ]
+}
\ No newline at end of file
diff --git a/autorole/__init__.py b/autorole/__init__.py
new file mode 100644
index 0000000..89f20ec
--- /dev/null
+++ b/autorole/__init__.py
@@ -0,0 +1,7 @@
+from .autorole import Autorole
+
+def setup(bot):
+ n = Autorole(bot)
+ bot.add_cog(n)
+ # bot.add_listener(n._roler, "on_member_join")
+ # bot.add_listener(n._verify_json, "on_error")
diff --git a/autorole/autorole.py b/autorole/autorole.py
new file mode 100644
index 0000000..0afb413
--- /dev/null
+++ b/autorole/autorole.py
@@ -0,0 +1,339 @@
+import discord
+from redbot.core import commands, checks, Config
+import random
+import string
+
+
+default_settings = {
+ "ENABLED": False,
+ "ROLE": [],
+ "AGREE_CHANNEL": None,
+ "AGREE_MSG": None,
+ "AGREE_KEY": None
+ }
+
+class Autorole(getattr(commands, "Cog", object)):
+ """
+ Autorole commands. Rewritten for V3 from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/autorole/autorole.py
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 45463543548)
+ self.config.register_guild(**default_settings)
+ self.users = {}
+
+ async def _no_perms(self, channel=None):
+ m = ("It appears that you haven't given this "
+ "bot enough permissions to use autorole. "
+ "The bot requires the \"Manage Roles\" and "
+ "the \"Manage Messages\" permissions in"
+ "order to use autorole. You can change the "
+ "permissions in the \"Roles\" tab of the "
+ "guild settings.")
+ if channel is None:
+ print(m)
+ return
+ if channel.permissions_for(channel.guild.me).send_messages:
+ await channel.send(m)
+ else:
+ print(m + f"\n I also don't have permission to speak in #{channel.name}")
+
+ async def on_message(self, message):
+ guild = message.guild
+ user = message.author
+ channel = message.channel
+ try:
+ agree_channel = guild.get_channel(await self.config.guild(guild).AGREE_CHANNEL())
+ except:
+ return
+ if guild is None:
+ return
+ if agree_channel is None:
+ return
+ if channel.id != agree_channel.id:
+ return
+ if user.bot:
+ return
+
+ if user.id in self.users:
+ if not guild.me.guild_permissions.manage_roles:
+ await self._no_perms(agree_channel)
+ return
+ if self.users[user.id].lower() in message.content.lower():
+ roles_id = await self.config.guild(guild).ROLE()
+ del self.users[user.id]
+ roles = [role for role in guild.roles if role.id in roles_id]
+ for role in roles:
+ await user.add_roles(role, reason="Agreed to the rules")
+ if agree_channel.permissions_for(guild.me).add_reactions:
+ await message.add_reaction("✅")
+
+ async def _agree_maker(self, member):
+ guild = member.guild
+ self.last_guild = guild
+ # await self._verify_json(None)
+ key = await self.config.guild(guild).AGREE_KEY()
+ if key is None:
+ key = ''.join(random.choice(string.ascii_uppercase +
+ string.digits) for _ in range(6))
+ # <3 Stackoverflow http://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits-in-python/23728630#23728630
+
+
+ self.users[member.id] = key
+
+ ch = guild.get_channel(await self.config.guild(guild).AGREE_CHANNEL())
+ msg = await self.config.guild(guild).AGREE_MSG()
+ if msg is None:
+ msg = "{mention} please enter {key} in {channel}"
+ try:
+ msg = msg.format(key=key,
+ member=member,
+ name=member.name,
+ mention=member.mention,
+ guild=guild.name,
+ channel=ch.mention)
+ except Exception as e:
+ print(e)
+
+ try:
+ msg = await member.send(msg)
+ except discord.Forbidden:
+ msg = await ch.send(msg)
+ except discord.HTTPException:
+ return
+
+ async def _auto_give(self, member):
+ guild = member.guild
+ roles_id = await self.config.guild(guild).ROLE()
+ roles = [role for role in guild.roles if role.id in roles_id]
+ if not guild.me.guild_permissions.manage_roles:
+ await self._no_perms()
+ return
+ for role in roles:
+ await member.add_roles(role, reason="Joined the server")
+
+ async def on_member_join(self, member):
+ guild = member.guild
+ if await self.config.guild(guild).ENABLED():
+ if await self.config.guild(guild).AGREE_CHANNEL() is not None:
+ await self._agree_maker(member)
+ else: # Immediately give the new user the role
+ await self._auto_give(member)
+
+
+ @commands.group(name="autorole", no_pm=True)
+ async def autorole(self, ctx):
+ """
+ Change settings for autorole
+
+ Requires the manage roles permission
+ """
+ if ctx.invoked_subcommand is None:
+ guild = ctx.message.guild
+ enabled = await self.config.guild(guild).ENABLED()
+ roles = await self.config.guild(guild).ROLE()
+ msg = await self.config.guild(guild).AGREE_MSG()
+ key = await self.config.guild(guild).AGREE_KEY()
+ channel = await self.config.guild(guild).AGREE_CHANNEL()
+ chn_mention = guild.get_channel(channel).name if channel is not None else "None"
+ role_name = []
+ role_name_str = ", ".join(role.name for role in guild.roles if role.id in roles)
+ send_msg = ("```Current autorole state: {}\nCurrent Roles:{}\n"
+ "Agreement message: {}\n"
+ "Agreement key: {}\n"
+ "Agreement channel: {}```")
+ await ctx.send(send_msg.format(enabled, role_name_str, msg, key, chn_mention))
+
+ @autorole.command(no_pm=True)
+ @checks.admin_or_permissions(manage_roles=True)
+ async def toggle(self, ctx):
+ """
+ Enables/Disables autorole
+ """
+ guild = ctx.message.guild
+ if await self.config.guild(guild).ROLE() is None:
+ await ctx.send("You haven't set a role to give to new users! "
+ "Use `{}autorole role \"role\"` to set it!"
+ .format(ctx.prefix))
+ else:
+ if await self.config.guild(guild).ENABLED():
+ await self.config.guild(guild).ENABLED.set(False)
+ await ctx.send("Autorole is now disabled.")
+ else:
+ await self.config.guild(guild).ENABLED.set(True)
+ await ctx.send("Autorole is now enabled.")
+
+ @autorole.command(no_pm=True, name="add", aliases=["role"])
+ @checks.admin_or_permissions(manage_roles=True)
+ async def role(self, ctx, *, role: discord.Role):
+ """
+ Add a role for autorole to assign.
+
+ You can use this command multiple times to add multiple roles.
+ """
+ guild = ctx.message.guild
+ roles = await self.config.guild(guild).ROLE()
+ if not guild.me.guild_permissions.manage_roles:
+ await ctx.send("I don't have the manage roles permission to use these features!")
+ return
+ if role.id in roles:
+ await ctx.send("{} is already in the autorole list.".format(role.name))
+ return
+ if guild.me.top_role < role:
+ await ctx.send("{} is higher than my highest role in the Discord hierarchy.".format(role.name))
+ return
+ roles.append(role.id)
+ await self.config.guild(guild).ROLE.set(roles)
+ await ctx.send(f"Added the role `{role.name}` to the autorole.")
+
+ @autorole.command(no_pm=True)
+ @checks.admin_or_permissions(manage_roles=True)
+ async def remove(self, ctx, *, role: discord.Role):
+ """
+ Remove a role from the autorole.
+ """
+ guild = ctx.message.guild
+ roles = await self.config.guild(guild).ROLE()
+ if role.id not in roles:
+ await ctx.send("{} is not in the autorole list.".format(role.name))
+ return
+ roles.remove(role.id)
+ await self.config.guild(guild).ROLE.set(roles)
+ await ctx.send(f"Removed the role `{role.name}` from the autorole.")
+
+
+ @autorole.group(no_pm=True)
+ @checks.admin_or_permissions(manage_roles=True)
+ async def agreement(self, ctx):
+ """
+ Set the channel and message that will be used for accepting the rules.
+
+ `channel` is the channel they must type the key in to get the role.
+ `key` is the message they must type to gain access and must be in quotes.
+ `msg` is the message DM'd to them when they join.
+
+ `{key}` must be included in the message so a user knows what to type in the channel.
+
+ Optional additions to the message include:
+ `{channel}` Mentions the channel where they must include the agreement message.
+ `{mention}` Mentions the user incase they have DM permissions turned off this should be used.
+ `{name}` Says the member name if you don't want to ping them.
+ `{guild}` Says the servers current name.
+
+ Entering nothing will disable these.
+ """
+
+
+ @agreement.command(no_pm=True, name="channel")
+ @checks.admin_or_permissions(manage_roles=True)
+ async def set_agreement_channel(self, ctx, channel: discord.TextChannel=None):
+ """
+ Set the agreement channel
+
+ Entering nothing will clear this.
+ """
+ guild = ctx.message.guild
+ if await self.config.guild(guild).ROLE() == []:
+ await ctx.send("No roles have been set for autorole.")
+ return
+ if not await self.config.guild(guild).ENABLED():
+ await ctx.send("Autorole has been disabled, enable it first.")
+ return
+ if channel is None:
+ await self.config.guild(guild).AGREE_CHANNEL.set(None)
+ await ctx.send("Agreement channel cleared")
+ else:
+ await self.config.guild(guild).AGREE_CHANNEL.set(channel.id)
+ await ctx.send(f"Agreement channel set to {channel.mention}")
+
+ @agreement.command(no_pm=True, name="key")
+ @checks.admin_or_permissions(manage_roles=True)
+ async def set_agreement_key(self, ctx, *, key: str=None):
+ """
+ Set the agreement key
+
+ Entering nothing will clear this.
+ """
+
+ guild = ctx.message.guild
+ if await self.config.guild(guild).ROLE() == []:
+ await ctx.send("No roles have been set for autorole.")
+ return
+ if not await self.config.guild(guild).ENABLED():
+ await ctx.send("Autorole has been disabled, enable it first.")
+ return
+ if key is None:
+ await self.config.guild(guild).AGREE_KEY.set(None)
+ await ctx.send("Agreement key cleared")
+ else:
+ await self.config.guild(guild).AGREE_KEY.set(key)
+ await ctx.send(f"Agreement key set to {key}")
+
+ @agreement.command(no_pm=True, name="message", aliases=["msg"])
+ @checks.admin_or_permissions(manage_roles=True)
+ async def set_agreement_msg(self, ctx, *, message: str=None):
+ """
+ Set the agreement message
+ `{key}` must be included in the message so a user knows what to type in the channel.
+
+ Optional additions to the message include:
+ `{channel}` Mentions the channel where they must include the agreement message.
+ `{mention}` Mentions the user incase they have DM permissions turned off this should be used.
+ `{name}` Says the member name if you don't want to ping them.
+ `{guild}` Says the servers current name.
+
+ Entering nothing will clear this.
+ """
+ guild = ctx.message.guild
+ if await self.config.guild(guild).ROLE() == []:
+ await ctx.send("No roles have been set for autorole.")
+ return
+ if not await self.config.guild(guild).ENABLED():
+ await ctx.send("Autorole has been disabled, enable it first.")
+ return
+ if message is None:
+ await self.config.guild(guild).AGREE_MSG.set(None)
+ await ctx.send("Agreement message cleared")
+ else:
+ await self.config.guild(guild).AGREE_MSG.set(message)
+ await ctx.send(f"Agreement key set to {message}")
+
+ @agreement.command(no_pm=True, name="setup")
+ @checks.admin_or_permissions(manage_roles=True)
+ async def agreement_setup(self, ctx, channel: discord.TextChannel=None, key: str=None, *, msg: str=None):
+ """
+ Set the channel and message that will be used for accepting the rules.
+
+ `channel` is the channel they must type the key in to get the role.
+ `key` is the message they must type to gain access and must be in quotes.
+ `msg` is the message DM'd to them when they join.
+
+ `{key}` must be included in the message so a user knows what to type in the channel.
+
+ Optional additions to the message include:
+ `{channel}` Mentions the channel where they must include the agreement message.
+ `{mention}` Mentions the user incase they have DM permissions turned off this should be used.
+ `{name}` Says the member name if you don't want to ping them.
+ `{guild}` Says the servers current name.
+
+ Entering nothing will disable this.
+ """
+ guild = ctx.message.guild
+ if await self.config.guild(guild).ROLE() == []:
+ await ctx.send("No roles have been set for autorole.")
+ return
+ if not await self.config.guild(guild).ENABLED():
+ await ctx.send("Autorole has been disabled, enable it first.")
+ return
+ if channel is None:
+ await self.config.guild(guild).AGREE_CHANNEL.set(None)
+ await self.config.guild(guild).AGREE_MSG.set(None)
+ await self.config.guild(guild).AGREE_KEY.set(None)
+ await ctx.send("Agreement channel cleared")
+ else:
+ await self.config.guild(guild).AGREE_CHANNEL.set(channel.id)
+ await self.config.guild(guild).AGREE_MSG.set(msg)
+ await self.config.guild(guild).AGREE_KEY.set(key)
+ await ctx.send("Agreement channel set to {}".format(channel.mention))
diff --git a/autorole/info.json b/autorole/info.json
new file mode 100644
index 0000000..fac454e
--- /dev/null
+++ b/autorole/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "Lunar Dust",
+ "TrustyJAID"
+ ],
+ "description":"Automatically apply a role to new users",
+ "install_msg":"autorole",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"autorole",
+ "permissions":[
+ "manage_roles"
+ ],
+ "requirements":[],
+ "short":"Automatically apply a role to new users",
+ "tags":[
+ "autorole"
+ ]
+}
\ No newline at end of file
diff --git a/backup/__init__.py b/backup/__init__.py
new file mode 100644
index 0000000..f974b4c
--- /dev/null
+++ b/backup/__init__.py
@@ -0,0 +1,4 @@
+from .backup import Backup
+
+def setup(bot):
+ bot.add_cog(Backup(bot))
diff --git a/backup/backup.py b/backup/backup.py
new file mode 100644
index 0000000..f6cc2ff
--- /dev/null
+++ b/backup/backup.py
@@ -0,0 +1,145 @@
+import discord
+import asyncio
+import aiohttp
+from redbot.core import commands
+from redbot.core import checks
+from redbot.core.data_manager import cog_data_path
+import datetime
+import os
+from random import randint
+import json
+import logging
+from typing import Union
+
+
+class GuildNotFoundError(Exception):
+ pass
+
+class Backup(getattr(commands, "Cog", object)):
+ """
+ Create a set of json backups of a server
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ def save_json(self, filename, data):
+ """Atomically saves json file"""
+ rnd = randint(1000, 9999)
+ path, ext = os.path.splitext(filename)
+ tmp_file = "{}-{}.tmp".format(path, rnd)
+ self._save_json(tmp_file, data)
+ try:
+ self._read_json(tmp_file)
+ except json.decoder.JSONDecodeError:
+ self.logger.exception("Attempted to write file {} but JSON "
+ "integrity check on tmp file has failed. "
+ "The original file is unaltered."
+ "".format(filename))
+ return False
+ os.replace(tmp_file, filename)
+ return True
+
+ def _read_json(self, filename):
+ with open(filename, encoding='utf-8', mode="r") as f:
+ data = json.load(f)
+ return data
+
+ def _save_json(self, filename, data):
+ with open(filename, encoding='utf-8', mode="w") as f:
+ json.dump(data, f, indent=4,sort_keys=True,
+ separators=(',',' : '))
+ return data
+
+ async def check_folder(self, folder_name):
+ if not os.path.exists("{}/{}".format(str(cog_data_path(self)),folder_name)):
+ try:
+ os.makedirs("{}/{}".format(str(cog_data_path(self)),folder_name))
+ os.makedirs("{}/{}/files".format(str(cog_data_path(self)),folder_name))
+ return True
+ except:
+ return False
+ else:
+ return True
+
+ async def get_guild_obj(self, guild_name):
+ if type(guild_name) == int:
+ page_guild = [g for g in self.bot.guilds if int(guild_name) == g.id]
+ if type(guild_name) == str:
+ page_guild = [g for g in self.bot.guilds if guild_name.lower() in g.name.lower()]
+ try:
+ if guild_name is not None:
+ guilds = [g for g in self.bot.guilds]
+ guild = guilds[guilds.index(page_guild[0])]
+ except IndexError as e:
+ raise GuildNotFoundError
+ return guild
+
+ @commands.command(pass_context=True, aliases=["serverbackup"])
+ @checks.admin_or_permissions(manage_guild=True)
+ @commands.guild_only()
+ async def serverlogs(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Creat a backup of all server data as json files
+
+ `guild_name` is partial name or ID of the server you want to backup
+ defaults to the server the command was run in
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ today = datetime.date.today().strftime("%Y-%m-%d")
+ channel = ctx.message.channel
+ is_folder = await self.check_folder(guild.name)
+ total_msgs = 0
+ files_saved = 0
+ if not is_folder:
+ print("{} folder doesn't exist!".format(guild.name))
+ return
+ for chn in guild.channels:
+ # await channel.send("backing up {}".format(chn.name))
+ message_list = []
+ try:
+ async for message in chn.history(limit=10000000):
+ data = {"timestamp":message.created_at.strftime("%Y-%m-%d %H:%M:%S"),
+ "tts":message.tts,
+ "author":{"name":message.author.name,
+ "display_name":message.author.display_name,
+ "discriminator":message.author.discriminator,
+ "id":message.author.id,
+ "bot":message.author.bot},
+ "content":message.content,
+ "channel":{"name":message.channel.name, "id":message.channel.id},
+ "mention_everyone":message.mention_everyone,
+ "mentions":[{"name":user.name,
+ "display_name":user.display_name,
+ "discriminator":user.discriminator,
+ "id":user.id,
+ "bot":user.bot} for user in message.mentions],
+ "channel_mentions":[{"name":channel.name,
+ "id":channel.id} for channel in message.channel_mentions],
+ "role_mentions":[{"name":role.name,
+ "id":role.id} for role in message.role_mentions],
+ "id":message.id,
+ "pinned":message.pinned}
+ message_list.append(data)
+ total_msgs += len(message_list)
+ if len(message_list) == 0:
+ continue
+ self.save_json("{}/{}/{}-{}.json".format(str(cog_data_path(self)),guild.name, chn.name, today), message_list)
+ await channel.send("{} messages saved from {}".format(len(message_list), chn.name))
+ except discord.errors.Forbidden:
+ await channel.send("0 messages saved from {}".format(chn.name))
+ pass
+ except AttributeError:
+ await channel.send("0 messages saved from {}".format(chn.name))
+ pass
+ await channel.send("{} messages saved from {}".format(total_msgs, guild.name))
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/backup/info.json b/backup/info.json
new file mode 100644
index 0000000..351cead
--- /dev/null
+++ b/backup/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Backup all channel messages on a server. Ensure all saved messages are stored on an encrypted drive!",
+ "install_msg":"Warning: Ensure all backups are used for personal use or data gathering. User messages are still owned by the original author. All externally saved data must be stored on an encrypted drive.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Backup",
+ "permissions":[
+ "read_message_history"
+ ],
+ "requirements":[],
+ "short":"Backup all channel messages on a server.",
+ "tags":[
+ "utility",
+ "tools"
+ ]
+}
\ No newline at end of file
diff --git a/badges/__init__.py b/badges/__init__.py
new file mode 100644
index 0000000..dad660c
--- /dev/null
+++ b/badges/__init__.py
@@ -0,0 +1,7 @@
+from .badges import Badges
+from redbot.core import data_manager
+
+def setup(bot):
+ cog = Badges(bot)
+ data_manager.load_bundled_data(cog, __file__)
+ bot.add_cog(cog)
\ No newline at end of file
diff --git a/badges/badge_entry.py b/badges/badge_entry.py
new file mode 100644
index 0000000..fc44316
--- /dev/null
+++ b/badges/badge_entry.py
@@ -0,0 +1,45 @@
+import discord
+
+class Badge:
+ def __init__(self, badge_name: str, code: str, image: str=None, watermark:str=None, file_name: str=None, is_inverted: bool=False):
+ super().__init__()
+ self.badge_name = badge_name
+ self.code = code
+ self.file_name = file_name
+ self.is_inverted = is_inverted
+ self.image = image
+ self.watermark = watermark
+
+
+ def to_json(self) -> dict:
+ return {
+ "badge_name": self.badge_name,
+ "code": self.code,
+ "image": self.image,
+ "watermark": self.watermark,
+ "file_name": self.file_name,
+ "is_inverted": self.is_inverted
+
+ }
+
+ @classmethod
+ async def from_json(cls, data: dict):
+ badge_name = data["badge_name"]
+ code = data["code"]
+ is_inverted = data["is_inverted"]
+ if "file_name" in data:
+ file_name = data["file_name"]
+ else:
+ file_name = None
+
+ if "image" in data:
+ image = data["image"]
+ else:
+ image = None
+ if "watermark" in data:
+ watermark = data["watermark"]
+ else:
+ watermark = None
+ return cls(badge_name, code, image, watermark, file_name, is_inverted)
+
+
diff --git a/badges/badges.py b/badges/badges.py
new file mode 100644
index 0000000..81f5dd8
--- /dev/null
+++ b/badges/badges.py
@@ -0,0 +1,256 @@
+import discord
+from redbot.core import commands
+import aiohttp
+import os
+from PIL import Image
+from PIL import ImageColor
+from PIL import ImageFont
+from PIL import ImageDraw
+from PIL import ImageSequence
+from barcode import generate
+from barcode.writer import ImageWriter
+from redbot.core.data_manager import bundled_data_path
+from redbot.core import Config
+from io import BytesIO
+from .templates import blank_template
+from .badge_entry import Badge
+import sys
+import functools
+import asyncio
+
+class Badges(getattr(commands, "Cog", object)):
+ """
+ Create fun fake badges based on your discord profile
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 1545487348434)
+ default_guild = {"badges":[]}
+ default_global = {"badges": blank_template}
+ self.config.register_global(**default_global)
+ self.config.register_guild(**default_guild)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ def remove_white_barcode(self, img):
+ """https://stackoverflow.com/questions/765736/using-pil-to-make-all-white-pixels-transparent"""
+ img = img.convert("RGBA")
+ datas = img.getdata()
+
+ newData = []
+ for item in datas:
+ if item[0] == 255 and item[1] == 255 and item[2] == 255:
+ newData.append((255, 255, 255, 0))
+ else:
+ newData.append(item)
+
+ img.putdata(newData)
+ return img
+
+ def invert_barcode(self, img):
+ """https://stackoverflow.com/questions/765736/using-pil-to-make-all-white-pixels-transparent"""
+ img = img.convert("RGBA")
+ datas = img.getdata()
+
+ newData = []
+ for item in datas:
+ if item[0] == 0 and item[1] == 0 and item[2] == 0:
+ newData.append((255, 255, 255))
+ else:
+ newData.append(item)
+
+ img.putdata(newData)
+ return img
+
+ async def dl_image(self, url):
+ """Download bytes like object of user avatar"""
+ async with self.session.get(url) as resp:
+ test = await resp.read()
+ return BytesIO(test)
+
+ def make_template(self, user, badge, template):
+ """Build the base template before determining animated or not"""
+ if hasattr(user, "roles"):
+ department = "GENERAL SUPPORT" if user.top_role.name == "@everyone" else user.top_role.name.upper()
+ status = user.status
+ level = str(len(user.roles))
+ else:
+ department = "GENERAL SUPPORT"
+ status = "online"
+ level = "1"
+ if str(status) == "online":
+ status = "ACTIVE"
+ if str(status) == "offline":
+ status = "COMPLETING TASK"
+ if str(status) == "idle":
+ status = "AWAITING INSTRUCTIONS"
+ if str(status) == "dnd":
+ status = "MIA"
+ barcode = BytesIO()
+ temp_barcode = generate("code39", str(user.id), writer=ImageWriter(), output=barcode)
+ barcode = Image.open(barcode)
+ barcode = self.remove_white_barcode(barcode)
+ fill = (0, 0, 0) # text colour fill
+ if badge.is_inverted:
+ fill = (255, 255, 255)
+ barcode = self.invert_barcode(barcode)
+ template = Image.open(template)
+ template = template.convert("RGBA")
+ barcode = barcode.convert("RGBA")
+ barcode = barcode.resize((555,125), Image.ANTIALIAS)
+ template.paste(barcode, (400,520), barcode)
+ # font for user information
+ font_loc = str(bundled_data_path(self)/"arial.ttf")
+ try:
+ font1 = ImageFont.truetype(font_loc, 30)
+ font2 = ImageFont.truetype(font_loc, 24)
+ except Exception as e:
+ print(e)
+ font1 = None
+ font2 = None
+ # font for extra information
+
+ draw = ImageDraw.Draw(template)
+ # adds username
+ draw.text((225, 330), str(user.display_name), fill=fill, font=font1)
+ # adds ID Class
+ draw.text((225, 400), badge.code + "-" + str(user).split("#")[1], fill=fill, font=font1)
+ # adds user id
+ draw.text((250, 115), str(user.id), fill=fill, font=font2)
+ # adds user status
+ draw.text((250, 175), status, fill=fill, font=font2)
+ # adds department from top role
+ draw.text((250, 235), department, fill=fill, font=font2)
+ # adds user level
+ draw.text((420, 475), "LEVEL " + level, fill="red", font=font1)
+ # adds user level
+ if badge.badge_name != "discord" and user is discord.Member:
+ draw.text((60, 585), str(user.joined_at), fill=fill, font=font2)
+ else:
+ draw.text((60, 585), str(user.created_at), fill=fill, font=font2)
+ return template
+
+ def make_animated_gif(self, template, avatar):
+ """Create animated badge from gif avatar"""
+ gif_list = [frame.copy() for frame in ImageSequence.Iterator(avatar)]
+ img_list = []
+ num = 0
+ for frame in gif_list:
+ temp2 = template.copy()
+ watermark = frame.copy()
+ watermark = watermark.convert("RGBA")
+ watermark = watermark.resize((100,100))
+ watermark.putalpha(128)
+ id_image = frame.resize((165, 165))
+ temp2.paste(watermark, (845,45, 945,145), watermark)
+ temp2.paste(id_image, (60,95, 225, 260))
+ temp2.thumbnail((500, 339), Image.ANTIALIAS)
+ img_list.append(temp2)
+ num += 1
+ temp = BytesIO()
+
+ temp2.save(temp, format="GIF", save_all=True, append_images=img_list, duration=0, loop=0)
+ temp.name = "temp.gif"
+ if sys.getsizeof(temp) > 7000000 and sys.getsizeof(temp) < 8000000:
+ break
+ return temp
+
+ def make_badge(self, template, avatar):
+ """Create basic badge from regular avatar"""
+ watermark = avatar.convert("RGBA")
+ watermark.putalpha(128)
+ watermark = watermark.resize((100,100))
+ id_image = avatar.resize((165, 165))
+ template.paste(watermark, (845,45, 945,145), watermark)
+ template.paste(id_image, (60,95, 225, 260))
+ temp = BytesIO()
+ template.save(temp, format="PNG")
+ temp.name = "temp.gif"
+ return temp
+
+ async def create_badge(self, user, badge):
+ """Async create badges handler"""
+ template_img = await self.dl_image(badge.file_name)
+ task = functools.partial(self.make_template, user=user, badge=badge, template=template_img)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ template = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ if user.is_avatar_animated():
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="gif")))
+ task = functools.partial(self.make_animated_gif, template=template, avatar=avatar)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+
+ else:
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="png")))
+ task = functools.partial(self.make_badge, template=template, avatar=avatar)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+
+ temp.seek(0)
+ return temp
+
+ async def get_badge(self, badge_name, guild=None):
+ if guild is None:
+ guild_badges = []
+ else:
+ guild_badges = await self.config.guild(guild).badges()
+ all_badges = await self.config.badges() + guild_badges
+ to_return = None
+ for badge in all_badges:
+ if badge_name.lower() in badge["badge_name"].lower():
+ to_return = await Badge.from_json(badge)
+ return to_return
+
+ @commands.group(aliases=["badge"])
+ async def badges(self, ctx, *, badge):
+ """
+ Creates a fun fake badge based on your discord profile
+
+ `badge` is the name of the badges
+ do `[p]listbadges` to see available badges
+ """
+ guild = ctx.message.guild
+ user = ctx.message.author
+ if badge.lower() == "list":
+ await ctx.invoke(self.listbadges)
+ return
+ badge = await self.get_badge(badge, guild)
+ if badge is None:
+ await ctx.send_help()
+ return
+ async with ctx.channel.typing():
+ badge_img = await self.create_badge(user, badge)
+ if badge_img is None:
+ await ctx.send("Something went wrong sorry!")
+ return
+ image = discord.File(badge_img)
+ await ctx.send(file=image)
+
+
+ @commands.command()
+ async def listbadges(self, ctx):
+ """
+ List the available badges that can be created
+ """
+ guild = ctx.message.guild
+ global_badges = await self.config.badges()
+ guild_badges = await self.config.guild(guild).badges()
+ msg = ", ".join(badge["badge_name"] for badge in global_badges)
+ em = discord.Embed()
+ #for badge in await self.config.badges():
+ em.add_field(name="Global Badges", value=msg)
+ if guild_badges != []:
+ em.add_field(name="Global Badges", value=", ".join(badge["badge_name"] for badge in guild_badges))
+ await ctx.send(embed=em)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/badges/data/arial.ttf b/badges/data/arial.ttf
new file mode 100644
index 0000000..12cc15c
Binary files /dev/null and b/badges/data/arial.ttf differ
diff --git a/badges/info.json b/badges/info.json
new file mode 100644
index 0000000..88d5338
--- /dev/null
+++ b/badges/info.json
@@ -0,0 +1,26 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Create your own 3 letter agency badge! Works with gif avatars too.",
+ "install_msg":"Type [p]badges to see what badges are available!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Badges",
+ "permissions":[
+ "attach_files"
+ ],
+ "requirements":[
+ "pillow",
+ "pybarcode"
+ ],
+ "short":"Create your own badge!",
+ "tags":[
+ "general",
+ "images",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/badges/templates.py b/badges/templates.py
new file mode 100644
index 0000000..355f14d
--- /dev/null
+++ b/badges/templates.py
@@ -0,0 +1,47 @@
+blank_template = [
+ {"badge_name":"cia","code":"CIA", "file_name":"https://i.imgur.com/QkDQoqh.png", "is_inverted":False},
+ {"badge_name":"discord","code":"DISCORD", "file_name":"https://i.imgur.com/undefined.png", "is_inverted":False},
+ {"badge_name":"cicada","code":"CICADA", "file_name":"https://i.imgur.com/DktANMF.png", "is_inverted":False},
+ {"badge_name":"ioi","code":"IOI", "file_name":"https://i.imgur.com/kYiSeFf.png", "is_inverted":False},
+ {"badge_name":"fbi","code":"FBI", "file_name":"https://i.imgur.com/5yM0hy8.png", "is_inverted":False},
+ {"badge_name":"nsa","code":"NSA", "file_name":"https://i.imgur.com/zW3nCgx.png", "is_inverted":False},
+ {"badge_name":"gab","code":"GAB", "file_name":"https://i.imgur.com/zS50DI0.png", "is_inverted":False},
+ {"badge_name":"dop","code":"DOP", "file_name":"https://i.imgur.com/GbX8MxD.png", "is_inverted":False},
+ {"badge_name":"shit","code":"SHIT", "file_name":"https://i.imgur.com/HK6ieKq.png", "is_inverted":False},
+ {"badge_name":"bunker","code":"BUNKER", "file_name":"https://i.imgur.com/BTVHKMb.png", "is_inverted":False},
+ {"badge_name":"dprk","code":"DPRK", "file_name":"https://i.imgur.com/PkmicXZ.png", "is_inverted":False},
+ {"badge_name":"kek","code":"KEK", "file_name": "https://i.imgur.com/SMyXZBg.png", "is_inverted":False},
+ {"badge_name":"q","code":"Q !ITPb.qbhqo", "file_name":"https://i.imgur.com/gQjSRpl.png", "is_inverted":True},
+ {"badge_name":"dhs","code":"SpaceX", "file_name":"https://i.imgur.com/ibtbEjr.png", "is_inverted":False},
+ {"badge_name":"unsc","code":"UNSC", "file_name": "https://i.imgur.com/OnnWRfL.png", "is_inverted":False},
+ {"badge_name":"Anahein Ducks","code":"ANA", "file_name": "https://i.imgur.com/cOELhhT.png", "is_inverted":False},
+ {"badge_name":"Arizona Coyotes","code":"ARI", "file_name": "https://i.imgur.com/IjXyvtM.png", "is_inverted":False},
+ {"badge_name":"Boston Bruins","code":"BOS", "file_name": "https://i.imgur.com/muRcEUm.png", "is_inverted":False},
+ {"badge_name":"Buffalo Sabres","code":"BUF", "file_name": "https://i.imgur.com/8RBNDzH.png", "is_inverted":False},
+ {"badge_name":"Calgary Flames","code":"CGY", "file_name": "https://i.imgur.com/Ps0m7ww.png", "is_inverted":False},
+ {"badge_name":"Carolina Hurricanes","code":"CAR", "file_name": "https://i.imgur.com/gWX73Fo.png", "is_inverted":False},
+ {"badge_name":"Chicago Blackhawks","code":"CHI", "file_name": "https://i.imgur.com/XBHEtej.png", "is_inverted":False},
+ {"badge_name":"Colorado Avalanche","code":"COL", "file_name": "https://i.imgur.com/oaZfakk.png", "is_inverted":False},
+ {"badge_name":"Columbus Blue Jackets","code":"CBJ", "file_name": "https://i.imgur.com/DStIvvx.png", "is_inverted":False},
+ {"badge_name":"Dallas Stars","code":"DAL", "file_name": "https://i.imgur.com/3ZxaXNG.png", "is_inverted":False},
+ {"badge_name":"Detroit Red Wings","code":"DET", "file_name":"https://i.imgur.com/c1wNMDg.png", "is_inverted":False},
+ {"badge_name":"Edmonton Oilers","code":"EDM", "file_name":"https://i.imgur.com/gAnvRNH.png", "is_inverted":False},
+ {"badge_name":"Florida Panthers","code":"FLA", "file_name": "https://i.imgur.com/D7XIS4S.png", "is_inverted":False},
+ {"badge_name":"Los Angeles Kings","code":"LAK", "file_name": "https://i.imgur.com/ljQJpO8.png", "is_inverted":False},
+ {"badge_name":"Minnesota Wild","code":"MIN", "file_name": "https://i.imgur.com/5sJiDKO.png", "is_inverted":False},
+ {"badge_name":"Montréal Canadiens","code":"MTL", "file_name": "https://i.imgur.com/Izikpfh.png", "is_inverted":False},
+ {"badge_name":"Nashville Predators","code":"NSH", "file_name": "https://i.imgur.com/acFYYjG.png", "is_inverted":False},
+ {"badge_name":"New Jersey Devils","code":"NJD", "file_name": "https://i.imgur.com/3iTGZ5g.png", "is_inverted":False},
+ {"badge_name":"New York Islanders","code":"NYI", "file_name": "https://i.imgur.com/hiFB2ol.png", "is_inverted":False},
+ {"badge_name":"New York Rangers","code":"NYR", "file_name": "https://i.imgur.com/sUGtyVT.png", "is_inverted":False},
+ {"badge_name":"Ottawa Senators","code":"OTT", "file_name": "https://i.imgur.com/eNCJ2Kw.png", "is_inverted":False},
+ {"badge_name":"Philadelphia Flyers","code":"PHI", "file_name": "https://i.imgur.com/X8rh7sw.png", "is_inverted":False},
+ {"badge_name":"Pittsburgh Penguins","code":"PIT", "file_name": "https://i.imgur.com/YXepjgK.png", "is_inverted":False},
+ {"badge_name":"San Jose Sharks","code":"SJS", "file_name": "https://i.imgur.com/KPlna0Y.png", "is_inverted":False},
+ {"badge_name":"St. Louis Blues","code":"STL", "file_name": "https://i.imgur.com/Qb7kpwc.png", "is_inverted":False},
+ {"badge_name":"Tampa Bay Lightning","code":"TBL", "file_name": "https://i.imgur.com/BwiKWwv.png", "is_inverted":False},
+ {"badge_name":"Toronto Maple Leafs","code":"TOR", "file_name": "https://i.imgur.com/MuiYOFx.png", "is_inverted":False},
+ {"badge_name":"Vancouver Canucks","code":"VAN", "file_name": "https://i.imgur.com/qGEH80F.png", "is_inverted":False},
+ {"badge_name":"Vegas Golden Knights","code":"VGK", "file_name": "https://i.imgur.com/SqUjpK7.png", "is_inverted":False},
+ {"badge_name":"Washington Capitals","code":"WSH", "file_name":"https://i.imgur.com/lToLSgL.png", "is_inverted":False},
+ {"badge_name":"Winnipeg Jets","code":"WPG", "file_name": "https://i.imgur.com/e6zr2O7.png", "is_inverted":False}]
\ No newline at end of file
diff --git a/chatter/__init__.py b/chatter/__init__.py
new file mode 100644
index 0000000..4b1b643
--- /dev/null
+++ b/chatter/__init__.py
@@ -0,0 +1,4 @@
+from .chatter import Chatter
+
+def setup(bot):
+ bot.add_cog(Chatter(bot))
\ No newline at end of file
diff --git a/chatter/chatter.py b/chatter/chatter.py
new file mode 100644
index 0000000..7d6b18f
--- /dev/null
+++ b/chatter/chatter.py
@@ -0,0 +1,112 @@
+from redbot.core import commands
+from redbot.core import checks
+from redbot.core import Config
+import aiohttp
+import discord
+import chatterbot
+from chatterbot.trainers import ListTrainer
+import functools
+import asyncio
+
+
+class Chatter(getattr(commands, "Cog", object)):
+ """Chatterbot"""
+
+ def __init__(self, bot):
+ self.bot = bot
+ default_guild = {"toggle": False, "channel": None}
+ default_channel = {"message": None, "author": None}
+ self.config = Config.get_conf(self, 3568777796)
+ self.config.register_guild(**default_guild)
+ self.config.register_channel(**default_channel)
+ self.chatbot = chatterbot.ChatBot("Redbot",
+ output_adapter="chatterbot.output.OutputAdapter",
+ storage_adapter="chatterbot.storage.MongoDatabaseAdapter",
+ output_format="text",
+ # database="data/chatterbot/db",
+ logic_adapters=[
+ "chatterbot.logic.BestMatch",
+ "chatterbot.logic.TimeLogicAdapter",
+ "chatterbot.logic.MathematicalEvaluation"]
+ )
+ self.chatbot.set_trainer(ListTrainer, show_training_progress=False)
+
+ @commands.group(no_pm=True, invoke_without_command=True, pass_context=True)
+ async def chatterbot(self, ctx, *, message):
+ """Talk with cleverbot"""
+ author = ctx.message.author
+ channel = ctx.message.channel
+ response = self.chatbot.get_response(message)
+ await ctx.send(response)
+
+ @chatterbot.command(pass_context=True)
+ @checks.mod_or_permissions(manage_channels=True)
+ async def toggle(self, ctx):
+ """Toggles reply on mention"""
+ guild = ctx.message.guild
+ cur_toggle = await self.config.guild(guild).toggle()
+ await self.config.guild(guild).toggle.set(not cur_toggle)
+ if cur_toggle:
+ await ctx.send("I won't reply on mention anymore.")
+ else:
+ await ctx.send("I will reply on mention.")
+
+ @chatterbot.command(pass_context=True)
+ @checks.mod_or_permissions(manage_channels=True)
+ async def channel(self, ctx, channel: discord.TextChannel=None):
+ """Toggles channel for automatic replies"""
+ guild = ctx.message.guild
+ if channel is None:
+ await self.config.guild(guild).channel.set(channel)
+ else:
+ await self.config.guild(guild).channel.set(channel.id)
+ await ctx.send("I will reply in {}".format(channel.mention))
+
+
+ async def on_message(self, message):
+ guild = message.guild
+ channel = message.channel
+ author = message.author
+ conversation = []
+ if "http" in message.content or message.content == "" or author.bot:
+ return
+ last_author = await self.config.channel(channel).author()
+ last_message = await self.config.channel(channel).message()
+ if author.id == last_author and last_message != message.content:
+
+ await self.config.channel(channel).message.set(last_message + "\n" + message.content)
+ if author.id != last_author and author.id != self.bot.user.id and last_author is not None:
+
+ conversation.append(message.content)
+ conversation.append(last_message)
+ task = functools.partial(self.chatbot.train, conversation=conversation)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ response = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ # self.chatbot.train(conversation)
+ await self.config.channel(channel).message.set(None)
+ await self.config.channel(channel).author.set(None)
+ if last_author is None and last_message is None:
+ await self.config.channel(channel).message.set(message.content)
+ await self.config.channel(channel).author.set(author.id)
+ if not await self.config.guild(guild).toggle() or message.guild is None:
+ return
+
+ if author.id != self.bot.user.id:
+ to_strip = "@" + author.guild.me.display_name + " "
+ text = message.clean_content
+ if not text.startswith(to_strip) and message.channel.id != await self.config.guild(guild).channel():
+ return
+ text = text.replace(to_strip, "", 1)
+ text = text.replace("@everyone ", "")
+ text = text.replace("@here", "")
+ async with message.channel.typing():
+ task = functools.partial(self.chatbot.get_response, input_item=text)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ response = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ await message.channel.send(response)
diff --git a/chatter/info.json b/chatter/info.json
new file mode 100644
index 0000000..2e9d82b
--- /dev/null
+++ b/chatter/info.json
@@ -0,0 +1,21 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Talk to your bot and build a unique dataset for conversations!",
+ "install_msg":"Talk to your bot and have it learn how to talk in conversations! Recommended you unload the cleverbot cog before running.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Chatterbot",
+ "permissions":[],
+ "requirements":[
+ "chatterbot"
+ ],
+ "short":"chatterbot",
+ "tags":[
+ "general"
+ ]
+}
\ No newline at end of file
diff --git a/cleverbot/__init__.py b/cleverbot/__init__.py
new file mode 100644
index 0000000..00b2af0
--- /dev/null
+++ b/cleverbot/__init__.py
@@ -0,0 +1,5 @@
+from .cleverbot import Cleverbot
+
+def setup(bot):
+ cog = Cleverbot(bot)
+ bot.add_cog(cog)
\ No newline at end of file
diff --git a/cleverbot/cleverbot.py b/cleverbot/cleverbot.py
new file mode 100644
index 0000000..6879f59
--- /dev/null
+++ b/cleverbot/cleverbot.py
@@ -0,0 +1,221 @@
+from redbot.core import commands
+from redbot.core import checks
+from redbot.core import Config
+import os
+import aiohttp
+import discord
+
+API_URL = "https://www.cleverbot.com/getreply"
+IO_API_URL = "https://cleverbot.io/1.0"
+
+
+class CleverbotError(Exception):
+ pass
+
+class NoCredentials(CleverbotError):
+ pass
+
+class InvalidCredentials(CleverbotError):
+ pass
+
+class APIError(CleverbotError):
+ pass
+
+class OutOfRequests(CleverbotError):
+ pass
+
+class OutdatedCredentials(CleverbotError):
+ pass
+
+
+class Cleverbot(getattr(commands, "Cog", object)):
+ """Cleverbot rewritten for V3 from https://github.com/Twentysix26/26-Cogs/tree/master/cleverbot"""
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 127486454786)
+ default_global = {"api":None, "io_user":None, "io_key":None}
+ default_guild = {"channel":None, "toggle":False}
+ self.config.register_global(**default_global)
+ self.config.register_guild(**default_guild)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.instances = {}
+
+ @commands.group(no_pm=True, invoke_without_command=True)
+ async def cleverbot(self, ctx, *, message):
+ """Talk with cleverbot"""
+ author = ctx.message.author
+ channel = ctx.message.channel
+ async with channel.typing():
+ try:
+ result = await self.get_response(author, message)
+ except NoCredentials:
+ await ctx.send("The owner needs to set the credentials first.\n"
+ "See: `[p]cleverbot apikey` or `[p]cleverbot ioapikey`")
+ except APIError as e:
+ await ctx.send("Error contacting the API. Error code: {}".format(e))
+ except InvalidCredentials:
+ await ctx.send("The token that has been set is not valid.\n"
+ "See: `[p]cleverbot apikey`")
+ except OutOfRequests:
+ await ctx.send("You have ran out of requests for this month. "
+ "The free tier has a 5000 requests a month limit.")
+ except OutdatedCredentials:
+ await ctx.send("You need a valid cleverbot.com api key for this to "
+ "work. The old cleverbot.io service will soon be no "
+ "longer active. See `[p]help cleverbot apikey`")
+ else:
+ await ctx.send(result)
+
+ @cleverbot.command(pass_context=True)
+ @checks.mod_or_permissions(manage_channels=True)
+ async def toggle(self, ctx):
+ """Toggles reply on mention"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).toggle():
+ await self.config.guild(guild).toggle.set(True)
+ await ctx.send("I will reply on mention.")
+ else:
+ await self.config.guild(guild).toggle.set(False)
+ await ctx.send("I won't reply on mention anymore.")
+
+ @cleverbot.command(pass_context=True)
+ @checks.mod_or_permissions(manage_channels=True)
+ async def channel(self, ctx, channel: discord.TextChannel=None):
+ """Toggles channel for automatic replies"""
+ guild = ctx.message.guild
+ if channel is None:
+ channel = ctx.message.channel
+ await self.config.guild(guild).channel.set(channel.id)
+ await ctx.send("I will reply in {}".format(channel))
+
+ @cleverbot.command()
+ @checks.is_owner()
+ async def apikey(self, ctx, key: str=None):
+ """Sets token to be used with cleverbot.com
+ You can get it from https://www.cleverbot.com/api/
+ Use this command in direct message to keep your
+ token secret"""
+ await self.config.api.set(key)
+ await ctx.send("Credentials set.")
+
+ @cleverbot.command()
+ @checks.is_owner()
+ async def ioapikey(self, ctx, io_user: str=None, io_key: str=None):
+ """Sets token to be used with cleverbot.io
+ You can get it from https://www.cleverbot.io/
+ Use this command in direct message to keep your
+ token secret"""
+ await self.config.io_user.set(io_user)
+ await self.config.io_key.set(io_key)
+ await ctx.send("Credentials set.")
+
+ async def get_response(self, author, text):
+ payload = {}
+ try:
+ payload["key"] = await self.get_credentials()
+ payload["cs"] = self.instances.get(str(author.id), "")
+ payload["input"] = text
+ return await self.get_cleverbotcom_response(payload, author)
+ except NoCredentials:
+ guild = author.guild
+ if guild is None:
+ return
+ payload["user"], payload["key"] = await self.get_io_credentials()
+ payload["nick"] = str("{}#{}".format(guild.me.name, guild.me.discriminator))
+ return await self.get_cleverbotio_response(payload, text)
+
+ async def make_cleverbotio_instance(self, payload):
+ """Makes the cleverbot.io instance if one isn't created for the user"""
+ del payload["text"]
+ async with self.session.post(IO_API_URL+"/create", json=payload) as r:
+ if r.status == 200:
+ return
+ elif r.status == 400:
+ raise InvalidCredentials()
+ else:
+ raise APIError("Error making instance: " + str(r.status))
+
+ async def get_cleverbotio_response(self, payload, text):
+ payload["text"] = text
+ async with self.session.post(IO_API_URL+"/ask/", json=payload) as r:
+ if r.status == 200:
+ data = await r.json()
+ elif r.status == 400:
+ # Try to make the instance for the user first before raising the error
+ await self. make_cleverbotio_instance(payload)
+ return await self.get_cleverbotio_response(payload, text)
+ else:
+ raise APIError("Error getting response: " + str(r.status))
+ return data["response"]
+
+ async def get_cleverbotcom_response(self, payload, author):
+ async with self.session.get(API_URL, params=payload) as r:
+ # print(r.status)
+ if r.status == 200:
+ data = await r.json()
+ self.instances[str(author.id)] = data["cs"] # Preserves conversation status
+ elif r.status == 401:
+ raise InvalidCredentials()
+ elif r.status == 503:
+ raise OutOfRequests()
+ else:
+ raise APIError(str(r.status))
+ return data["output"]
+
+
+ async def get_credentials(self):
+ key = await self.config.api()
+ if key is None:
+ raise NoCredentials()
+ else:
+ return key
+
+ async def get_io_credentials(self):
+ io_key = await self.config.io_key()
+ io_user = await self.config.io_user()
+ if io_key is None:
+ raise NoCredentials()
+ else:
+ return io_user, io_key
+
+ async def on_message(self, message):
+ if not hasattr(message, "guild"):
+ return
+ guild = message.guild
+ if guild is None:
+ return
+ author = message.author
+ channel = message.channel
+
+ if message.author.id != self.bot.user.id:
+ to_strip = "@" + guild.me.display_name + " "
+ text = message.clean_content
+ if not text.startswith(to_strip) and message.channel.id != await self.config.guild(guild).channel():
+ return
+ if not await self.config.guild(guild).toggle():
+ return
+ async with channel.typing():
+ try:
+ response = await self.get_response(author, text)
+ except NoCredentials:
+ await channel.send("The owner needs to set the credentials first.\n"
+ "See: `[p]cleverbot apikey`")
+ except APIError as e:
+ await ctx.send("Error contacting the API. Error code: {}".format(e))
+ except InvalidCredentials:
+ await channel.send("The token that has been set is not valid.\n"
+ "See: `[p]cleverbot apikey`")
+ except OutOfRequests:
+ await channel.send("You have ran out of requests for this month. "
+ "The free tier has a 5000 requests a month limit.")
+ except OutdatedCredentials:
+ await channel.send("You need a valid cleverbot.com api key for this to "
+ "work. The old cleverbot.io service will soon be no "
+ "longer active. See `[p]help cleverbot apikey`")
+ else:
+ await channel.send(response)
+
+ def __unload(self):
+ if self.session:
+ self.bot.loop.create_task(self.session.close())
diff --git a/cleverbot/info.json b/cleverbot/info.json
new file mode 100644
index 0000000..4d9634e
--- /dev/null
+++ b/cleverbot/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "Twentysix",
+ "TrustyJAID"
+ ],
+ "description":"Allows for interaction with cleverbot.com through mention/command",
+ "install_msg":"Needs to be setup with an API key first. See `[p]cleverbot apikey`\n[p]cleverbot ` to talk with cleverbot.\n`@Mention ` works too.\n`[p]cleverbot toggle` disables replies by mention.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Cleverbot",
+ "permissions":[],
+ "requirements":[],
+ "short":"Talk with Cleverbot!",
+ "tags":[
+ "chatbot",
+ "cleverbot",
+ "conversation"
+ ]
+}
\ No newline at end of file
diff --git a/compliment/__init__.py b/compliment/__init__.py
new file mode 100644
index 0000000..bb12f9b
--- /dev/null
+++ b/compliment/__init__.py
@@ -0,0 +1,5 @@
+from .compliment import Compliment
+
+def setup(bot):
+ n = Compliment(bot)
+ bot.add_cog(n)
diff --git a/compliment/compliment.py b/compliment/compliment.py
new file mode 100644
index 0000000..4f7748b
--- /dev/null
+++ b/compliment/compliment.py
@@ -0,0 +1,33 @@
+import discord
+from redbot.core import commands
+from random import choice
+import os
+from .compliments import compliments
+
+
+class Compliment(getattr(commands, "Cog", object)):
+
+ """Airenkun's Insult Cog"""
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command()
+ async def compliment(self, ctx, user : discord.Member=None):
+ """
+ Compliment the user
+
+ `user` the user you would like to compliment
+ """
+
+ msg = ' '
+ if user != None:
+
+ if user.id == self.bot.user.id:
+ user = ctx.message.author
+ msg = [" Hey, I appreciate the compliment! :smile:", "No ***YOU'RE*** awesome! :smile:"]
+ await ctx.send(user.mention + choice(msg))
+
+ else:
+ await ctx.send(user.mention + msg + choice(compliments))
+ else:
+ await ctx.send(ctx.message.author.mention + msg + choice(compliments))
diff --git a/compliment/compliments.py b/compliment/compliments.py
new file mode 100644
index 0000000..910aae1
--- /dev/null
+++ b/compliment/compliments.py
@@ -0,0 +1,99 @@
+compliments = ["Your smile is contagious.",
+"You look great today.",
+"You're a smart cookie.",
+"I bet you make babies smile.",
+"You have impeccable manners.",
+"I like your style.",
+"You have the best laugh.",
+"I appreciate you.",
+"You are the most perfect you there is.",
+"You are enough.",
+"You're strong.",
+"Your perspective is refreshing.",
+"You're an awesome friend.",
+"You light up the room.",
+"You deserve a hug right now.",
+"You should be proud of yourself.",
+"You're more helpful than you realize.",
+"You have a great sense of humor.",
+"You've got all the right moves!",
+"Is that your picture next to \"charming\" in the dictionary?",
+"Your kindness is a balm to all who encounter it.",
+"You're all that and a super-size bag of chips.",
+"On a scale from 1 to 10, you're an 11.",
+"You are brave.",
+"You're even more beautiful on the inside than you are on the outside.",
+"You have the courage of your convictions.",
+"Your eyes are breathtaking.",
+"If cartoon bluebirds were real, a bunch of them would be sitting on your shoulders singing right now.",
+"You are making a difference.",
+"You're like sunshine on a rainy day.",
+"You bring out the best in other people.",
+"Your ability to recall random factoids at just the right time is impressive.",
+"You're a great listener.",
+"How is it that you always look great, even in sweatpants?",
+"Everything would be better if more people were like you!",
+"I bet you sweat glitter.",
+"You were cool way before hipsters were cool.",
+"That color is perfect on you.",
+"Hanging out with you is always a blast.",
+"You always know -- and say -- exactly what I need to hear when I need to hear it.",
+"You smell really good.",
+"You may dance like no one's watching, but everyone's watching because you're an amazing dancer!",
+"Being around you makes everything better!",
+"When you say, \"I meant to do that,\" I totally believe you.",
+"When you're not afraid to be yourself is when you're most incredible.",
+"Colors seem brighter when you're around.",
+"You're more fun than a ball pit filled with candy. (And seriously, what could be more fun than that?)",
+"That thing you don't like about yourself is what makes you so interesting.",
+"You're wonderful.",
+"You have cute elbows. For reals! (You're halfway through the list. Don't stop now! You should be giving at least one awesome compliment every day!)",
+"Jokes are funnier when you tell them.",
+"You're better than a triple-scoop ice cream cone. With sprinkles.",
+"Your hair looks stunning.",
+"You're one of a kind!",
+"You're inspiring.",
+"If you were a box of crayons, you'd be the giant name-brand one with the built-in sharpener.",
+"You should be thanked more often. So thank you!!",
+"Our community is better because you're in it.",
+"Someone is getting through something hard right now because you've got their back.",
+"You have the best ideas.",
+"You always know how to find that silver lining.",
+"Everyone gets knocked down sometimes, but you always get back up and keep going.",
+"You're a candle in the darkness.",
+"You're a great example to others.",
+"Being around you is like being on a happy little vacation.",
+"You always know just what to say.",
+"You're always learning new things and trying to better yourself, which is awesome.",
+"If someone based an Internet meme on you, it would have impeccable grammar.",
+"You could survive a Zombie apocalypse.",
+"You're more fun than bubble wrap.",
+"When you make a mistake, you fix it.",
+"Who raised you? They deserve a medal for a job well done.",
+"You're great at figuring stuff out.",
+"Your voice is magnificent.",
+"The people you love are lucky to have you in their lives.",
+"You're like a breath of fresh air.",
+"You're gorgeous -- and that's the least interesting thing about you, too.",
+"You're so thoughtful.",
+"Your creative potential seems limitless.",
+"Your name suits you to a T.",
+"You're irresistible when you blush.",
+"Actions speak louder than words, and yours tell an incredible story.",
+"Somehow you make time stop and fly at the same time.",
+"When you make up your mind about something, nothing stands in your way.",
+"You seem to really know who you are.",
+"Any team would be lucky to have you on it.",
+"In high school I bet you were voted \"most likely to keep being awesome.\"",
+"I bet you do the crossword puzzle in ink.",
+"Babies and small animals probably love you.",
+"If you were a scented candle they'd call it Perfectly Imperfect (and it would smell like summer).",
+"There's ordinary, and then there's you.",
+"You're someone's reason to smile.",
+"You're even better than a unicorn, because you're real.",
+"How do you keep being so funny and making everyone laugh?",
+"You have a good head on your shoulders.",
+"Has anyone ever told you that you have great posture?",
+"The way you treasure your loved ones is incredible.",
+"You're really something special.",
+"You're a gift to those around you."]
\ No newline at end of file
diff --git a/compliment/info.json b/compliment/info.json
new file mode 100644
index 0000000..58bcde5
--- /dev/null
+++ b/compliment/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "Airen",
+ "JennJenn",
+ "TrustyJAID"
+ ],
+ "description":"Compliment people in a creative way",
+ "install_msg":"Usage: `[p]compliment `",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Compliment",
+ "permissions":[],
+ "requirements":[],
+ "short":"Compliment people in a creative way",
+ "tags":[
+ "compliments",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/conversions/__init__.py b/conversions/__init__.py
new file mode 100644
index 0000000..e522413
--- /dev/null
+++ b/conversions/__init__.py
@@ -0,0 +1,6 @@
+from .conversions import Conversions
+
+
+def setup(bot):
+ n = Conversions(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/conversions/conversions.py b/conversions/conversions.py
new file mode 100644
index 0000000..b0eb8fa
--- /dev/null
+++ b/conversions/conversions.py
@@ -0,0 +1,353 @@
+import discord
+from redbot.core import commands
+import datetime
+import aiohttp
+import asyncio
+import json
+import re
+
+
+class Conversions(getattr(commands, "Cog", object)):
+ """
+ Gather information about various crypto currencies,
+ rare metals, stocks, and converts to different currencies
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ @commands.command(pass_context=True, aliases=["bitcoin", "BTC"])
+ async def btc(self, ctx, ammount:float=1.0, currency="USD", full=True):
+ """
+ converts from BTC to a given currency.
+
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, "BTC", ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, "BTC", ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True, aliases=["ethereum", "ETH"])
+ async def eth(self, ctx, ammount:float=1.0, currency="USD", full=True):
+ """
+ converts from ETH to a given currency.
+
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, "ETH", ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, "ETH", ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True, aliases=["litecoin", "LTC"])
+ async def ltc(self, ctx, ammount:float=1.0, currency="USD", full=True):
+ """
+ converts from LTC to a given currency.
+
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, "LTC", ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, "LTC", ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True, aliases=["monero", "XMR"])
+ async def xmr(self, ctx, ammount:float=1.0, currency="USD", full=True):
+ """
+ converts from LTC to a given currency.
+
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, "XMR", ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, "XMR", ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True, aliases=["bitcoin-cash", "BCH"])
+ async def bch(self, ctx, ammount:float=1.0, currency="USD", full=True):
+ """
+ converts from LTC to a given currency.
+
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, "BCH", ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, "BCH", ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+ async def checkcoins(self, base):
+ link = "https://api.coinmarketcap.com/v2/ticker/"
+ async with self.session.get(link) as resp:
+ data = await resp.json()
+ for coin in data["data"]:
+ if base.upper() == data["data"][coin]["symbol"].upper() or base.lower() == data["data"][coin]["name"].lower():
+ return data["data"][coin]
+ return None
+
+ @commands.command(pass_context=True)
+ async def multicoin(self, ctx, *, coins=None):
+ """
+ Gets the current USD value for a list of coins
+
+ `coins` must be a list of white space separated crypto coins
+ e.g. `[p]multicoin BTC BCH LTC ETH DASH XRP`
+ """
+ coin_list = []
+ if coins is None:
+ async with self.session.get("https://api.coinmarketcap.com/v2/ticker/") as resp:
+ data = await resp.json()
+ for coin in data["data"]:
+ coin_list.append(data["data"][coin])
+ else:
+ coins = re.split("\W+", coins)
+ for coin in coins:
+ coin_list.append(await self.checkcoins(coin))
+ embed = discord.Embed(title="Crypto coin comparison")
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ for coin in coin_list[:25]:
+ if coin is not None:
+ msg = "1 {0} is {1:,.2f} USD".format(coin["symbol"], float(coin["quotes"]["USD"]["price"]))
+ embed.add_field(name=coin["name"], value=msg)
+ await ctx.send(embed=embed)
+ else:
+ msg = ""
+ for coin in coin_list[:25]:
+ if coin is not None:
+ msg += "1 {0} is {1:,.2f} USD\n".format(coin["symbol"], float(coin["quotes"]["USD"]["price"]))
+ await ctx.send(msg)
+
+ @commands.command(pass_context=True)
+ async def crypto(self, ctx, coin, ammount:float=1.0, currency="USD", full=True):
+ """
+ Displays the latest information about a specified crypto currency
+
+ `coin` must be the name or symbol of a crypto coin
+ `amount` is any number to convert the value of defaults to 1 coin
+ `currency` is the desired currency you want to convert defaults to USD
+ `full` is a True/False value whether to display just the converted amount
+ or the full display for the currency
+ """
+ if ammount == 1.0:
+ embed = await self.crypto_embed(ctx, coin, ammount, currency, full)
+ else:
+ embed = await self.crypto_embed(ctx, coin, ammount, currency, False)
+ if type(embed) is str:
+ await ctx.send(embed)
+ else:
+ await ctx.send(embed=embed)
+
+ async def crypto_embed(self, ctx, coin, ammount=1.0, currency="USD", full=True):
+ """Creates the embed for the crypto currency"""
+ coin_data = await self.checkcoins(coin)
+ if coin_data is None:
+ await ctx.send("{} is not in my list of currencies!".format(coin))
+ return
+ coin_colour = {"Bitcoin": discord.Colour.gold(),
+ "Bitcoin Cash": discord.Colour.orange(),
+ "Ethereum": discord.Colour.dark_grey(),
+ "Litecoin": discord.Colour.dark_grey(),
+ "Monero": discord.Colour.orange()}
+ price = float(coin_data["quotes"]["USD"]["price"]) * ammount
+ market_cap = float(coin_data["quotes"]["USD"]["market_cap"])
+ volume_24h = float(coin_data["quotes"]["USD"]["volume_24h"])
+ coin_image = "https://s2.coinmarketcap.com/static/img/coins/128x128/{}.png".format(coin_data["id"])
+ coin_url = "https://coinmarketcap.com/currencies/{}".format(coin_data["id"])
+ if currency.upper() != "USD":
+ conversionrate = await self.conversionrate("USD", currency.upper())
+ price = conversionrate * price
+ market_cap = conversionrate * market_cap
+ volume_24h = conversionrate * volume_24h
+ msg = "{0} {3} is **{1:,.2f} {2}**".format(ammount, price, currency.upper(), coin_data["symbol"])
+ embed = discord.Embed(description=msg, colour=discord.Colour.dark_grey())
+ if coin_data["name"] in coin_colour:
+ embed.colour = coin_colour[coin_data["name"]]
+ embed.set_footer(text="As of")
+ embed.set_author(name=coin_data["name"], url=coin_url, icon_url=coin_image)
+ embed.timestamp = datetime.datetime.utcfromtimestamp(int(coin_data["last_updated"]))
+ if full:
+ hour_1 = coin_data["quotes"]["USD"]["percent_change_1h"]
+ hour_24 = coin_data["quotes"]["USD"]["percent_change_24h"]
+ days_7 = coin_data["quotes"]["USD"]["percent_change_7d"]
+ hour_1_emoji = "🔼" if hour_1 >= 0 else "🔽"
+ hour_24_emoji = "🔼" if hour_24 >= 0 else "🔽"
+ days_7_emoji = "🔼" if days_7 >= 0 else "🔽"
+ available_supply = "{0:,.2f}".format(coin_data["circulating_supply"])
+ max_supply = "{0:,.2f}".format(coin_data["max_supply"]) if "max_supply" in coin_data else None
+ total_supply = "{0:,.2f}".format(coin_data["total_supply"])
+ embed.set_thumbnail(url=coin_image)
+ embed.add_field(name="Market Cap", value="{0:,.2f} {1}".format(market_cap, currency.upper()))
+ embed.add_field(name="24 Hour Volume", value="{0:,.2f} {1}".format(volume_24h, currency.upper()))
+ embed.add_field(name="Available Supply", value=available_supply)
+ if max_supply is not None:
+ embed.add_field(name="Max Supply", value=max_supply)
+ embed.add_field(name="Total Supply ", value=total_supply)
+ embed.add_field(name="Change 1 hour " + hour_1_emoji, value="{}%".format(hour_1))
+ embed.add_field(name="Change 24 hours " + hour_24_emoji, value="{}%".format(hour_24))
+ embed.add_field(name="Change 7 days " +days_7_emoji, value="{}%".format(days_7))
+ if not ctx.channel.permissions_for(ctx.me).embed_links:
+ if full:
+ return (f"{msg}\nMarket Cap: **{market_cap}**\n"
+ f"24 Hour Volume: **{volume_24h}**\nAvailable Supply: **{available_supply}**\n"
+ f"Max Supply: **{max_supply}**\nTotal Supply: **{total_supply}**\n"
+ f"Change 1 hour{hour_1_emoji}: **{hour_1}%**\n"
+ f"Change 24 hours{hour_24_emoji}: **{hour_24}%**\n"
+ f"Change 7 days{days_7_emoji}: **{days_7}%**\n")
+ else:
+ return msg
+ else:
+ return embed
+
+
+ @commands.command()
+ async def gold(self, ctx, ammount=1, currency="USD"):
+ """
+ Converts gold in ounces to a given currency.
+
+ `ammount` must be a number of ounces to convert defaults to 1 ounce
+ `currency` must be a valid currency defaults to USD
+ """
+ GOLD = "https://www.quandl.com/api/v3/datasets/WGC/GOLD_DAILY_{}.json?api_key=EKvr5W-sJUFVSevcpk4v"
+ async with self.session.get(GOLD.format(currency.upper())) as resp:
+ data = await resp.json()
+ price = (data["dataset"]["data"][0][1]) * ammount
+ msg = "{0} oz of Gold is {1:,.2f} {2}".format(ammount, price, currency.upper())
+ embed = discord.Embed(descirption="Gold", colour=discord.Colour.gold())
+ embed.add_field(name="Gold", value=msg)
+ embed.set_thumbnail(url="https://upload.wikimedia.org/wikipedia/commons/d/d7/Gold-crystals.jpg")
+ if not ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send(msg)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command()
+ async def silver(self, ctx, ammount=1, currency="USD"):
+ """
+ Converts silver in ounces to a given currency.
+
+ `ammount` must be a number of ounces to convert defaults to 1 ounce
+ `currency` must be a valid currency defaults to USD
+ """
+ SILVER = "https://www.quandl.com/api/v3/datasets/LBMA/SILVER.json?api_key=EKvr5W-sJUFVSevcpk4v"
+ async with self.session.get(SILVER) as resp:
+ data = await resp.json()
+ price = (data["dataset"]["data"][0][1]) * ammount
+ if currency != "USD":
+ price = await self.conversionrate("USD", currency.upper()) * price
+ msg = "{0} oz of Silver is {1:,.2f} {2}".format(ammount, price, currency.upper())
+ embed = discord.Embed(descirption="Silver", colour=discord.Colour.lighter_grey())
+ embed.add_field(name="Silver", value=msg)
+ embed.set_thumbnail(url="https://upload.wikimedia.org/wikipedia/commons/5/55/Silver_crystal.jpg")
+ if not ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send(msg)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command()
+ async def platinum(self, ctx, ammount=1, currency="USD"):
+ """
+ Converts platinum in ounces to a given currency.
+
+ `ammount` must be a number of ounces to convert defaults to 1 ounce
+ `currency` must be a valid currency defaults to USD
+ """
+ PLATINUM = "https://www.quandl.com/api/v3/datasets/JOHNMATT/PLAT.json?api_key=EKvr5W-sJUFVSevcpk4v"
+ async with self.session.get(PLATINUM) as resp:
+ data = await resp.json()
+ price = (data["dataset"]["data"][0][1]) * ammount
+ if currency != "USD":
+ price = await self.conversionrate("USD", currency.upper()) * price
+ msg = "{0} oz of Platinum is {1:,.2f} {2}".format(ammount, price, currency.upper())
+ embed = discord.Embed(descirption="Platinum", colour=discord.Colour.dark_grey())
+ embed.add_field(name="Platinum", value=msg)
+ embed.set_thumbnail(url="https://upload.wikimedia.org/wikipedia/commons/6/68/Platinum_crystals.jpg")
+ if not ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send(msg)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True, aliases=["ticker"])
+ async def stock(self, ctx, ticker, currency="USD"):
+ """
+ Gets current ticker symbol price.
+
+ `ticker` is the ticker symbol you want to look up
+ `currency` is the currency you want to convert to defaults to USD
+ """
+ stock = "https://www.quandl.com/api/v3/datasets/WIKI/{}.json?api_key=EKvr5W-sJUFVSevcpk4v"
+ async with self.session.get(stock.format(ticker.upper())) as resp:
+ data = await resp.json()
+ convertrate = 1
+ if currency != "USD":
+ convertrate = self.conversionrate("USD", currency.upper())
+ price = (data["dataset"]["data"][0][1]) * convertrate
+ msg = "{0} is {1:,.2f} {2}".format(ticker.upper(), price, currency.upper())
+ embed = discord.Embed(descirption="Stock Price", colour=discord.Colour.lighter_grey())
+ embed.add_field(name=ticker.upper(), value=msg)
+ if not ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send(msg)
+ else:
+ await ctx.send(embed=embed)
+
+ @commands.command(pass_context=True)
+ async def convert(self, ctx, ammount:float=1.0, currency1="USD", currency2="GBP"):
+ """
+ Converts a value between 2 different currencies
+
+ `ammount` is the ammount you want to convert default is 1
+ `currency1` is the currency you have default is USD
+ `currency2` is the currency you want to convert to default is GBP
+ """
+ conversion = await self.conversionrate(currency1.upper(), currency2.upper())
+ conversion = conversion * ammount
+ await ctx.send("{0} {1} is {2:,.2f} {3}".format(ammount, currency1, conversion, currency2))
+
+ async def conversionrate(self, currency1, currency2):
+ """Function to convert different currencies"""
+ CONVERSIONRATES = "https://free.currencyconverterapi.com/api/v6/convert?q={}_{}&compact=ultra".format(currency1.upper(), currency2.upper())
+ try:
+ async with self.session.get(CONVERSIONRATES) as resp:
+ data = await resp.json()
+ conversion = data["{}_{}".format(currency1.upper(), currency2.upper())]
+ return conversion
+ except:
+ return None
+ """TODO: add feeder cattle, coffee, and sugar"""
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/conversions/info.json b/conversions/info.json
new file mode 100644
index 0000000..26f7678
--- /dev/null
+++ b/conversions/info.json
@@ -0,0 +1,24 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Conversions for BTC, currencies, precious metals, and stocks.",
+ "install_msg":"Various commands.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Conversions",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Conversions",
+ "tags":[
+ "general",
+ "utility",
+ "bitcoin",
+ "litecoin"
+ ]
+}
\ No newline at end of file
diff --git a/covfefe/__init__.py b/covfefe/__init__.py
new file mode 100644
index 0000000..e6ac7a9
--- /dev/null
+++ b/covfefe/__init__.py
@@ -0,0 +1,4 @@
+from .covfefe import Covfefe
+
+def setup(bot):
+ bot.add_cog(Covfefe(bot))
\ No newline at end of file
diff --git a/covfefe/covfefe.py b/covfefe/covfefe.py
new file mode 100644
index 0000000..0a859b7
--- /dev/null
+++ b/covfefe/covfefe.py
@@ -0,0 +1,29 @@
+import discord
+from redbot.core import commands
+import re
+
+class Covfefe(getattr(commands, "Cog", object)):
+ """
+ Convert almost any word into covfefe
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ async def covfefe(self, x, k='aeiouy])'):
+ """
+ https://codegolf.stackexchange.com/a/123697
+ """
+ try:
+ b,c,v=re.findall(f'(.*?[{k}([^{k}.*?([{k}',x)[0];return b+c+(('bcdfgkpstvz'+c)['pgtvkgbzdfs'.find(c)]+v)*2
+ except:
+ return None
+
+ @commands.command()
+ async def covefy(self, ctx, msg):
+ """Convert almost any word into covfefe"""
+ newword = await self.covfefe(msg)
+ if newword is not None:
+ await ctx.send(newword)
+ else:
+ await ctx.send("I cannot covfefeify that word")
diff --git a/covfefe/info.json b/covfefe/info.json
new file mode 100644
index 0000000..548cbe9
--- /dev/null
+++ b/covfefe/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Covfefeify almost any word!",
+ "install_msg":"Use [p]covefy to convert almost any word into covfefe",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Covfefe",
+ "permissions":[],
+ "requirements":[],
+ "short":"General commands",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/dev/__init__.py b/dev/__init__.py
new file mode 100644
index 0000000..f2ca0a1
--- /dev/null
+++ b/dev/__init__.py
@@ -0,0 +1,4 @@
+from .dev import Dev
+
+def setup(bot):
+ bot.add_cog(Dev(bot))
\ No newline at end of file
diff --git a/dev/dev.py b/dev/dev.py
new file mode 100644
index 0000000..8e956ce
--- /dev/null
+++ b/dev/dev.py
@@ -0,0 +1,316 @@
+import asyncio
+import inspect
+import io
+import textwrap
+import traceback
+import re
+from contextlib import redirect_stdout
+from copy import copy
+
+import discord
+from redbot.core import checks, commands
+from redbot.core.i18n import Translator
+from redbot.core.utils.chat_formatting import box, pagify
+
+"""
+Notice:
+
+95% of the below code came from R.Danny which can be found here:
+
+https://github.com/Rapptz/RoboDanny/blob/master/cogs/repl.py
+"""
+
+_ = Translator("Dev", __file__)
+
+START_CODE_BLOCK_RE = re.compile(r"^((```py)(?=\s)|(```))")
+
+
+class Dev(getattr(commands, "Cog", object)):
+ """Various development focused utilities."""
+
+ def __init__(self, bot):
+ super().__init__()
+ self.bot = bot
+ self._last_result = None
+ self.sessions = set()
+
+ @staticmethod
+ def cleanup_code(content):
+ """Automatically removes code blocks from the code."""
+ # remove ```py\n```
+ if content.startswith("```") and content.endswith("```"):
+ return START_CODE_BLOCK_RE.sub("", content)[:-3]
+
+ # remove `foo`
+ return content.strip("` \n")
+
+ @staticmethod
+ def get_syntax_error(e):
+ """Format a syntax error to send to the user.
+
+ Returns a string representation of the error formatted as a codeblock.
+ """
+ if e.text is None:
+ return box("{0.__class__.__name__}: {0}".format(e), lang="py")
+ return box("{0.text}{1:>{0.offset}}\n{2}: {0}".format(e, "^", type(e).__name__), lang="py")
+
+ @staticmethod
+ def get_pages(msg: str):
+ """Pagify the given message for output to the user."""
+ return pagify(msg, delims=["\n", " "], priority=True, shorten_by=10)
+
+ @staticmethod
+ def sanitize_output(ctx: commands.Context, input_: str) -> str:
+ """Hides the bot's token from a string."""
+ token = ctx.bot.http.token
+ r = "[EXPUNGED]"
+ result = input_.replace(token, r)
+ result = result.replace(token.lower(), r)
+ result = result.replace(token.upper(), r)
+ return result
+
+ @commands.command()
+ @checks.is_owner()
+ async def debug(self, ctx, *, code):
+ """Evaluate a statement of python code.
+
+ The bot will always respond with the return value of the code.
+ If the return value of the code is a coroutine, it will be awaited,
+ and the result of that will be the bot's response.
+
+ Note: Only one statement may be evaluated. Using await, yield or
+ similar restricted keywords will result in a syntax error. For multiple
+ lines or asynchronous code, see [p]repl or [p]eval.
+
+ Environment Variables:
+ ctx - command invokation context
+ bot - bot object
+ channel - the current channel object
+ author - command author's member object
+ message - the command's message object
+ discord - discord.py library
+ commands - redbot.core.commands
+ _ - The result of the last dev command.
+ """
+ env = {
+ "bot": ctx.bot,
+ "ctx": ctx,
+ "channel": ctx.channel,
+ "author": ctx.author,
+ "guild": ctx.guild,
+ "message": ctx.message,
+ "discord": discord,
+ "commands": commands,
+ "_": self._last_result,
+ }
+
+ code = self.cleanup_code(code)
+
+ try:
+ result = eval(code, env)
+ except SyntaxError as e:
+ await ctx.send(self.get_syntax_error(e))
+ return
+ except Exception as e:
+ await ctx.send(box("{}: {!s}".format(type(e).__name__, e), lang="py"))
+ return
+
+ if asyncio.iscoroutine(result):
+ result = await result
+
+ self._last_result = result
+
+ result = self.sanitize_output(ctx, str(result))
+
+ await ctx.send_interactive(self.get_pages(result), box_lang="py")
+
+ @commands.command(name="eval")
+ @checks.is_owner()
+ async def _eval(self, ctx, *, body: str):
+ """Execute asynchronous code.
+
+ This command wraps code into the body of an async function and then
+ calls and awaits it. The bot will respond with anything printed to
+ stdout, as well as the return value of the function.
+
+ The code can be within a codeblock, inline code or neither, as long
+ as they are not mixed and they are formatted correctly.
+
+ Environment Variables:
+ ctx - command invokation context
+ bot - bot object
+ channel - the current channel object
+ author - command author's member object
+ message - the command's message object
+ discord - discord.py library
+ commands - redbot.core.commands
+ _ - The result of the last dev command.
+ """
+ env = {
+ "bot": ctx.bot,
+ "ctx": ctx,
+ "channel": ctx.channel,
+ "author": ctx.author,
+ "guild": ctx.guild,
+ "message": ctx.message,
+ "discord": discord,
+ "commands": commands,
+ "_": self._last_result,
+ }
+
+ body = self.cleanup_code(body)
+ stdout = io.StringIO()
+
+ to_compile = "async def func():\n%s" % textwrap.indent(body, " ")
+
+ try:
+ exec(to_compile, env)
+ except SyntaxError as e:
+ return await ctx.send(self.get_syntax_error(e))
+
+ func = env["func"]
+ result = None
+ try:
+ with redirect_stdout(stdout):
+ result = await func()
+ except:
+ printed = "{}{}".format(stdout.getvalue(), traceback.format_exc())
+ else:
+ printed = stdout.getvalue()
+ await ctx.tick()
+
+ if result is not None:
+ self._last_result = result
+ msg = "{}{}".format(printed, result)
+ else:
+ msg = printed
+ msg = self.sanitize_output(ctx, msg)
+
+ await ctx.send_interactive(self.get_pages(msg), box_lang="py")
+
+ @commands.command()
+ @checks.is_owner()
+ async def repl(self, ctx):
+ """Open an interactive REPL.
+
+ The REPL will only recognise code as messages which start with a
+ backtick. This includes codeblocks, and as such multiple lines can be
+ evaluated.
+
+ You may not await any code in this REPL unless you define it inside an
+ async function.
+ """
+ variables = {
+ "ctx": ctx,
+ "bot": ctx.bot,
+ "message": ctx.message,
+ "guild": ctx.guild,
+ "channel": ctx.channel,
+ "author": ctx.author,
+ "_": None,
+ }
+
+ if ctx.channel.id in self.sessions:
+ await ctx.send(
+ _("Already running a REPL session in this channel. Exit it with `quit`.")
+ )
+ return
+
+ self.sessions.add(ctx.channel.id)
+ await ctx.send(_("Enter code to execute or evaluate. `exit()` or `quit` to exit."))
+
+ msg_check = lambda m: (
+ m.author == ctx.author and m.channel == ctx.channel and m.content.startswith("`")
+ )
+
+ while True:
+ response = await ctx.bot.wait_for("message", check=msg_check)
+
+ cleaned = self.cleanup_code(response.content)
+
+ if cleaned in ("quit", "exit", "exit()"):
+ await ctx.send("Exiting.")
+ self.sessions.remove(ctx.channel.id)
+ return
+
+ executor = exec
+ if cleaned.count("\n") == 0:
+ # single statement, potentially 'eval'
+ try:
+ code = compile(cleaned, "", "eval")
+ except SyntaxError:
+ pass
+ else:
+ executor = eval
+
+ if executor is exec:
+ try:
+ code = compile(cleaned, "", "exec")
+ except SyntaxError as e:
+ await ctx.send(self.get_syntax_error(e))
+ continue
+
+ variables["message"] = response
+
+ stdout = io.StringIO()
+
+ msg = ""
+
+ try:
+ with redirect_stdout(stdout):
+ result = executor(code, variables)
+ if inspect.isawaitable(result):
+ result = await result
+ except:
+ value = stdout.getvalue()
+ msg = "{}{}".format(value, traceback.format_exc())
+ else:
+ value = stdout.getvalue()
+ if result is not None:
+ msg = "{}{}".format(value, result)
+ variables["_"] = result
+ elif value:
+ msg = "{}".format(value)
+
+ msg = self.sanitize_output(ctx, msg)
+
+ try:
+ await ctx.send_interactive(self.get_pages(msg), box_lang="py")
+ except discord.Forbidden:
+ pass
+ except discord.HTTPException as e:
+ await ctx.send(_("Unexpected error: `{}`").format(e))
+
+ @commands.command()
+ @checks.is_owner()
+ async def sudo(self, ctx, user: discord.Member, *, command):
+ """Mock another user invoking a command.
+
+ The prefix must not be entered.
+ """
+ msg = copy(ctx.message)
+ msg.author = user
+ msg.content = ctx.prefix + command
+
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command(name="sudomsg")
+ @checks.is_owner()
+ async def mock_msg(self, ctx, user: discord.Member, *, content: str):
+ """Dispatch a message event as if it were sent by a different user.
+
+ Only reads the raw content of the message. Attachments, embeds etc. are
+ ignored.
+ """
+ old_author = ctx.author
+ old_content = ctx.message.content
+ ctx.message.author = user
+ ctx.message.content = content
+
+ ctx.bot.dispatch("message", ctx.message)
+
+ # If we change the author and content back too quickly,
+ # the bot won't process the mocked message in time.
+ await asyncio.sleep(2)
+ ctx.message.author = old_author
+ ctx.message.content = old_content
\ No newline at end of file
diff --git a/dev/info.json b/dev/info.json
new file mode 100644
index 0000000..1d7d6a1
--- /dev/null
+++ b/dev/info.json
@@ -0,0 +1,21 @@
+{
+ "author":[
+ "R.Danny",
+ "Toby",
+ "Will",
+ "Michael",
+ "Eslyium"
+ ],
+ "description":"Cog loadable dev commands, replaces mock with legacy sudo command",
+ "install_msg":"Separate loadable dev functions instead of --dev startup command",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Dev",
+ "permissions":[],
+ "requirements":[],
+ "short":"Developer commands",
+ "tags":[]
+}
\ No newline at end of file
diff --git a/emojireact/__init__.py b/emojireact/__init__.py
new file mode 100644
index 0000000..435dcb7
--- /dev/null
+++ b/emojireact/__init__.py
@@ -0,0 +1,4 @@
+from .emojireact import EmojiReactions
+
+def setup(bot):
+ bot.add_cog(EmojiReactions(bot))
diff --git a/emojireact/emojireact.py b/emojireact/emojireact.py
new file mode 100644
index 0000000..878f67b
--- /dev/null
+++ b/emojireact/emojireact.py
@@ -0,0 +1,81 @@
+import discord
+from redbot.core import commands, Config, checks
+from .unicode_codes import UNICODE_EMOJI
+
+class EmojiReactions(getattr(commands, "Cog", object)):
+ """
+ Automatically react to messages with emojis in them with the emoji
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ default_guild = {"unicode": False, "guild":False, "random":False}
+ self.config = Config.get_conf(self, 35677998656)
+ self.config.register_guild(**default_guild)
+
+ @commands.group()
+ @checks.admin_or_permissions(manage_messages=True)
+ async def emojireact(self, ctx):
+ """
+ Automatically react to messages with emojis in them with the emoji
+ """
+ if ctx.invoked_subcommand is None:
+ try:
+ guild = ctx.message.guild
+ em = discord.Embed(title="Emojireact settings for {}".format(guild.name), colour=discord.Colour.blue())
+ em.add_field(name="Server", value=str(await self.config.guild(guild).guild()))
+ em.add_field(name="Unicode", value=str(await self.config.guild(guild).unicode()))
+ await ctx.send(embed=em)
+ except:
+ pass
+
+
+ @emojireact.command(name="unicode")
+ async def _unicode(self, ctx):
+ """Toggle unicode emoji reactions"""
+ if await self.config.guild(ctx.guild).unicode():
+ await self.config.guild(ctx.guild).unicode.set(False)
+ await ctx.send("Okay, I will not react to messages containing unicode emojis!")
+ else:
+ await self.config.guild(ctx.guild).unicode.set(True)
+ await ctx.send("Okay, I will react to messages containing unicode emojis!")
+
+ @emojireact.command(name="guild")
+ async def _guild(self, ctx):
+ """Toggle guild emoji reactions"""
+ if await self.config.guild(ctx.guild).guild():
+ await self.config.guild(ctx.guild).guild.set(False)
+ await ctx.send("Okay, I will not react to messages containing server emojis!")
+ else:
+ await self.config.guild(ctx.guild).guild.set(True)
+ await ctx.send("Okay, I will react to messages containing server emojis!")
+
+ @emojireact.command(name="all")
+ async def _all(self, ctx):
+ """Toggle all emoji reactions"""
+ if await self.config.guild(ctx.guild).guild() or await self.config.guild(ctx.guild).unicode():
+ await self.config.guild(ctx.guild).guild.set(False)
+ await self.config.guild(ctx.guild).unicode.set(False)
+ await ctx.send("Okay, I will not react to messages containing all emojis!")
+ else:
+ await self.config.guild(ctx.guild).guild.set(True)
+ await self.config.guild(ctx.guild).unicode.set(True)
+ await ctx.send("Okay, I will react to messages containing all emojis!")
+
+ async def on_message(self, message):
+ channel = message.channel
+ emoji_list = []
+ if message.guild is None:
+ return
+ for word in message.content.split(" "):
+ if word.startswith("<:") and word.endswith(">") and await self.config.guild(message.guild).guild():
+ emoji_list.append(word.rpartition(">")[0].partition("<")[2])
+ if word in UNICODE_EMOJI and await self.config.guild(message.guild).unicode():
+ emoji_list.append(word)
+ if emoji_list == []:
+ return
+ for emoji in emoji_list:
+ try:
+ await message.add_reaction(emoji)
+ except:
+ pass
diff --git a/emojireact/info.json b/emojireact/info.json
new file mode 100644
index 0000000..aebbf94
--- /dev/null
+++ b/emojireact/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"React to messages containing any emojis!",
+ "install_msg":"React to message emojis automatically!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"EmojiReact",
+ "permissions":[
+ "add_reactions"
+ ],
+ "requirements":[],
+ "short":"Emoji Reaction",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/emojireact/unicode_codes.py b/emojireact/unicode_codes.py
new file mode 100644
index 0000000..56a6f2c
--- /dev/null
+++ b/emojireact/unicode_codes.py
@@ -0,0 +1,3949 @@
+# -*- coding: UTF-8 -*-
+
+
+"""
+From https://github.com/carpedm20/emoji/blob/master/emoji/unicode_codes.py
+
+Data literal storing emoji names and unicode codes
+"""
+
+
+__all__ = ['EMOJI_UNICODE', 'UNICODE_EMOJI', 'EMOJI_ALIAS_UNICODE', 'UNICODE_EMOJI_ALIAS']
+
+
+EMOJI_UNICODE = {
+ u':1st_place_medal:': u'\U0001F947',
+ u':2nd_place_medal:': u'\U0001F948',
+ u':3rd_place_medal:': u'\U0001F949',
+ u':AB_button_(blood_type):': u'\U0001F18E',
+ u':ATM_sign:': u'\U0001F3E7',
+ u':A_button_(blood_type):': u'\U0001F170',
+ u':Afghanistan:': u'\U0001F1E6\U0001F1EB',
+ u':Albania:': u'\U0001F1E6\U0001F1F1',
+ u':Algeria:': u'\U0001F1E9\U0001F1FF',
+ u':American_Samoa:': u'\U0001F1E6\U0001F1F8',
+ u':Andorra:': u'\U0001F1E6\U0001F1E9',
+ u':Angola:': u'\U0001F1E6\U0001F1F4',
+ u':Anguilla:': u'\U0001F1E6\U0001F1EE',
+ u':Antarctica:': u'\U0001F1E6\U0001F1F6',
+ u':Antigua_&_Barbuda:': u'\U0001F1E6\U0001F1EC',
+ u':Aquarius:': u'\U00002652',
+ u':Argentina:': u'\U0001F1E6\U0001F1F7',
+ u':Aries:': u'\U00002648',
+ u':Armenia:': u'\U0001F1E6\U0001F1F2',
+ u':Aruba:': u'\U0001F1E6\U0001F1FC',
+ u':Ascension_Island:': u'\U0001F1E6\U0001F1E8',
+ u':Australia:': u'\U0001F1E6\U0001F1FA',
+ u':Austria:': u'\U0001F1E6\U0001F1F9',
+ u':Azerbaijan:': u'\U0001F1E6\U0001F1FF',
+ u':BACK_arrow:': u'\U0001F519',
+ u':B_button_(blood_type):': u'\U0001F171',
+ u':Bahamas:': u'\U0001F1E7\U0001F1F8',
+ u':Bahrain:': u'\U0001F1E7\U0001F1ED',
+ u':Bangladesh:': u'\U0001F1E7\U0001F1E9',
+ u':Barbados:': u'\U0001F1E7\U0001F1E7',
+ u':Belarus:': u'\U0001F1E7\U0001F1FE',
+ u':Belgium:': u'\U0001F1E7\U0001F1EA',
+ u':Belize:': u'\U0001F1E7\U0001F1FF',
+ u':Benin:': u'\U0001F1E7\U0001F1EF',
+ u':Bermuda:': u'\U0001F1E7\U0001F1F2',
+ u':Bhutan:': u'\U0001F1E7\U0001F1F9',
+ u':Bolivia:': u'\U0001F1E7\U0001F1F4',
+ u':Bosnia_&_Herzegovina:': u'\U0001F1E7\U0001F1E6',
+ u':Botswana:': u'\U0001F1E7\U0001F1FC',
+ u':Bouvet_Island:': u'\U0001F1E7\U0001F1FB',
+ u':Brazil:': u'\U0001F1E7\U0001F1F7',
+ u':British_Indian_Ocean_Territory:': u'\U0001F1EE\U0001F1F4',
+ u':British_Virgin_Islands:': u'\U0001F1FB\U0001F1EC',
+ u':Brunei:': u'\U0001F1E7\U0001F1F3',
+ u':Bulgaria:': u'\U0001F1E7\U0001F1EC',
+ u':Burkina_Faso:': u'\U0001F1E7\U0001F1EB',
+ u':Burundi:': u'\U0001F1E7\U0001F1EE',
+ u':CL_button:': u'\U0001F191',
+ u':COOL_button:': u'\U0001F192',
+ u':Cambodia:': u'\U0001F1F0\U0001F1ED',
+ u':Cameroon:': u'\U0001F1E8\U0001F1F2',
+ u':Canada:': u'\U0001F1E8\U0001F1E6',
+ u':Canary_Islands:': u'\U0001F1EE\U0001F1E8',
+ u':Cancer:': u'\U0000264B',
+ u':Cape_Verde:': u'\U0001F1E8\U0001F1FB',
+ u':Capricorn:': u'\U00002651',
+ u':Caribbean_Netherlands:': u'\U0001F1E7\U0001F1F6',
+ u':Cayman_Islands:': u'\U0001F1F0\U0001F1FE',
+ u':Central_African_Republic:': u'\U0001F1E8\U0001F1EB',
+ u':Ceuta_&_Melilla:': u'\U0001F1EA\U0001F1E6',
+ u':Chad:': u'\U0001F1F9\U0001F1E9',
+ u':Chile:': u'\U0001F1E8\U0001F1F1',
+ u':China:': u'\U0001F1E8\U0001F1F3',
+ u':Christmas_Island:': u'\U0001F1E8\U0001F1FD',
+ u':Christmas_tree:': u'\U0001F384',
+ u':Clipperton_Island:': u'\U0001F1E8\U0001F1F5',
+ u':Cocos_(Keeling)_Islands:': u'\U0001F1E8\U0001F1E8',
+ u':Colombia:': u'\U0001F1E8\U0001F1F4',
+ u':Comoros:': u'\U0001F1F0\U0001F1F2',
+ u':Congo_-_Brazzaville:': u'\U0001F1E8\U0001F1EC',
+ u':Congo_-_Kinshasa:': u'\U0001F1E8\U0001F1E9',
+ u':Cook_Islands:': u'\U0001F1E8\U0001F1F0',
+ u':Costa_Rica:': u'\U0001F1E8\U0001F1F7',
+ u':Croatia:': u'\U0001F1ED\U0001F1F7',
+ u':Cuba:': u'\U0001F1E8\U0001F1FA',
+ u':Curaçao:': u'\U0001F1E8\U0001F1FC',
+ u':Cyprus:': u'\U0001F1E8\U0001F1FE',
+ u':Czechia:': u'\U0001F1E8\U0001F1FF',
+ u':Côte_d’Ivoire:': u'\U0001F1E8\U0001F1EE',
+ u':Denmark:': u'\U0001F1E9\U0001F1F0',
+ u':Diego_Garcia:': u'\U0001F1E9\U0001F1EC',
+ u':Djibouti:': u'\U0001F1E9\U0001F1EF',
+ u':Dominica:': u'\U0001F1E9\U0001F1F2',
+ u':Dominican_Republic:': u'\U0001F1E9\U0001F1F4',
+ u':END_arrow:': u'\U0001F51A',
+ u':Ecuador:': u'\U0001F1EA\U0001F1E8',
+ u':Egypt:': u'\U0001F1EA\U0001F1EC',
+ u':El_Salvador:': u'\U0001F1F8\U0001F1FB',
+ u':England:': u'\U0001F3F4\U000E0067\U000E0062\U000E0065\U000E006E\U000E0067\U000E007F',
+ u':Equatorial_Guinea:': u'\U0001F1EC\U0001F1F6',
+ u':Eritrea:': u'\U0001F1EA\U0001F1F7',
+ u':Estonia:': u'\U0001F1EA\U0001F1EA',
+ u':Ethiopia:': u'\U0001F1EA\U0001F1F9',
+ u':European_Union:': u'\U0001F1EA\U0001F1FA',
+ u':FREE_button:': u'\U0001F193',
+ u':Falkland_Islands:': u'\U0001F1EB\U0001F1F0',
+ u':Faroe_Islands:': u'\U0001F1EB\U0001F1F4',
+ u':Fiji:': u'\U0001F1EB\U0001F1EF',
+ u':Finland:': u'\U0001F1EB\U0001F1EE',
+ u':France:': u'\U0001F1EB\U0001F1F7',
+ u':French_Guiana:': u'\U0001F1EC\U0001F1EB',
+ u':French_Polynesia:': u'\U0001F1F5\U0001F1EB',
+ u':French_Southern_Territories:': u'\U0001F1F9\U0001F1EB',
+ u':Gabon:': u'\U0001F1EC\U0001F1E6',
+ u':Gambia:': u'\U0001F1EC\U0001F1F2',
+ u':Gemini:': u'\U0000264A',
+ u':Georgia:': u'\U0001F1EC\U0001F1EA',
+ u':Germany:': u'\U0001F1E9\U0001F1EA',
+ u':Ghana:': u'\U0001F1EC\U0001F1ED',
+ u':Gibraltar:': u'\U0001F1EC\U0001F1EE',
+ u':Greece:': u'\U0001F1EC\U0001F1F7',
+ u':Greenland:': u'\U0001F1EC\U0001F1F1',
+ u':Grenada:': u'\U0001F1EC\U0001F1E9',
+ u':Guadeloupe:': u'\U0001F1EC\U0001F1F5',
+ u':Guam:': u'\U0001F1EC\U0001F1FA',
+ u':Guatemala:': u'\U0001F1EC\U0001F1F9',
+ u':Guernsey:': u'\U0001F1EC\U0001F1EC',
+ u':Guinea:': u'\U0001F1EC\U0001F1F3',
+ u':Guinea-Bissau:': u'\U0001F1EC\U0001F1FC',
+ u':Guyana:': u'\U0001F1EC\U0001F1FE',
+ u':Haiti:': u'\U0001F1ED\U0001F1F9',
+ u':Heard_&_McDonald_Islands:': u'\U0001F1ED\U0001F1F2',
+ u':Honduras:': u'\U0001F1ED\U0001F1F3',
+ u':Hong_Kong_SAR_China:': u'\U0001F1ED\U0001F1F0',
+ u':Hungary:': u'\U0001F1ED\U0001F1FA',
+ u':ID_button:': u'\U0001F194',
+ u':Iceland:': u'\U0001F1EE\U0001F1F8',
+ u':India:': u'\U0001F1EE\U0001F1F3',
+ u':Indonesia:': u'\U0001F1EE\U0001F1E9',
+ u':Iran:': u'\U0001F1EE\U0001F1F7',
+ u':Iraq:': u'\U0001F1EE\U0001F1F6',
+ u':Ireland:': u'\U0001F1EE\U0001F1EA',
+ u':Isle_of_Man:': u'\U0001F1EE\U0001F1F2',
+ u':Israel:': u'\U0001F1EE\U0001F1F1',
+ u':Italy:': u'\U0001F1EE\U0001F1F9',
+ u':Jamaica:': u'\U0001F1EF\U0001F1F2',
+ u':Japan:': u'\U0001F1EF\U0001F1F5',
+ u':Japanese_acceptable_button:': u'\U0001F251',
+ u':Japanese_application_button:': u'\U0001F238',
+ u':Japanese_bargain_button:': u'\U0001F250',
+ u':Japanese_castle:': u'\U0001F3EF',
+ u':Japanese_congratulations_button:': u'\U00003297',
+ u':Japanese_discount_button:': u'\U0001F239',
+ u':Japanese_dolls:': u'\U0001F38E',
+ u':Japanese_free_of_charge_button:': u'\U0001F21A',
+ u':Japanese_here_button:': u'\U0001F201',
+ u':Japanese_monthly_amount_button:': u'\U0001F237',
+ u':Japanese_no_vacancy_button:': u'\U0001F235',
+ u':Japanese_not_free_of_charge_button:': u'\U0001F236',
+ u':Japanese_open_for_business_button:': u'\U0001F23A',
+ u':Japanese_passing_grade_button:': u'\U0001F234',
+ u':Japanese_post_office:': u'\U0001F3E3',
+ u':Japanese_prohibited_button:': u'\U0001F232',
+ u':Japanese_reserved_button:': u'\U0001F22F',
+ u':Japanese_secret_button:': u'\U00003299',
+ u':Japanese_service_charge_button:': u'\U0001F202',
+ u':Japanese_symbol_for_beginner:': u'\U0001F530',
+ u':Japanese_vacancy_button:': u'\U0001F233',
+ u':Jersey:': u'\U0001F1EF\U0001F1EA',
+ u':Jordan:': u'\U0001F1EF\U0001F1F4',
+ u':Kazakhstan:': u'\U0001F1F0\U0001F1FF',
+ u':Kenya:': u'\U0001F1F0\U0001F1EA',
+ u':Kiribati:': u'\U0001F1F0\U0001F1EE',
+ u':Kosovo:': u'\U0001F1FD\U0001F1F0',
+ u':Kuwait:': u'\U0001F1F0\U0001F1FC',
+ u':Kyrgyzstan:': u'\U0001F1F0\U0001F1EC',
+ u':Laos:': u'\U0001F1F1\U0001F1E6',
+ u':Latvia:': u'\U0001F1F1\U0001F1FB',
+ u':Lebanon:': u'\U0001F1F1\U0001F1E7',
+ u':Leo:': u'\U0000264C',
+ u':Lesotho:': u'\U0001F1F1\U0001F1F8',
+ u':Liberia:': u'\U0001F1F1\U0001F1F7',
+ u':Libra:': u'\U0000264E',
+ u':Libya:': u'\U0001F1F1\U0001F1FE',
+ u':Liechtenstein:': u'\U0001F1F1\U0001F1EE',
+ u':Lithuania:': u'\U0001F1F1\U0001F1F9',
+ u':Luxembourg:': u'\U0001F1F1\U0001F1FA',
+ u':Macau_SAR_China:': u'\U0001F1F2\U0001F1F4',
+ u':Macedonia:': u'\U0001F1F2\U0001F1F0',
+ u':Madagascar:': u'\U0001F1F2\U0001F1EC',
+ u':Malawi:': u'\U0001F1F2\U0001F1FC',
+ u':Malaysia:': u'\U0001F1F2\U0001F1FE',
+ u':Maldives:': u'\U0001F1F2\U0001F1FB',
+ u':Mali:': u'\U0001F1F2\U0001F1F1',
+ u':Malta:': u'\U0001F1F2\U0001F1F9',
+ u':Marshall_Islands:': u'\U0001F1F2\U0001F1ED',
+ u':Martinique:': u'\U0001F1F2\U0001F1F6',
+ u':Mauritania:': u'\U0001F1F2\U0001F1F7',
+ u':Mauritius:': u'\U0001F1F2\U0001F1FA',
+ u':Mayotte:': u'\U0001F1FE\U0001F1F9',
+ u':Mexico:': u'\U0001F1F2\U0001F1FD',
+ u':Micronesia:': u'\U0001F1EB\U0001F1F2',
+ u':Moldova:': u'\U0001F1F2\U0001F1E9',
+ u':Monaco:': u'\U0001F1F2\U0001F1E8',
+ u':Mongolia:': u'\U0001F1F2\U0001F1F3',
+ u':Montenegro:': u'\U0001F1F2\U0001F1EA',
+ u':Montserrat:': u'\U0001F1F2\U0001F1F8',
+ u':Morocco:': u'\U0001F1F2\U0001F1E6',
+ u':Mozambique:': u'\U0001F1F2\U0001F1FF',
+ u':Mrs._Claus:': u'\U0001F936',
+ u':Mrs._Claus_dark_skin_tone:': u'\U0001F936\U0001F3FF',
+ u':Mrs._Claus_light_skin_tone:': u'\U0001F936\U0001F3FB',
+ u':Mrs._Claus_medium-dark_skin_tone:': u'\U0001F936\U0001F3FE',
+ u':Mrs._Claus_medium-light_skin_tone:': u'\U0001F936\U0001F3FC',
+ u':Mrs._Claus_medium_skin_tone:': u'\U0001F936\U0001F3FD',
+ u':Myanmar_(Burma):': u'\U0001F1F2\U0001F1F2',
+ u':NEW_button:': u'\U0001F195',
+ u':NG_button:': u'\U0001F196',
+ u':Namibia:': u'\U0001F1F3\U0001F1E6',
+ u':Nauru:': u'\U0001F1F3\U0001F1F7',
+ u':Nepal:': u'\U0001F1F3\U0001F1F5',
+ u':Netherlands:': u'\U0001F1F3\U0001F1F1',
+ u':New_Caledonia:': u'\U0001F1F3\U0001F1E8',
+ u':New_Zealand:': u'\U0001F1F3\U0001F1FF',
+ u':Nicaragua:': u'\U0001F1F3\U0001F1EE',
+ u':Niger:': u'\U0001F1F3\U0001F1EA',
+ u':Nigeria:': u'\U0001F1F3\U0001F1EC',
+ u':Niue:': u'\U0001F1F3\U0001F1FA',
+ u':Norfolk_Island:': u'\U0001F1F3\U0001F1EB',
+ u':North_Korea:': u'\U0001F1F0\U0001F1F5',
+ u':Northern_Mariana_Islands:': u'\U0001F1F2\U0001F1F5',
+ u':Norway:': u'\U0001F1F3\U0001F1F4',
+ u':OK_button:': u'\U0001F197',
+ u':OK_hand:': u'\U0001F44C',
+ u':OK_hand_dark_skin_tone:': u'\U0001F44C\U0001F3FF',
+ u':OK_hand_light_skin_tone:': u'\U0001F44C\U0001F3FB',
+ u':OK_hand_medium-dark_skin_tone:': u'\U0001F44C\U0001F3FE',
+ u':OK_hand_medium-light_skin_tone:': u'\U0001F44C\U0001F3FC',
+ u':OK_hand_medium_skin_tone:': u'\U0001F44C\U0001F3FD',
+ u':ON!_arrow:': u'\U0001F51B',
+ u':O_button_(blood_type):': u'\U0001F17E',
+ u':Oman:': u'\U0001F1F4\U0001F1F2',
+ u':Ophiuchus:': u'\U000026CE',
+ u':P_button:': u'\U0001F17F',
+ u':Pakistan:': u'\U0001F1F5\U0001F1F0',
+ u':Palau:': u'\U0001F1F5\U0001F1FC',
+ u':Palestinian_Territories:': u'\U0001F1F5\U0001F1F8',
+ u':Panama:': u'\U0001F1F5\U0001F1E6',
+ u':Papua_New_Guinea:': u'\U0001F1F5\U0001F1EC',
+ u':Paraguay:': u'\U0001F1F5\U0001F1FE',
+ u':Peru:': u'\U0001F1F5\U0001F1EA',
+ u':Philippines:': u'\U0001F1F5\U0001F1ED',
+ u':Pisces:': u'\U00002653',
+ u':Pitcairn_Islands:': u'\U0001F1F5\U0001F1F3',
+ u':Poland:': u'\U0001F1F5\U0001F1F1',
+ u':Portugal:': u'\U0001F1F5\U0001F1F9',
+ u':Puerto_Rico:': u'\U0001F1F5\U0001F1F7',
+ u':Qatar:': u'\U0001F1F6\U0001F1E6',
+ u':Romania:': u'\U0001F1F7\U0001F1F4',
+ u':Russia:': u'\U0001F1F7\U0001F1FA',
+ u':Rwanda:': u'\U0001F1F7\U0001F1FC',
+ u':Réunion:': u'\U0001F1F7\U0001F1EA',
+ u':SOON_arrow:': u'\U0001F51C',
+ u':SOS_button:': u'\U0001F198',
+ u':Sagittarius:': u'\U00002650',
+ u':Samoa:': u'\U0001F1FC\U0001F1F8',
+ u':San_Marino:': u'\U0001F1F8\U0001F1F2',
+ u':Santa_Claus:': u'\U0001F385',
+ u':Santa_Claus_dark_skin_tone:': u'\U0001F385\U0001F3FF',
+ u':Santa_Claus_light_skin_tone:': u'\U0001F385\U0001F3FB',
+ u':Santa_Claus_medium-dark_skin_tone:': u'\U0001F385\U0001F3FE',
+ u':Santa_Claus_medium-light_skin_tone:': u'\U0001F385\U0001F3FC',
+ u':Santa_Claus_medium_skin_tone:': u'\U0001F385\U0001F3FD',
+ u':Saudi_Arabia:': u'\U0001F1F8\U0001F1E6',
+ u':Scorpio:': u'\U0000264F',
+ u':Scotland:': u'\U0001F3F4\U000E0067\U000E0062\U000E0073\U000E0063\U000E0074\U000E007F',
+ u':Senegal:': u'\U0001F1F8\U0001F1F3',
+ u':Serbia:': u'\U0001F1F7\U0001F1F8',
+ u':Seychelles:': u'\U0001F1F8\U0001F1E8',
+ u':Sierra_Leone:': u'\U0001F1F8\U0001F1F1',
+ u':Singapore:': u'\U0001F1F8\U0001F1EC',
+ u':Sint_Maarten:': u'\U0001F1F8\U0001F1FD',
+ u':Slovakia:': u'\U0001F1F8\U0001F1F0',
+ u':Slovenia:': u'\U0001F1F8\U0001F1EE',
+ u':Solomon_Islands:': u'\U0001F1F8\U0001F1E7',
+ u':Somalia:': u'\U0001F1F8\U0001F1F4',
+ u':South_Africa:': u'\U0001F1FF\U0001F1E6',
+ u':South_Georgia_&_South_Sandwich_Islands:': u'\U0001F1EC\U0001F1F8',
+ u':South_Korea:': u'\U0001F1F0\U0001F1F7',
+ u':South_Sudan:': u'\U0001F1F8\U0001F1F8',
+ u':Spain:': u'\U0001F1EA\U0001F1F8',
+ u':Sri_Lanka:': u'\U0001F1F1\U0001F1F0',
+ u':St._Barthélemy:': u'\U0001F1E7\U0001F1F1',
+ u':St._Helena:': u'\U0001F1F8\U0001F1ED',
+ u':St._Kitts_&_Nevis:': u'\U0001F1F0\U0001F1F3',
+ u':St._Lucia:': u'\U0001F1F1\U0001F1E8',
+ u':St._Martin:': u'\U0001F1F2\U0001F1EB',
+ u':St._Pierre_&_Miquelon:': u'\U0001F1F5\U0001F1F2',
+ u':St._Vincent_&_Grenadines:': u'\U0001F1FB\U0001F1E8',
+ u':Statue_of_Liberty:': u'\U0001F5FD',
+ u':Sudan:': u'\U0001F1F8\U0001F1E9',
+ u':Suriname:': u'\U0001F1F8\U0001F1F7',
+ u':Svalbard_&_Jan_Mayen:': u'\U0001F1F8\U0001F1EF',
+ u':Swaziland:': u'\U0001F1F8\U0001F1FF',
+ u':Sweden:': u'\U0001F1F8\U0001F1EA',
+ u':Switzerland:': u'\U0001F1E8\U0001F1ED',
+ u':Syria:': u'\U0001F1F8\U0001F1FE',
+ u':São_Tomé_&_Príncipe:': u'\U0001F1F8\U0001F1F9',
+ u':T-Rex:': u'\U0001F996',
+ u':TOP_arrow:': u'\U0001F51D',
+ u':Taiwan:': u'\U0001F1F9\U0001F1FC',
+ u':Tajikistan:': u'\U0001F1F9\U0001F1EF',
+ u':Tanzania:': u'\U0001F1F9\U0001F1FF',
+ u':Taurus:': u'\U00002649',
+ u':Thailand:': u'\U0001F1F9\U0001F1ED',
+ u':Timor-Leste:': u'\U0001F1F9\U0001F1F1',
+ u':Togo:': u'\U0001F1F9\U0001F1EC',
+ u':Tokelau:': u'\U0001F1F9\U0001F1F0',
+ u':Tokyo_tower:': u'\U0001F5FC',
+ u':Tonga:': u'\U0001F1F9\U0001F1F4',
+ u':Trinidad_&_Tobago:': u'\U0001F1F9\U0001F1F9',
+ u':Tristan_da_Cunha:': u'\U0001F1F9\U0001F1E6',
+ u':Tunisia:': u'\U0001F1F9\U0001F1F3',
+ u':Turkey:': u'\U0001F1F9\U0001F1F7',
+ u':Turkmenistan:': u'\U0001F1F9\U0001F1F2',
+ u':Turks_&_Caicos_Islands:': u'\U0001F1F9\U0001F1E8',
+ u':Tuvalu:': u'\U0001F1F9\U0001F1FB',
+ u':U.S._Outlying_Islands:': u'\U0001F1FA\U0001F1F2',
+ u':U.S._Virgin_Islands:': u'\U0001F1FB\U0001F1EE',
+ u':UP!_button:': u'\U0001F199',
+ u':Uganda:': u'\U0001F1FA\U0001F1EC',
+ u':Ukraine:': u'\U0001F1FA\U0001F1E6',
+ u':United_Arab_Emirates:': u'\U0001F1E6\U0001F1EA',
+ u':United_Kingdom:': u'\U0001F1EC\U0001F1E7',
+ u':United_Nations:': u'\U0001F1FA\U0001F1F3',
+ u':United_States:': u'\U0001F1FA\U0001F1F8',
+ u':Uruguay:': u'\U0001F1FA\U0001F1FE',
+ u':Uzbekistan:': u'\U0001F1FA\U0001F1FF',
+ u':VS_button:': u'\U0001F19A',
+ u':Vanuatu:': u'\U0001F1FB\U0001F1FA',
+ u':Vatican_City:': u'\U0001F1FB\U0001F1E6',
+ u':Venezuela:': u'\U0001F1FB\U0001F1EA',
+ u':Vietnam:': u'\U0001F1FB\U0001F1F3',
+ u':Virgo:': u'\U0000264D',
+ u':Wales:': u'\U0001F3F4\U000E0067\U000E0062\U000E0077\U000E006C\U000E0073\U000E007F',
+ u':Wallis_&_Futuna:': u'\U0001F1FC\U0001F1EB',
+ u':Western_Sahara:': u'\U0001F1EA\U0001F1ED',
+ u':Yemen:': u'\U0001F1FE\U0001F1EA',
+ u':Zambia:': u'\U0001F1FF\U0001F1F2',
+ u':Zimbabwe:': u'\U0001F1FF\U0001F1FC',
+ u':admission_tickets:': u'\U0001F39F',
+ u':adult:': u'\U0001F9D1',
+ u':adult_dark_skin_tone:': u'\U0001F9D1\U0001F3FF',
+ u':adult_light_skin_tone:': u'\U0001F9D1\U0001F3FB',
+ u':adult_medium-dark_skin_tone:': u'\U0001F9D1\U0001F3FE',
+ u':adult_medium-light_skin_tone:': u'\U0001F9D1\U0001F3FC',
+ u':adult_medium_skin_tone:': u'\U0001F9D1\U0001F3FD',
+ u':aerial_tramway:': u'\U0001F6A1',
+ u':airplane:': u'\U00002708',
+ u':airplane_arrival:': u'\U0001F6EC',
+ u':airplane_departure:': u'\U0001F6EB',
+ u':alarm_clock:': u'\U000023F0',
+ u':alembic:': u'\U00002697',
+ u':alien:': u'\U0001F47D',
+ u':alien_monster:': u'\U0001F47E',
+ u':ambulance:': u'\U0001F691',
+ u':american_football:': u'\U0001F3C8',
+ u':amphora:': u'\U0001F3FA',
+ u':anchor:': u'\U00002693',
+ u':anger_symbol:': u'\U0001F4A2',
+ u':angry_face:': u'\U0001F620',
+ u':angry_face_with_horns:': u'\U0001F47F',
+ u':anguished_face:': u'\U0001F627',
+ u':ant:': u'\U0001F41C',
+ u':antenna_bars:': u'\U0001F4F6',
+ u':anxious_face_with_sweat:': u'\U0001F630',
+ u':articulated_lorry:': u'\U0001F69B',
+ u':artist_palette:': u'\U0001F3A8',
+ u':astonished_face:': u'\U0001F632',
+ u':atom_symbol:': u'\U0000269B',
+ u':automobile:': u'\U0001F697',
+ u':avocado:': u'\U0001F951',
+ u':baby:': u'\U0001F476',
+ u':baby_angel:': u'\U0001F47C',
+ u':baby_angel_dark_skin_tone:': u'\U0001F47C\U0001F3FF',
+ u':baby_angel_light_skin_tone:': u'\U0001F47C\U0001F3FB',
+ u':baby_angel_medium-dark_skin_tone:': u'\U0001F47C\U0001F3FE',
+ u':baby_angel_medium-light_skin_tone:': u'\U0001F47C\U0001F3FC',
+ u':baby_angel_medium_skin_tone:': u'\U0001F47C\U0001F3FD',
+ u':baby_bottle:': u'\U0001F37C',
+ u':baby_chick:': u'\U0001F424',
+ u':baby_dark_skin_tone:': u'\U0001F476\U0001F3FF',
+ u':baby_light_skin_tone:': u'\U0001F476\U0001F3FB',
+ u':baby_medium-dark_skin_tone:': u'\U0001F476\U0001F3FE',
+ u':baby_medium-light_skin_tone:': u'\U0001F476\U0001F3FC',
+ u':baby_medium_skin_tone:': u'\U0001F476\U0001F3FD',
+ u':baby_symbol:': u'\U0001F6BC',
+ u':backhand_index_pointing_down:': u'\U0001F447',
+ u':backhand_index_pointing_down_dark_skin_tone:': u'\U0001F447\U0001F3FF',
+ u':backhand_index_pointing_down_light_skin_tone:': u'\U0001F447\U0001F3FB',
+ u':backhand_index_pointing_down_medium-dark_skin_tone:': u'\U0001F447\U0001F3FE',
+ u':backhand_index_pointing_down_medium-light_skin_tone:': u'\U0001F447\U0001F3FC',
+ u':backhand_index_pointing_down_medium_skin_tone:': u'\U0001F447\U0001F3FD',
+ u':backhand_index_pointing_left:': u'\U0001F448',
+ u':backhand_index_pointing_left_dark_skin_tone:': u'\U0001F448\U0001F3FF',
+ u':backhand_index_pointing_left_light_skin_tone:': u'\U0001F448\U0001F3FB',
+ u':backhand_index_pointing_left_medium-dark_skin_tone:': u'\U0001F448\U0001F3FE',
+ u':backhand_index_pointing_left_medium-light_skin_tone:': u'\U0001F448\U0001F3FC',
+ u':backhand_index_pointing_left_medium_skin_tone:': u'\U0001F448\U0001F3FD',
+ u':backhand_index_pointing_right:': u'\U0001F449',
+ u':backhand_index_pointing_right_dark_skin_tone:': u'\U0001F449\U0001F3FF',
+ u':backhand_index_pointing_right_light_skin_tone:': u'\U0001F449\U0001F3FB',
+ u':backhand_index_pointing_right_medium-dark_skin_tone:': u'\U0001F449\U0001F3FE',
+ u':backhand_index_pointing_right_medium-light_skin_tone:': u'\U0001F449\U0001F3FC',
+ u':backhand_index_pointing_right_medium_skin_tone:': u'\U0001F449\U0001F3FD',
+ u':backhand_index_pointing_up:': u'\U0001F446',
+ u':backhand_index_pointing_up_dark_skin_tone:': u'\U0001F446\U0001F3FF',
+ u':backhand_index_pointing_up_light_skin_tone:': u'\U0001F446\U0001F3FB',
+ u':backhand_index_pointing_up_medium-dark_skin_tone:': u'\U0001F446\U0001F3FE',
+ u':backhand_index_pointing_up_medium-light_skin_tone:': u'\U0001F446\U0001F3FC',
+ u':backhand_index_pointing_up_medium_skin_tone:': u'\U0001F446\U0001F3FD',
+ u':bacon:': u'\U0001F953',
+ u':badminton:': u'\U0001F3F8',
+ u':baggage_claim:': u'\U0001F6C4',
+ u':baguette_bread:': u'\U0001F956',
+ u':balance_scale:': u'\U00002696',
+ u':balloon:': u'\U0001F388',
+ u':ballot_box_with_ballot:': u'\U0001F5F3',
+ u':ballot_box_with_check:': u'\U00002611',
+ u':banana:': u'\U0001F34C',
+ u':bank:': u'\U0001F3E6',
+ u':bar_chart:': u'\U0001F4CA',
+ u':barber_pole:': u'\U0001F488',
+ u':baseball:': u'\U000026BE',
+ u':basketball:': u'\U0001F3C0',
+ u':bat:': u'\U0001F987',
+ u':bathtub:': u'\U0001F6C1',
+ u':battery:': u'\U0001F50B',
+ u':beach_with_umbrella:': u'\U0001F3D6',
+ u':beaming_face_with_smiling_eyes:': u'\U0001F601',
+ u':bear_face:': u'\U0001F43B',
+ u':bearded_person:': u'\U0001F9D4',
+ u':bearded_person_dark_skin_tone:': u'\U0001F9D4\U0001F3FF',
+ u':bearded_person_light_skin_tone:': u'\U0001F9D4\U0001F3FB',
+ u':bearded_person_medium-dark_skin_tone:': u'\U0001F9D4\U0001F3FE',
+ u':bearded_person_medium-light_skin_tone:': u'\U0001F9D4\U0001F3FC',
+ u':bearded_person_medium_skin_tone:': u'\U0001F9D4\U0001F3FD',
+ u':beating_heart:': u'\U0001F493',
+ u':bed:': u'\U0001F6CF',
+ u':beer_mug:': u'\U0001F37A',
+ u':bell:': u'\U0001F514',
+ u':bell_with_slash:': u'\U0001F515',
+ u':bellhop_bell:': u'\U0001F6CE',
+ u':bento_box:': u'\U0001F371',
+ u':bicycle:': u'\U0001F6B2',
+ u':bikini:': u'\U0001F459',
+ u':billed_cap:': u'\U0001F9E2',
+ u':biohazard:': u'\U00002623',
+ u':bird:': u'\U0001F426',
+ u':birthday_cake:': u'\U0001F382',
+ u':black_circle:': u'\U000026AB',
+ u':black_flag:': u'\U0001F3F4',
+ u':black_heart:': u'\U0001F5A4',
+ u':black_large_square:': u'\U00002B1B',
+ u':black_medium-small_square:': u'\U000025FE',
+ u':black_medium_square:': u'\U000025FC',
+ u':black_nib:': u'\U00002712',
+ u':black_small_square:': u'\U000025AA',
+ u':black_square_button:': u'\U0001F532',
+ u':blond-haired_man:': u'\U0001F471\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_man_dark_skin_tone:': u'\U0001F471\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_man_light_skin_tone:': u'\U0001F471\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_man_medium-dark_skin_tone:': u'\U0001F471\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_man_medium-light_skin_tone:': u'\U0001F471\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_man_medium_skin_tone:': u'\U0001F471\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':blond-haired_person:': u'\U0001F471',
+ u':blond-haired_person_dark_skin_tone:': u'\U0001F471\U0001F3FF',
+ u':blond-haired_person_light_skin_tone:': u'\U0001F471\U0001F3FB',
+ u':blond-haired_person_medium-dark_skin_tone:': u'\U0001F471\U0001F3FE',
+ u':blond-haired_person_medium-light_skin_tone:': u'\U0001F471\U0001F3FC',
+ u':blond-haired_person_medium_skin_tone:': u'\U0001F471\U0001F3FD',
+ u':blond-haired_woman:': u'\U0001F471\U0000200D\U00002640\U0000FE0F',
+ u':blond-haired_woman_dark_skin_tone:': u'\U0001F471\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':blond-haired_woman_light_skin_tone:': u'\U0001F471\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':blond-haired_woman_medium-dark_skin_tone:': u'\U0001F471\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':blond-haired_woman_medium-light_skin_tone:': u'\U0001F471\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':blond-haired_woman_medium_skin_tone:': u'\U0001F471\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':blossom:': u'\U0001F33C',
+ u':blowfish:': u'\U0001F421',
+ u':blue_book:': u'\U0001F4D8',
+ u':blue_circle:': u'\U0001F535',
+ u':blue_heart:': u'\U0001F499',
+ u':boar:': u'\U0001F417',
+ u':bomb:': u'\U0001F4A3',
+ u':bookmark:': u'\U0001F516',
+ u':bookmark_tabs:': u'\U0001F4D1',
+ u':books:': u'\U0001F4DA',
+ u':bottle_with_popping_cork:': u'\U0001F37E',
+ u':bouquet:': u'\U0001F490',
+ u':bow_and_arrow:': u'\U0001F3F9',
+ u':bowl_with_spoon:': u'\U0001F963',
+ u':bowling:': u'\U0001F3B3',
+ u':boxing_glove:': u'\U0001F94A',
+ u':boy:': u'\U0001F466',
+ u':boy_dark_skin_tone:': u'\U0001F466\U0001F3FF',
+ u':boy_light_skin_tone:': u'\U0001F466\U0001F3FB',
+ u':boy_medium-dark_skin_tone:': u'\U0001F466\U0001F3FE',
+ u':boy_medium-light_skin_tone:': u'\U0001F466\U0001F3FC',
+ u':boy_medium_skin_tone:': u'\U0001F466\U0001F3FD',
+ u':brain:': u'\U0001F9E0',
+ u':bread:': u'\U0001F35E',
+ u':breast-feeding:': u'\U0001F931',
+ u':breast-feeding_dark_skin_tone:': u'\U0001F931\U0001F3FF',
+ u':breast-feeding_light_skin_tone:': u'\U0001F931\U0001F3FB',
+ u':breast-feeding_medium-dark_skin_tone:': u'\U0001F931\U0001F3FE',
+ u':breast-feeding_medium-light_skin_tone:': u'\U0001F931\U0001F3FC',
+ u':breast-feeding_medium_skin_tone:': u'\U0001F931\U0001F3FD',
+ u':bride_with_veil:': u'\U0001F470',
+ u':bride_with_veil_dark_skin_tone:': u'\U0001F470\U0001F3FF',
+ u':bride_with_veil_light_skin_tone:': u'\U0001F470\U0001F3FB',
+ u':bride_with_veil_medium-dark_skin_tone:': u'\U0001F470\U0001F3FE',
+ u':bride_with_veil_medium-light_skin_tone:': u'\U0001F470\U0001F3FC',
+ u':bride_with_veil_medium_skin_tone:': u'\U0001F470\U0001F3FD',
+ u':bridge_at_night:': u'\U0001F309',
+ u':briefcase:': u'\U0001F4BC',
+ u':bright_button:': u'\U0001F506',
+ u':broccoli:': u'\U0001F966',
+ u':broken_heart:': u'\U0001F494',
+ u':bug:': u'\U0001F41B',
+ u':building_construction:': u'\U0001F3D7',
+ u':bullet_train:': u'\U0001F685',
+ u':burrito:': u'\U0001F32F',
+ u':bus:': u'\U0001F68C',
+ u':bus_stop:': u'\U0001F68F',
+ u':bust_in_silhouette:': u'\U0001F464',
+ u':busts_in_silhouette:': u'\U0001F465',
+ u':butterfly:': u'\U0001F98B',
+ u':cactus:': u'\U0001F335',
+ u':calendar:': u'\U0001F4C5',
+ u':call_me_hand:': u'\U0001F919',
+ u':call_me_hand_dark_skin_tone:': u'\U0001F919\U0001F3FF',
+ u':call_me_hand_light_skin_tone:': u'\U0001F919\U0001F3FB',
+ u':call_me_hand_medium-dark_skin_tone:': u'\U0001F919\U0001F3FE',
+ u':call_me_hand_medium-light_skin_tone:': u'\U0001F919\U0001F3FC',
+ u':call_me_hand_medium_skin_tone:': u'\U0001F919\U0001F3FD',
+ u':camel:': u'\U0001F42A',
+ u':camera:': u'\U0001F4F7',
+ u':camera_with_flash:': u'\U0001F4F8',
+ u':camping:': u'\U0001F3D5',
+ u':candle:': u'\U0001F56F',
+ u':candy:': u'\U0001F36C',
+ u':canned_food:': u'\U0001F96B',
+ u':canoe:': u'\U0001F6F6',
+ u':card_file_box:': u'\U0001F5C3',
+ u':card_index:': u'\U0001F4C7',
+ u':card_index_dividers:': u'\U0001F5C2',
+ u':carousel_horse:': u'\U0001F3A0',
+ u':carp_streamer:': u'\U0001F38F',
+ u':carrot:': u'\U0001F955',
+ u':castle:': u'\U0001F3F0',
+ u':cat:': u'\U0001F408',
+ u':cat_face:': u'\U0001F431',
+ u':cat_face_with_tears_of_joy:': u'\U0001F639',
+ u':cat_face_with_wry_smile:': u'\U0001F63C',
+ u':chains:': u'\U000026D3',
+ u':chart_decreasing:': u'\U0001F4C9',
+ u':chart_increasing:': u'\U0001F4C8',
+ u':chart_increasing_with_yen:': u'\U0001F4B9',
+ u':cheese_wedge:': u'\U0001F9C0',
+ u':chequered_flag:': u'\U0001F3C1',
+ u':cherries:': u'\U0001F352',
+ u':cherry_blossom:': u'\U0001F338',
+ u':chestnut:': u'\U0001F330',
+ u':chicken:': u'\U0001F414',
+ u':child:': u'\U0001F9D2',
+ u':child_dark_skin_tone:': u'\U0001F9D2\U0001F3FF',
+ u':child_light_skin_tone:': u'\U0001F9D2\U0001F3FB',
+ u':child_medium-dark_skin_tone:': u'\U0001F9D2\U0001F3FE',
+ u':child_medium-light_skin_tone:': u'\U0001F9D2\U0001F3FC',
+ u':child_medium_skin_tone:': u'\U0001F9D2\U0001F3FD',
+ u':children_crossing:': u'\U0001F6B8',
+ u':chipmunk:': u'\U0001F43F',
+ u':chocolate_bar:': u'\U0001F36B',
+ u':chopsticks:': u'\U0001F962',
+ u':church:': u'\U000026EA',
+ u':cigarette:': u'\U0001F6AC',
+ u':cinema:': u'\U0001F3A6',
+ u':circled_M:': u'\U000024C2',
+ u':circus_tent:': u'\U0001F3AA',
+ u':cityscape:': u'\U0001F3D9',
+ u':cityscape_at_dusk:': u'\U0001F306',
+ u':clamp:': u'\U0001F5DC',
+ u':clapper_board:': u'\U0001F3AC',
+ u':clapping_hands:': u'\U0001F44F',
+ u':clapping_hands_dark_skin_tone:': u'\U0001F44F\U0001F3FF',
+ u':clapping_hands_light_skin_tone:': u'\U0001F44F\U0001F3FB',
+ u':clapping_hands_medium-dark_skin_tone:': u'\U0001F44F\U0001F3FE',
+ u':clapping_hands_medium-light_skin_tone:': u'\U0001F44F\U0001F3FC',
+ u':clapping_hands_medium_skin_tone:': u'\U0001F44F\U0001F3FD',
+ u':classical_building:': u'\U0001F3DB',
+ u':clinking_beer_mugs:': u'\U0001F37B',
+ u':clinking_glasses:': u'\U0001F942',
+ u':clipboard:': u'\U0001F4CB',
+ u':clockwise_vertical_arrows:': u'\U0001F503',
+ u':closed_book:': u'\U0001F4D5',
+ u':closed_mailbox_with_lowered_flag:': u'\U0001F4EA',
+ u':closed_mailbox_with_raised_flag:': u'\U0001F4EB',
+ u':closed_umbrella:': u'\U0001F302',
+ u':cloud:': u'\U00002601',
+ u':cloud_with_lightning:': u'\U0001F329',
+ u':cloud_with_lightning_and_rain:': u'\U000026C8',
+ u':cloud_with_rain:': u'\U0001F327',
+ u':cloud_with_snow:': u'\U0001F328',
+ u':clown_face:': u'\U0001F921',
+ u':club_suit:': u'\U00002663',
+ u':clutch_bag:': u'\U0001F45D',
+ u':coat:': u'\U0001F9E5',
+ u':cocktail_glass:': u'\U0001F378',
+ u':coconut:': u'\U0001F965',
+ u':coffin:': u'\U000026B0',
+ u':collision:': u'\U0001F4A5',
+ u':comet:': u'\U00002604',
+ u':computer_disk:': u'\U0001F4BD',
+ u':computer_mouse:': u'\U0001F5B1',
+ u':confetti_ball:': u'\U0001F38A',
+ u':confounded_face:': u'\U0001F616',
+ u':confused_face:': u'\U0001F615',
+ u':construction:': u'\U0001F6A7',
+ u':construction_worker:': u'\U0001F477',
+ u':construction_worker_dark_skin_tone:': u'\U0001F477\U0001F3FF',
+ u':construction_worker_light_skin_tone:': u'\U0001F477\U0001F3FB',
+ u':construction_worker_medium-dark_skin_tone:': u'\U0001F477\U0001F3FE',
+ u':construction_worker_medium-light_skin_tone:': u'\U0001F477\U0001F3FC',
+ u':construction_worker_medium_skin_tone:': u'\U0001F477\U0001F3FD',
+ u':control_knobs:': u'\U0001F39B',
+ u':convenience_store:': u'\U0001F3EA',
+ u':cooked_rice:': u'\U0001F35A',
+ u':cookie:': u'\U0001F36A',
+ u':cooking:': u'\U0001F373',
+ u':copyright:': u'\U000000A9',
+ u':couch_and_lamp:': u'\U0001F6CB',
+ u':counterclockwise_arrows_button:': u'\U0001F504',
+ u':couple_with_heart:': u'\U0001F491',
+ u':couple_with_heart_man_man:': u'\U0001F468\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F468',
+ u':couple_with_heart_woman_man:': u'\U0001F469\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F468',
+ u':couple_with_heart_woman_woman:': u'\U0001F469\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F469',
+ u':cow:': u'\U0001F404',
+ u':cow_face:': u'\U0001F42E',
+ u':cowboy_hat_face:': u'\U0001F920',
+ u':crab:': u'\U0001F980',
+ u':crayon:': u'\U0001F58D',
+ u':credit_card:': u'\U0001F4B3',
+ u':crescent_moon:': u'\U0001F319',
+ u':cricket:': u'\U0001F997',
+ u':cricket_game:': u'\U0001F3CF',
+ u':crocodile:': u'\U0001F40A',
+ u':croissant:': u'\U0001F950',
+ u':cross_mark:': u'\U0000274C',
+ u':cross_mark_button:': u'\U0000274E',
+ u':crossed_fingers:': u'\U0001F91E',
+ u':crossed_fingers_dark_skin_tone:': u'\U0001F91E\U0001F3FF',
+ u':crossed_fingers_light_skin_tone:': u'\U0001F91E\U0001F3FB',
+ u':crossed_fingers_medium-dark_skin_tone:': u'\U0001F91E\U0001F3FE',
+ u':crossed_fingers_medium-light_skin_tone:': u'\U0001F91E\U0001F3FC',
+ u':crossed_fingers_medium_skin_tone:': u'\U0001F91E\U0001F3FD',
+ u':crossed_flags:': u'\U0001F38C',
+ u':crossed_swords:': u'\U00002694',
+ u':crown:': u'\U0001F451',
+ u':crying_cat_face:': u'\U0001F63F',
+ u':crying_face:': u'\U0001F622',
+ u':crystal_ball:': u'\U0001F52E',
+ u':cucumber:': u'\U0001F952',
+ u':cup_with_straw:': u'\U0001F964',
+ u':curling_stone:': u'\U0001F94C',
+ u':curly_loop:': u'\U000027B0',
+ u':currency_exchange:': u'\U0001F4B1',
+ u':curry_rice:': u'\U0001F35B',
+ u':custard:': u'\U0001F36E',
+ u':customs:': u'\U0001F6C3',
+ u':cut_of_meat:': u'\U0001F969',
+ u':cyclone:': u'\U0001F300',
+ u':dagger:': u'\U0001F5E1',
+ u':dango:': u'\U0001F361',
+ u':dashing_away:': u'\U0001F4A8',
+ u':deciduous_tree:': u'\U0001F333',
+ u':deer:': u'\U0001F98C',
+ u':delivery_truck:': u'\U0001F69A',
+ u':department_store:': u'\U0001F3EC',
+ u':derelict_house:': u'\U0001F3DA',
+ u':desert:': u'\U0001F3DC',
+ u':desert_island:': u'\U0001F3DD',
+ u':desktop_computer:': u'\U0001F5A5',
+ u':detective:': u'\U0001F575',
+ u':detective_dark_skin_tone:': u'\U0001F575\U0001F3FF',
+ u':detective_light_skin_tone:': u'\U0001F575\U0001F3FB',
+ u':detective_medium-dark_skin_tone:': u'\U0001F575\U0001F3FE',
+ u':detective_medium-light_skin_tone:': u'\U0001F575\U0001F3FC',
+ u':detective_medium_skin_tone:': u'\U0001F575\U0001F3FD',
+ u':diamond_suit:': u'\U00002666',
+ u':diamond_with_a_dot:': u'\U0001F4A0',
+ u':dim_button:': u'\U0001F505',
+ u':direct_hit:': u'\U0001F3AF',
+ u':disappointed_face:': u'\U0001F61E',
+ u':dizzy:': u'\U0001F4AB',
+ u':dizzy_face:': u'\U0001F635',
+ u':dog:': u'\U0001F415',
+ u':dog_face:': u'\U0001F436',
+ u':dollar_banknote:': u'\U0001F4B5',
+ u':dolphin:': u'\U0001F42C',
+ u':door:': u'\U0001F6AA',
+ u':dotted_six-pointed_star:': u'\U0001F52F',
+ u':double_curly_loop:': u'\U000027BF',
+ u':double_exclamation_mark:': u'\U0000203C',
+ u':doughnut:': u'\U0001F369',
+ u':dove:': u'\U0001F54A',
+ u':down-left_arrow:': u'\U00002199',
+ u':down-right_arrow:': u'\U00002198',
+ u':down_arrow:': u'\U00002B07',
+ u':downcast_face_with_sweat:': u'\U0001F613',
+ u':downwards_button:': u'\U0001F53D',
+ u':dragon:': u'\U0001F409',
+ u':dragon_face:': u'\U0001F432',
+ u':dress:': u'\U0001F457',
+ u':drooling_face:': u'\U0001F924',
+ u':droplet:': u'\U0001F4A7',
+ u':drum:': u'\U0001F941',
+ u':duck:': u'\U0001F986',
+ u':dumpling:': u'\U0001F95F',
+ u':dvd:': u'\U0001F4C0',
+ u':e-mail:': u'\U0001F4E7',
+ u':eagle:': u'\U0001F985',
+ u':ear:': u'\U0001F442',
+ u':ear_dark_skin_tone:': u'\U0001F442\U0001F3FF',
+ u':ear_light_skin_tone:': u'\U0001F442\U0001F3FB',
+ u':ear_medium-dark_skin_tone:': u'\U0001F442\U0001F3FE',
+ u':ear_medium-light_skin_tone:': u'\U0001F442\U0001F3FC',
+ u':ear_medium_skin_tone:': u'\U0001F442\U0001F3FD',
+ u':ear_of_corn:': u'\U0001F33D',
+ u':egg:': u'\U0001F95A',
+ u':eggplant:': u'\U0001F346',
+ u':eight-pointed_star:': u'\U00002734',
+ u':eight-spoked_asterisk:': u'\U00002733',
+ u':eight-thirty:': u'\U0001F563',
+ u':eight_o’clock:': u'\U0001F557',
+ u':eject_button:': u'\U000023CF',
+ u':electric_plug:': u'\U0001F50C',
+ u':elephant:': u'\U0001F418',
+ u':eleven-thirty:': u'\U0001F566',
+ u':eleven_o’clock:': u'\U0001F55A',
+ u':elf:': u'\U0001F9DD',
+ u':elf_dark_skin_tone:': u'\U0001F9DD\U0001F3FF',
+ u':elf_light_skin_tone:': u'\U0001F9DD\U0001F3FB',
+ u':elf_medium-dark_skin_tone:': u'\U0001F9DD\U0001F3FE',
+ u':elf_medium-light_skin_tone:': u'\U0001F9DD\U0001F3FC',
+ u':elf_medium_skin_tone:': u'\U0001F9DD\U0001F3FD',
+ u':envelope:': u'\U00002709',
+ u':envelope_with_arrow:': u'\U0001F4E9',
+ u':euro_banknote:': u'\U0001F4B6',
+ u':evergreen_tree:': u'\U0001F332',
+ u':ewe:': u'\U0001F411',
+ u':exclamation_mark:': u'\U00002757',
+ u':exclamation_question_mark:': u'\U00002049',
+ u':exploding_head:': u'\U0001F92F',
+ u':expressionless_face:': u'\U0001F611',
+ u':eye:': u'\U0001F441',
+ u':eye_in_speech_bubble:': u'\U0001F441\U0000FE0F\U0000200D\U0001F5E8\U0000FE0F',
+ u':eyes:': u'\U0001F440',
+ u':face_blowing_a_kiss:': u'\U0001F618',
+ u':face_savoring_food:': u'\U0001F60B',
+ u':face_screaming_in_fear:': u'\U0001F631',
+ u':face_vomiting:': u'\U0001F92E',
+ u':face_with_hand_over_mouth:': u'\U0001F92D',
+ u':face_with_head-bandage:': u'\U0001F915',
+ u':face_with_medical_mask:': u'\U0001F637',
+ u':face_with_monocle:': u'\U0001F9D0',
+ u':face_with_open_mouth:': u'\U0001F62E',
+ u':face_with_raised_eyebrow:': u'\U0001F928',
+ u':face_with_rolling_eyes:': u'\U0001F644',
+ u':face_with_steam_from_nose:': u'\U0001F624',
+ u':face_with_symbols_on_mouth:': u'\U0001F92C',
+ u':face_with_tears_of_joy:': u'\U0001F602',
+ u':face_with_thermometer:': u'\U0001F912',
+ u':face_with_tongue:': u'\U0001F61B',
+ u':face_without_mouth:': u'\U0001F636',
+ u':factory:': u'\U0001F3ED',
+ u':fairy:': u'\U0001F9DA',
+ u':fairy_dark_skin_tone:': u'\U0001F9DA\U0001F3FF',
+ u':fairy_light_skin_tone:': u'\U0001F9DA\U0001F3FB',
+ u':fairy_medium-dark_skin_tone:': u'\U0001F9DA\U0001F3FE',
+ u':fairy_medium-light_skin_tone:': u'\U0001F9DA\U0001F3FC',
+ u':fairy_medium_skin_tone:': u'\U0001F9DA\U0001F3FD',
+ u':fallen_leaf:': u'\U0001F342',
+ u':family:': u'\U0001F46A',
+ u':family_man_boy:': u'\U0001F468\U0000200D\U0001F466',
+ u':family_man_boy_boy:': u'\U0001F468\U0000200D\U0001F466\U0000200D\U0001F466',
+ u':family_man_girl:': u'\U0001F468\U0000200D\U0001F467',
+ u':family_man_girl_boy:': u'\U0001F468\U0000200D\U0001F467\U0000200D\U0001F466',
+ u':family_man_girl_girl:': u'\U0001F468\U0000200D\U0001F467\U0000200D\U0001F467',
+ u':family_man_man_boy:': u'\U0001F468\U0000200D\U0001F468\U0000200D\U0001F466',
+ u':family_man_man_boy_boy:': u'\U0001F468\U0000200D\U0001F468\U0000200D\U0001F466\U0000200D\U0001F466',
+ u':family_man_man_girl:': u'\U0001F468\U0000200D\U0001F468\U0000200D\U0001F467',
+ u':family_man_man_girl_boy:': u'\U0001F468\U0000200D\U0001F468\U0000200D\U0001F467\U0000200D\U0001F466',
+ u':family_man_man_girl_girl:': u'\U0001F468\U0000200D\U0001F468\U0000200D\U0001F467\U0000200D\U0001F467',
+ u':family_man_woman_boy:': u'\U0001F468\U0000200D\U0001F469\U0000200D\U0001F466',
+ u':family_man_woman_boy_boy:': u'\U0001F468\U0000200D\U0001F469\U0000200D\U0001F466\U0000200D\U0001F466',
+ u':family_man_woman_girl:': u'\U0001F468\U0000200D\U0001F469\U0000200D\U0001F467',
+ u':family_man_woman_girl_boy:': u'\U0001F468\U0000200D\U0001F469\U0000200D\U0001F467\U0000200D\U0001F466',
+ u':family_man_woman_girl_girl:': u'\U0001F468\U0000200D\U0001F469\U0000200D\U0001F467\U0000200D\U0001F467',
+ u':family_woman_boy:': u'\U0001F469\U0000200D\U0001F466',
+ u':family_woman_boy_boy:': u'\U0001F469\U0000200D\U0001F466\U0000200D\U0001F466',
+ u':family_woman_girl:': u'\U0001F469\U0000200D\U0001F467',
+ u':family_woman_girl_boy:': u'\U0001F469\U0000200D\U0001F467\U0000200D\U0001F466',
+ u':family_woman_girl_girl:': u'\U0001F469\U0000200D\U0001F467\U0000200D\U0001F467',
+ u':family_woman_woman_boy:': u'\U0001F469\U0000200D\U0001F469\U0000200D\U0001F466',
+ u':family_woman_woman_boy_boy:': u'\U0001F469\U0000200D\U0001F469\U0000200D\U0001F466\U0000200D\U0001F466',
+ u':family_woman_woman_girl:': u'\U0001F469\U0000200D\U0001F469\U0000200D\U0001F467',
+ u':family_woman_woman_girl_boy:': u'\U0001F469\U0000200D\U0001F469\U0000200D\U0001F467\U0000200D\U0001F466',
+ u':family_woman_woman_girl_girl:': u'\U0001F469\U0000200D\U0001F469\U0000200D\U0001F467\U0000200D\U0001F467',
+ u':fast-forward_button:': u'\U000023E9',
+ u':fast_down_button:': u'\U000023EC',
+ u':fast_reverse_button:': u'\U000023EA',
+ u':fast_up_button:': u'\U000023EB',
+ u':fax_machine:': u'\U0001F4E0',
+ u':fearful_face:': u'\U0001F628',
+ u':female_sign:': u'\U00002640',
+ u':ferris_wheel:': u'\U0001F3A1',
+ u':ferry:': u'\U000026F4',
+ u':field_hockey:': u'\U0001F3D1',
+ u':file_cabinet:': u'\U0001F5C4',
+ u':file_folder:': u'\U0001F4C1',
+ u':film_frames:': u'\U0001F39E',
+ u':film_projector:': u'\U0001F4FD',
+ u':fire:': u'\U0001F525',
+ u':fire_engine:': u'\U0001F692',
+ u':fireworks:': u'\U0001F386',
+ u':first_quarter_moon:': u'\U0001F313',
+ u':first_quarter_moon_face:': u'\U0001F31B',
+ u':fish:': u'\U0001F41F',
+ u':fish_cake_with_swirl:': u'\U0001F365',
+ u':fishing_pole:': u'\U0001F3A3',
+ u':five-thirty:': u'\U0001F560',
+ u':five_o’clock:': u'\U0001F554',
+ u':flag_in_hole:': u'\U000026F3',
+ u':flashlight:': u'\U0001F526',
+ u':fleur-de-lis:': u'\U0000269C',
+ u':flexed_biceps:': u'\U0001F4AA',
+ u':flexed_biceps_dark_skin_tone:': u'\U0001F4AA\U0001F3FF',
+ u':flexed_biceps_light_skin_tone:': u'\U0001F4AA\U0001F3FB',
+ u':flexed_biceps_medium-dark_skin_tone:': u'\U0001F4AA\U0001F3FE',
+ u':flexed_biceps_medium-light_skin_tone:': u'\U0001F4AA\U0001F3FC',
+ u':flexed_biceps_medium_skin_tone:': u'\U0001F4AA\U0001F3FD',
+ u':floppy_disk:': u'\U0001F4BE',
+ u':flower_playing_cards:': u'\U0001F3B4',
+ u':flushed_face:': u'\U0001F633',
+ u':flying_saucer:': u'\U0001F6F8',
+ u':fog:': u'\U0001F32B',
+ u':foggy:': u'\U0001F301',
+ u':folded_hands:': u'\U0001F64F',
+ u':folded_hands_dark_skin_tone:': u'\U0001F64F\U0001F3FF',
+ u':folded_hands_light_skin_tone:': u'\U0001F64F\U0001F3FB',
+ u':folded_hands_medium-dark_skin_tone:': u'\U0001F64F\U0001F3FE',
+ u':folded_hands_medium-light_skin_tone:': u'\U0001F64F\U0001F3FC',
+ u':folded_hands_medium_skin_tone:': u'\U0001F64F\U0001F3FD',
+ u':footprints:': u'\U0001F463',
+ u':fork_and_knife:': u'\U0001F374',
+ u':fork_and_knife_with_plate:': u'\U0001F37D',
+ u':fortune_cookie:': u'\U0001F960',
+ u':fountain:': u'\U000026F2',
+ u':fountain_pen:': u'\U0001F58B',
+ u':four-thirty:': u'\U0001F55F',
+ u':four_leaf_clover:': u'\U0001F340',
+ u':four_o’clock:': u'\U0001F553',
+ u':fox_face:': u'\U0001F98A',
+ u':framed_picture:': u'\U0001F5BC',
+ u':french_fries:': u'\U0001F35F',
+ u':fried_shrimp:': u'\U0001F364',
+ u':frog_face:': u'\U0001F438',
+ u':front-facing_baby_chick:': u'\U0001F425',
+ u':frowning_face:': u'\U00002639',
+ u':frowning_face_with_open_mouth:': u'\U0001F626',
+ u':fuel_pump:': u'\U000026FD',
+ u':full_moon:': u'\U0001F315',
+ u':full_moon_face:': u'\U0001F31D',
+ u':funeral_urn:': u'\U000026B1',
+ u':game_die:': u'\U0001F3B2',
+ u':gear:': u'\U00002699',
+ u':gem_stone:': u'\U0001F48E',
+ u':genie:': u'\U0001F9DE',
+ u':ghost:': u'\U0001F47B',
+ u':giraffe:': u'\U0001F992',
+ u':girl:': u'\U0001F467',
+ u':girl_dark_skin_tone:': u'\U0001F467\U0001F3FF',
+ u':girl_light_skin_tone:': u'\U0001F467\U0001F3FB',
+ u':girl_medium-dark_skin_tone:': u'\U0001F467\U0001F3FE',
+ u':girl_medium-light_skin_tone:': u'\U0001F467\U0001F3FC',
+ u':girl_medium_skin_tone:': u'\U0001F467\U0001F3FD',
+ u':glass_of_milk:': u'\U0001F95B',
+ u':glasses:': u'\U0001F453',
+ u':globe_showing_Americas:': u'\U0001F30E',
+ u':globe_showing_Asia-Australia:': u'\U0001F30F',
+ u':globe_showing_Europe-Africa:': u'\U0001F30D',
+ u':globe_with_meridians:': u'\U0001F310',
+ u':gloves:': u'\U0001F9E4',
+ u':glowing_star:': u'\U0001F31F',
+ u':goal_net:': u'\U0001F945',
+ u':goat:': u'\U0001F410',
+ u':goblin:': u'\U0001F47A',
+ u':gorilla:': u'\U0001F98D',
+ u':graduation_cap:': u'\U0001F393',
+ u':grapes:': u'\U0001F347',
+ u':green_apple:': u'\U0001F34F',
+ u':green_book:': u'\U0001F4D7',
+ u':green_heart:': u'\U0001F49A',
+ u':green_salad:': u'\U0001F957',
+ u':grimacing_face:': u'\U0001F62C',
+ u':grinning_cat_face:': u'\U0001F63A',
+ u':grinning_cat_face_with_smiling_eyes:': u'\U0001F638',
+ u':grinning_face:': u'\U0001F600',
+ u':grinning_face_with_big_eyes:': u'\U0001F603',
+ u':grinning_face_with_smiling_eyes:': u'\U0001F604',
+ u':grinning_face_with_sweat:': u'\U0001F605',
+ u':grinning_squinting_face:': u'\U0001F606',
+ u':growing_heart:': u'\U0001F497',
+ u':guard:': u'\U0001F482',
+ u':guard_dark_skin_tone:': u'\U0001F482\U0001F3FF',
+ u':guard_light_skin_tone:': u'\U0001F482\U0001F3FB',
+ u':guard_medium-dark_skin_tone:': u'\U0001F482\U0001F3FE',
+ u':guard_medium-light_skin_tone:': u'\U0001F482\U0001F3FC',
+ u':guard_medium_skin_tone:': u'\U0001F482\U0001F3FD',
+ u':guitar:': u'\U0001F3B8',
+ u':hamburger:': u'\U0001F354',
+ u':hammer:': u'\U0001F528',
+ u':hammer_and_pick:': u'\U00002692',
+ u':hammer_and_wrench:': u'\U0001F6E0',
+ u':hamster_face:': u'\U0001F439',
+ u':hand_with_fingers_splayed:': u'\U0001F590',
+ u':hand_with_fingers_splayed_dark_skin_tone:': u'\U0001F590\U0001F3FF',
+ u':hand_with_fingers_splayed_light_skin_tone:': u'\U0001F590\U0001F3FB',
+ u':hand_with_fingers_splayed_medium-dark_skin_tone:': u'\U0001F590\U0001F3FE',
+ u':hand_with_fingers_splayed_medium-light_skin_tone:': u'\U0001F590\U0001F3FC',
+ u':hand_with_fingers_splayed_medium_skin_tone:': u'\U0001F590\U0001F3FD',
+ u':handbag:': u'\U0001F45C',
+ u':handshake:': u'\U0001F91D',
+ u':hatching_chick:': u'\U0001F423',
+ u':headphone:': u'\U0001F3A7',
+ u':hear-no-evil_monkey:': u'\U0001F649',
+ u':heart_decoration:': u'\U0001F49F',
+ u':heart_suit:': u'\U00002665',
+ u':heart_with_arrow:': u'\U0001F498',
+ u':heart_with_ribbon:': u'\U0001F49D',
+ u':heavy_check_mark:': u'\U00002714',
+ u':heavy_division_sign:': u'\U00002797',
+ u':heavy_dollar_sign:': u'\U0001F4B2',
+ u':heavy_heart_exclamation:': u'\U00002763',
+ u':heavy_large_circle:': u'\U00002B55',
+ u':heavy_minus_sign:': u'\U00002796',
+ u':heavy_multiplication_x:': u'\U00002716',
+ u':heavy_plus_sign:': u'\U00002795',
+ u':hedgehog:': u'\U0001F994',
+ u':helicopter:': u'\U0001F681',
+ u':herb:': u'\U0001F33F',
+ u':hibiscus:': u'\U0001F33A',
+ u':high-heeled_shoe:': u'\U0001F460',
+ u':high-speed_train:': u'\U0001F684',
+ u':high_voltage:': u'\U000026A1',
+ u':hole:': u'\U0001F573',
+ u':honey_pot:': u'\U0001F36F',
+ u':honeybee:': u'\U0001F41D',
+ u':horizontal_traffic_light:': u'\U0001F6A5',
+ u':horse:': u'\U0001F40E',
+ u':horse_face:': u'\U0001F434',
+ u':horse_racing:': u'\U0001F3C7',
+ u':horse_racing_dark_skin_tone:': u'\U0001F3C7\U0001F3FF',
+ u':horse_racing_light_skin_tone:': u'\U0001F3C7\U0001F3FB',
+ u':horse_racing_medium-dark_skin_tone:': u'\U0001F3C7\U0001F3FE',
+ u':horse_racing_medium-light_skin_tone:': u'\U0001F3C7\U0001F3FC',
+ u':horse_racing_medium_skin_tone:': u'\U0001F3C7\U0001F3FD',
+ u':hospital:': u'\U0001F3E5',
+ u':hot_beverage:': u'\U00002615',
+ u':hot_dog:': u'\U0001F32D',
+ u':hot_pepper:': u'\U0001F336',
+ u':hot_springs:': u'\U00002668',
+ u':hotel:': u'\U0001F3E8',
+ u':hourglass_done:': u'\U0000231B',
+ u':hourglass_not_done:': u'\U000023F3',
+ u':house:': u'\U0001F3E0',
+ u':house_with_garden:': u'\U0001F3E1',
+ u':houses:': u'\U0001F3D8',
+ u':hugging_face:': u'\U0001F917',
+ u':hundred_points:': u'\U0001F4AF',
+ u':hushed_face:': u'\U0001F62F',
+ u':ice_cream:': u'\U0001F368',
+ u':ice_hockey:': u'\U0001F3D2',
+ u':ice_skate:': u'\U000026F8',
+ u':inbox_tray:': u'\U0001F4E5',
+ u':incoming_envelope:': u'\U0001F4E8',
+ u':index_pointing_up:': u'\U0000261D',
+ u':index_pointing_up_dark_skin_tone:': u'\U0000261D\U0001F3FF',
+ u':index_pointing_up_light_skin_tone:': u'\U0000261D\U0001F3FB',
+ u':index_pointing_up_medium-dark_skin_tone:': u'\U0000261D\U0001F3FE',
+ u':index_pointing_up_medium-light_skin_tone:': u'\U0000261D\U0001F3FC',
+ u':index_pointing_up_medium_skin_tone:': u'\U0000261D\U0001F3FD',
+ u':information:': u'\U00002139',
+ u':input_latin_letters:': u'\U0001F524',
+ u':input_latin_lowercase:': u'\U0001F521',
+ u':input_latin_uppercase:': u'\U0001F520',
+ u':input_numbers:': u'\U0001F522',
+ u':input_symbols:': u'\U0001F523',
+ u':jack-o-lantern:': u'\U0001F383',
+ u':jeans:': u'\U0001F456',
+ u':joker:': u'\U0001F0CF',
+ u':joystick:': u'\U0001F579',
+ u':kaaba:': u'\U0001F54B',
+ u':key:': u'\U0001F511',
+ u':keyboard:': u'\U00002328',
+ u':keycap_#:': u'\U00000023\U0000FE0F\U000020E3',
+ u':keycap_*:': u'\U0000002A\U0000FE0F\U000020E3',
+ u':keycap_0:': u'\U00000030\U0000FE0F\U000020E3',
+ u':keycap_1:': u'\U00000031\U0000FE0F\U000020E3',
+ u':keycap_10:': u'\U0001F51F',
+ u':keycap_2:': u'\U00000032\U0000FE0F\U000020E3',
+ u':keycap_3:': u'\U00000033\U0000FE0F\U000020E3',
+ u':keycap_4:': u'\U00000034\U0000FE0F\U000020E3',
+ u':keycap_5:': u'\U00000035\U0000FE0F\U000020E3',
+ u':keycap_6:': u'\U00000036\U0000FE0F\U000020E3',
+ u':keycap_7:': u'\U00000037\U0000FE0F\U000020E3',
+ u':keycap_8:': u'\U00000038\U0000FE0F\U000020E3',
+ u':keycap_9:': u'\U00000039\U0000FE0F\U000020E3',
+ u':kick_scooter:': u'\U0001F6F4',
+ u':kimono:': u'\U0001F458',
+ u':kiss:': u'\U0001F48F',
+ u':kiss_man_man:': u'\U0001F468\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F48B\U0000200D\U0001F468',
+ u':kiss_mark:': u'\U0001F48B',
+ u':kiss_woman_man:': u'\U0001F469\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F48B\U0000200D\U0001F468',
+ u':kiss_woman_woman:': u'\U0001F469\U0000200D\U00002764\U0000FE0F\U0000200D\U0001F48B\U0000200D\U0001F469',
+ u':kissing_cat_face:': u'\U0001F63D',
+ u':kissing_face:': u'\U0001F617',
+ u':kissing_face_with_closed_eyes:': u'\U0001F61A',
+ u':kissing_face_with_smiling_eyes:': u'\U0001F619',
+ u':kitchen_knife:': u'\U0001F52A',
+ u':kiwi_fruit:': u'\U0001F95D',
+ u':koala:': u'\U0001F428',
+ u':label:': u'\U0001F3F7',
+ u':lady_beetle:': u'\U0001F41E',
+ u':laptop_computer:': u'\U0001F4BB',
+ u':large_blue_diamond:': u'\U0001F537',
+ u':large_orange_diamond:': u'\U0001F536',
+ u':last_quarter_moon:': u'\U0001F317',
+ u':last_quarter_moon_face:': u'\U0001F31C',
+ u':last_track_button:': u'\U000023EE',
+ u':latin_cross:': u'\U0000271D',
+ u':leaf_fluttering_in_wind:': u'\U0001F343',
+ u':ledger:': u'\U0001F4D2',
+ u':left-facing_fist:': u'\U0001F91B',
+ u':left-facing_fist_dark_skin_tone:': u'\U0001F91B\U0001F3FF',
+ u':left-facing_fist_light_skin_tone:': u'\U0001F91B\U0001F3FB',
+ u':left-facing_fist_medium-dark_skin_tone:': u'\U0001F91B\U0001F3FE',
+ u':left-facing_fist_medium-light_skin_tone:': u'\U0001F91B\U0001F3FC',
+ u':left-facing_fist_medium_skin_tone:': u'\U0001F91B\U0001F3FD',
+ u':left-right_arrow:': u'\U00002194',
+ u':left_arrow:': u'\U00002B05',
+ u':left_arrow_curving_right:': u'\U000021AA',
+ u':left_luggage:': u'\U0001F6C5',
+ u':left_speech_bubble:': u'\U0001F5E8',
+ u':lemon:': u'\U0001F34B',
+ u':leopard:': u'\U0001F406',
+ u':level_slider:': u'\U0001F39A',
+ u':light_bulb:': u'\U0001F4A1',
+ u':light_rail:': u'\U0001F688',
+ u':link:': u'\U0001F517',
+ u':linked_paperclips:': u'\U0001F587',
+ u':lion_face:': u'\U0001F981',
+ u':lipstick:': u'\U0001F484',
+ u':litter_in_bin_sign:': u'\U0001F6AE',
+ u':lizard:': u'\U0001F98E',
+ u':locked:': u'\U0001F512',
+ u':locked_with_key:': u'\U0001F510',
+ u':locked_with_pen:': u'\U0001F50F',
+ u':locomotive:': u'\U0001F682',
+ u':lollipop:': u'\U0001F36D',
+ u':loudly_crying_face:': u'\U0001F62D',
+ u':loudspeaker:': u'\U0001F4E2',
+ u':love-you_gesture:': u'\U0001F91F',
+ u':love-you_gesture_dark_skin_tone:': u'\U0001F91F\U0001F3FF',
+ u':love-you_gesture_light_skin_tone:': u'\U0001F91F\U0001F3FB',
+ u':love-you_gesture_medium-dark_skin_tone:': u'\U0001F91F\U0001F3FE',
+ u':love-you_gesture_medium-light_skin_tone:': u'\U0001F91F\U0001F3FC',
+ u':love-you_gesture_medium_skin_tone:': u'\U0001F91F\U0001F3FD',
+ u':love_hotel:': u'\U0001F3E9',
+ u':love_letter:': u'\U0001F48C',
+ u':lying_face:': u'\U0001F925',
+ u':mage:': u'\U0001F9D9',
+ u':mage_dark_skin_tone:': u'\U0001F9D9\U0001F3FF',
+ u':mage_light_skin_tone:': u'\U0001F9D9\U0001F3FB',
+ u':mage_medium-dark_skin_tone:': u'\U0001F9D9\U0001F3FE',
+ u':mage_medium-light_skin_tone:': u'\U0001F9D9\U0001F3FC',
+ u':mage_medium_skin_tone:': u'\U0001F9D9\U0001F3FD',
+ u':magnifying_glass_tilted_left:': u'\U0001F50D',
+ u':magnifying_glass_tilted_right:': u'\U0001F50E',
+ u':mahjong_red_dragon:': u'\U0001F004',
+ u':male_sign:': u'\U00002642',
+ u':man:': u'\U0001F468',
+ u':man_and_woman_holding_hands:': u'\U0001F46B',
+ u':man_artist:': u'\U0001F468\U0000200D\U0001F3A8',
+ u':man_artist_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F3A8',
+ u':man_artist_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F3A8',
+ u':man_artist_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F3A8',
+ u':man_artist_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F3A8',
+ u':man_artist_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F3A8',
+ u':man_astronaut:': u'\U0001F468\U0000200D\U0001F680',
+ u':man_astronaut_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F680',
+ u':man_astronaut_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F680',
+ u':man_astronaut_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F680',
+ u':man_astronaut_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F680',
+ u':man_astronaut_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F680',
+ u':man_biking:': u'\U0001F6B4\U0000200D\U00002642\U0000FE0F',
+ u':man_biking_dark_skin_tone:': u'\U0001F6B4\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_biking_light_skin_tone:': u'\U0001F6B4\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_biking_medium-dark_skin_tone:': u'\U0001F6B4\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_biking_medium-light_skin_tone:': u'\U0001F6B4\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_biking_medium_skin_tone:': u'\U0001F6B4\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball:': u'\U000026F9\U0000FE0F\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball_dark_skin_tone:': u'\U000026F9\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball_light_skin_tone:': u'\U000026F9\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball_medium-dark_skin_tone:': u'\U000026F9\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball_medium-light_skin_tone:': u'\U000026F9\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_bouncing_ball_medium_skin_tone:': u'\U000026F9\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing:': u'\U0001F647\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing_dark_skin_tone:': u'\U0001F647\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing_light_skin_tone:': u'\U0001F647\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing_medium-dark_skin_tone:': u'\U0001F647\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing_medium-light_skin_tone:': u'\U0001F647\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_bowing_medium_skin_tone:': u'\U0001F647\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling:': u'\U0001F938\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling_dark_skin_tone:': u'\U0001F938\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling_light_skin_tone:': u'\U0001F938\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling_medium-dark_skin_tone:': u'\U0001F938\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling_medium-light_skin_tone:': u'\U0001F938\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_cartwheeling_medium_skin_tone:': u'\U0001F938\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing:': u'\U0001F9D7\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing_dark_skin_tone:': u'\U0001F9D7\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing_light_skin_tone:': u'\U0001F9D7\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing_medium-dark_skin_tone:': u'\U0001F9D7\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing_medium-light_skin_tone:': u'\U0001F9D7\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_climbing_medium_skin_tone:': u'\U0001F9D7\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker:': u'\U0001F477\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker_dark_skin_tone:': u'\U0001F477\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker_light_skin_tone:': u'\U0001F477\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker_medium-dark_skin_tone:': u'\U0001F477\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker_medium-light_skin_tone:': u'\U0001F477\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_construction_worker_medium_skin_tone:': u'\U0001F477\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_cook:': u'\U0001F468\U0000200D\U0001F373',
+ u':man_cook_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F373',
+ u':man_cook_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F373',
+ u':man_cook_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F373',
+ u':man_cook_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F373',
+ u':man_cook_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F373',
+ u':man_dancing:': u'\U0001F57A',
+ u':man_dancing_dark_skin_tone:': u'\U0001F57A\U0001F3FF',
+ u':man_dancing_light_skin_tone:': u'\U0001F57A\U0001F3FB',
+ u':man_dancing_medium-dark_skin_tone:': u'\U0001F57A\U0001F3FE',
+ u':man_dancing_medium-light_skin_tone:': u'\U0001F57A\U0001F3FC',
+ u':man_dancing_medium_skin_tone:': u'\U0001F57A\U0001F3FD',
+ u':man_dark_skin_tone:': u'\U0001F468\U0001F3FF',
+ u':man_detective:': u'\U0001F575\U0000FE0F\U0000200D\U00002642\U0000FE0F',
+ u':man_detective_dark_skin_tone:': u'\U0001F575\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_detective_light_skin_tone:': u'\U0001F575\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_detective_medium-dark_skin_tone:': u'\U0001F575\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_detective_medium-light_skin_tone:': u'\U0001F575\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_detective_medium_skin_tone:': u'\U0001F575\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_elf:': u'\U0001F9DD\U0000200D\U00002642\U0000FE0F',
+ u':man_elf_dark_skin_tone:': u'\U0001F9DD\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_elf_light_skin_tone:': u'\U0001F9DD\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_elf_medium-dark_skin_tone:': u'\U0001F9DD\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_elf_medium-light_skin_tone:': u'\U0001F9DD\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_elf_medium_skin_tone:': u'\U0001F9DD\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming:': u'\U0001F926\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming_dark_skin_tone:': u'\U0001F926\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming_light_skin_tone:': u'\U0001F926\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming_medium-dark_skin_tone:': u'\U0001F926\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming_medium-light_skin_tone:': u'\U0001F926\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_facepalming_medium_skin_tone:': u'\U0001F926\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_factory_worker:': u'\U0001F468\U0000200D\U0001F3ED',
+ u':man_factory_worker_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F3ED',
+ u':man_factory_worker_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F3ED',
+ u':man_factory_worker_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F3ED',
+ u':man_factory_worker_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F3ED',
+ u':man_factory_worker_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F3ED',
+ u':man_fairy:': u'\U0001F9DA\U0000200D\U00002642\U0000FE0F',
+ u':man_fairy_dark_skin_tone:': u'\U0001F9DA\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_fairy_light_skin_tone:': u'\U0001F9DA\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_fairy_medium-dark_skin_tone:': u'\U0001F9DA\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_fairy_medium-light_skin_tone:': u'\U0001F9DA\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_fairy_medium_skin_tone:': u'\U0001F9DA\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_farmer:': u'\U0001F468\U0000200D\U0001F33E',
+ u':man_farmer_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F33E',
+ u':man_farmer_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F33E',
+ u':man_farmer_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F33E',
+ u':man_farmer_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F33E',
+ u':man_farmer_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F33E',
+ u':man_firefighter:': u'\U0001F468\U0000200D\U0001F692',
+ u':man_firefighter_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F692',
+ u':man_firefighter_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F692',
+ u':man_firefighter_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F692',
+ u':man_firefighter_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F692',
+ u':man_firefighter_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F692',
+ u':man_frowning:': u'\U0001F64D\U0000200D\U00002642\U0000FE0F',
+ u':man_frowning_dark_skin_tone:': u'\U0001F64D\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_frowning_light_skin_tone:': u'\U0001F64D\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_frowning_medium-dark_skin_tone:': u'\U0001F64D\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_frowning_medium-light_skin_tone:': u'\U0001F64D\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_frowning_medium_skin_tone:': u'\U0001F64D\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_genie:': u'\U0001F9DE\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO:': u'\U0001F645\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO_dark_skin_tone:': u'\U0001F645\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO_light_skin_tone:': u'\U0001F645\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO_medium-dark_skin_tone:': u'\U0001F645\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO_medium-light_skin_tone:': u'\U0001F645\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_NO_medium_skin_tone:': u'\U0001F645\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK:': u'\U0001F646\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK_dark_skin_tone:': u'\U0001F646\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK_light_skin_tone:': u'\U0001F646\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK_medium-dark_skin_tone:': u'\U0001F646\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK_medium-light_skin_tone:': u'\U0001F646\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_gesturing_OK_medium_skin_tone:': u'\U0001F646\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut:': u'\U0001F487\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut_dark_skin_tone:': u'\U0001F487\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut_light_skin_tone:': u'\U0001F487\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut_medium-dark_skin_tone:': u'\U0001F487\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut_medium-light_skin_tone:': u'\U0001F487\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_haircut_medium_skin_tone:': u'\U0001F487\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage:': u'\U0001F486\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage_dark_skin_tone:': u'\U0001F486\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage_light_skin_tone:': u'\U0001F486\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage_medium-dark_skin_tone:': u'\U0001F486\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage_medium-light_skin_tone:': u'\U0001F486\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_getting_massage_medium_skin_tone:': u'\U0001F486\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing:': u'\U0001F3CC\U0000FE0F\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing_dark_skin_tone:': u'\U0001F3CC\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing_light_skin_tone:': u'\U0001F3CC\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing_medium-dark_skin_tone:': u'\U0001F3CC\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing_medium-light_skin_tone:': u'\U0001F3CC\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_golfing_medium_skin_tone:': u'\U0001F3CC\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_guard:': u'\U0001F482\U0000200D\U00002642\U0000FE0F',
+ u':man_guard_dark_skin_tone:': u'\U0001F482\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_guard_light_skin_tone:': u'\U0001F482\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_guard_medium-dark_skin_tone:': u'\U0001F482\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_guard_medium-light_skin_tone:': u'\U0001F482\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_guard_medium_skin_tone:': u'\U0001F482\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_health_worker:': u'\U0001F468\U0000200D\U00002695\U0000FE0F',
+ u':man_health_worker_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U00002695\U0000FE0F',
+ u':man_health_worker_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U00002695\U0000FE0F',
+ u':man_health_worker_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U00002695\U0000FE0F',
+ u':man_health_worker_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U00002695\U0000FE0F',
+ u':man_health_worker_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U00002695\U0000FE0F',
+ u':man_in_lotus_position:': u'\U0001F9D8\U0000200D\U00002642\U0000FE0F',
+ u':man_in_lotus_position_dark_skin_tone:': u'\U0001F9D8\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_in_lotus_position_light_skin_tone:': u'\U0001F9D8\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_in_lotus_position_medium-dark_skin_tone:': u'\U0001F9D8\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_in_lotus_position_medium-light_skin_tone:': u'\U0001F9D8\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_in_lotus_position_medium_skin_tone:': u'\U0001F9D8\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room:': u'\U0001F9D6\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room_dark_skin_tone:': u'\U0001F9D6\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room_light_skin_tone:': u'\U0001F9D6\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room_medium-dark_skin_tone:': u'\U0001F9D6\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room_medium-light_skin_tone:': u'\U0001F9D6\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_in_steamy_room_medium_skin_tone:': u'\U0001F9D6\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_in_suit_levitating:': u'\U0001F574',
+ u':man_in_suit_levitating_dark_skin_tone:': u'\U0001F574\U0001F3FF',
+ u':man_in_suit_levitating_light_skin_tone:': u'\U0001F574\U0001F3FB',
+ u':man_in_suit_levitating_medium-dark_skin_tone:': u'\U0001F574\U0001F3FE',
+ u':man_in_suit_levitating_medium-light_skin_tone:': u'\U0001F574\U0001F3FC',
+ u':man_in_suit_levitating_medium_skin_tone:': u'\U0001F574\U0001F3FD',
+ u':man_in_tuxedo:': u'\U0001F935',
+ u':man_in_tuxedo_dark_skin_tone:': u'\U0001F935\U0001F3FF',
+ u':man_in_tuxedo_light_skin_tone:': u'\U0001F935\U0001F3FB',
+ u':man_in_tuxedo_medium-dark_skin_tone:': u'\U0001F935\U0001F3FE',
+ u':man_in_tuxedo_medium-light_skin_tone:': u'\U0001F935\U0001F3FC',
+ u':man_in_tuxedo_medium_skin_tone:': u'\U0001F935\U0001F3FD',
+ u':man_judge:': u'\U0001F468\U0000200D\U00002696\U0000FE0F',
+ u':man_judge_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U00002696\U0000FE0F',
+ u':man_judge_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U00002696\U0000FE0F',
+ u':man_judge_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U00002696\U0000FE0F',
+ u':man_judge_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U00002696\U0000FE0F',
+ u':man_judge_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U00002696\U0000FE0F',
+ u':man_juggling:': u'\U0001F939\U0000200D\U00002642\U0000FE0F',
+ u':man_juggling_dark_skin_tone:': u'\U0001F939\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_juggling_light_skin_tone:': u'\U0001F939\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_juggling_medium-dark_skin_tone:': u'\U0001F939\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_juggling_medium-light_skin_tone:': u'\U0001F939\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_juggling_medium_skin_tone:': u'\U0001F939\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights:': u'\U0001F3CB\U0000FE0F\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights_dark_skin_tone:': u'\U0001F3CB\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights_light_skin_tone:': u'\U0001F3CB\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights_medium-dark_skin_tone:': u'\U0001F3CB\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights_medium-light_skin_tone:': u'\U0001F3CB\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_lifting_weights_medium_skin_tone:': u'\U0001F3CB\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_light_skin_tone:': u'\U0001F468\U0001F3FB',
+ u':man_mage:': u'\U0001F9D9\U0000200D\U00002642\U0000FE0F',
+ u':man_mage_dark_skin_tone:': u'\U0001F9D9\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_mage_light_skin_tone:': u'\U0001F9D9\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_mage_medium-dark_skin_tone:': u'\U0001F9D9\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_mage_medium-light_skin_tone:': u'\U0001F9D9\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_mage_medium_skin_tone:': u'\U0001F9D9\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_mechanic:': u'\U0001F468\U0000200D\U0001F527',
+ u':man_mechanic_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F527',
+ u':man_mechanic_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F527',
+ u':man_mechanic_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F527',
+ u':man_mechanic_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F527',
+ u':man_mechanic_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F527',
+ u':man_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE',
+ u':man_medium-light_skin_tone:': u'\U0001F468\U0001F3FC',
+ u':man_medium_skin_tone:': u'\U0001F468\U0001F3FD',
+ u':man_mountain_biking:': u'\U0001F6B5\U0000200D\U00002642\U0000FE0F',
+ u':man_mountain_biking_dark_skin_tone:': u'\U0001F6B5\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_mountain_biking_light_skin_tone:': u'\U0001F6B5\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_mountain_biking_medium-dark_skin_tone:': u'\U0001F6B5\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_mountain_biking_medium-light_skin_tone:': u'\U0001F6B5\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_mountain_biking_medium_skin_tone:': u'\U0001F6B5\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_office_worker:': u'\U0001F468\U0000200D\U0001F4BC',
+ u':man_office_worker_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F4BC',
+ u':man_office_worker_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F4BC',
+ u':man_office_worker_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F4BC',
+ u':man_office_worker_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F4BC',
+ u':man_office_worker_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F4BC',
+ u':man_pilot:': u'\U0001F468\U0000200D\U00002708\U0000FE0F',
+ u':man_pilot_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U00002708\U0000FE0F',
+ u':man_pilot_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U00002708\U0000FE0F',
+ u':man_pilot_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U00002708\U0000FE0F',
+ u':man_pilot_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U00002708\U0000FE0F',
+ u':man_pilot_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U00002708\U0000FE0F',
+ u':man_playing_handball:': u'\U0001F93E\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_handball_dark_skin_tone:': u'\U0001F93E\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_handball_light_skin_tone:': u'\U0001F93E\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_handball_medium-dark_skin_tone:': u'\U0001F93E\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_handball_medium-light_skin_tone:': u'\U0001F93E\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_handball_medium_skin_tone:': u'\U0001F93E\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo:': u'\U0001F93D\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo_dark_skin_tone:': u'\U0001F93D\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo_light_skin_tone:': u'\U0001F93D\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo_medium-dark_skin_tone:': u'\U0001F93D\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo_medium-light_skin_tone:': u'\U0001F93D\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_playing_water_polo_medium_skin_tone:': u'\U0001F93D\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer:': u'\U0001F46E\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer_dark_skin_tone:': u'\U0001F46E\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer_light_skin_tone:': u'\U0001F46E\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer_medium-dark_skin_tone:': u'\U0001F46E\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer_medium-light_skin_tone:': u'\U0001F46E\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_police_officer_medium_skin_tone:': u'\U0001F46E\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting:': u'\U0001F64E\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting_dark_skin_tone:': u'\U0001F64E\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting_light_skin_tone:': u'\U0001F64E\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting_medium-dark_skin_tone:': u'\U0001F64E\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting_medium-light_skin_tone:': u'\U0001F64E\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_pouting_medium_skin_tone:': u'\U0001F64E\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand:': u'\U0001F64B\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand_dark_skin_tone:': u'\U0001F64B\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand_light_skin_tone:': u'\U0001F64B\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand_medium-dark_skin_tone:': u'\U0001F64B\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand_medium-light_skin_tone:': u'\U0001F64B\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_raising_hand_medium_skin_tone:': u'\U0001F64B\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat:': u'\U0001F6A3\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat_dark_skin_tone:': u'\U0001F6A3\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat_light_skin_tone:': u'\U0001F6A3\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat_medium-dark_skin_tone:': u'\U0001F6A3\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat_medium-light_skin_tone:': u'\U0001F6A3\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_rowing_boat_medium_skin_tone:': u'\U0001F6A3\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_running:': u'\U0001F3C3\U0000200D\U00002642\U0000FE0F',
+ u':man_running_dark_skin_tone:': u'\U0001F3C3\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_running_light_skin_tone:': u'\U0001F3C3\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_running_medium-dark_skin_tone:': u'\U0001F3C3\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_running_medium-light_skin_tone:': u'\U0001F3C3\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_running_medium_skin_tone:': u'\U0001F3C3\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_scientist:': u'\U0001F468\U0000200D\U0001F52C',
+ u':man_scientist_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F52C',
+ u':man_scientist_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F52C',
+ u':man_scientist_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F52C',
+ u':man_scientist_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F52C',
+ u':man_scientist_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F52C',
+ u':man_shrugging:': u'\U0001F937\U0000200D\U00002642\U0000FE0F',
+ u':man_shrugging_dark_skin_tone:': u'\U0001F937\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_shrugging_light_skin_tone:': u'\U0001F937\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_shrugging_medium-dark_skin_tone:': u'\U0001F937\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_shrugging_medium-light_skin_tone:': u'\U0001F937\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_shrugging_medium_skin_tone:': u'\U0001F937\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_singer:': u'\U0001F468\U0000200D\U0001F3A4',
+ u':man_singer_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F3A4',
+ u':man_singer_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F3A4',
+ u':man_singer_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F3A4',
+ u':man_singer_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F3A4',
+ u':man_singer_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F3A4',
+ u':man_student:': u'\U0001F468\U0000200D\U0001F393',
+ u':man_student_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F393',
+ u':man_student_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F393',
+ u':man_student_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F393',
+ u':man_student_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F393',
+ u':man_student_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F393',
+ u':man_surfing:': u'\U0001F3C4\U0000200D\U00002642\U0000FE0F',
+ u':man_surfing_dark_skin_tone:': u'\U0001F3C4\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_surfing_light_skin_tone:': u'\U0001F3C4\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_surfing_medium-dark_skin_tone:': u'\U0001F3C4\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_surfing_medium-light_skin_tone:': u'\U0001F3C4\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_surfing_medium_skin_tone:': u'\U0001F3C4\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming:': u'\U0001F3CA\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming_dark_skin_tone:': u'\U0001F3CA\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming_light_skin_tone:': u'\U0001F3CA\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming_medium-dark_skin_tone:': u'\U0001F3CA\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming_medium-light_skin_tone:': u'\U0001F3CA\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_swimming_medium_skin_tone:': u'\U0001F3CA\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_teacher:': u'\U0001F468\U0000200D\U0001F3EB',
+ u':man_teacher_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F3EB',
+ u':man_teacher_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F3EB',
+ u':man_teacher_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F3EB',
+ u':man_teacher_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F3EB',
+ u':man_teacher_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F3EB',
+ u':man_technologist:': u'\U0001F468\U0000200D\U0001F4BB',
+ u':man_technologist_dark_skin_tone:': u'\U0001F468\U0001F3FF\U0000200D\U0001F4BB',
+ u':man_technologist_light_skin_tone:': u'\U0001F468\U0001F3FB\U0000200D\U0001F4BB',
+ u':man_technologist_medium-dark_skin_tone:': u'\U0001F468\U0001F3FE\U0000200D\U0001F4BB',
+ u':man_technologist_medium-light_skin_tone:': u'\U0001F468\U0001F3FC\U0000200D\U0001F4BB',
+ u':man_technologist_medium_skin_tone:': u'\U0001F468\U0001F3FD\U0000200D\U0001F4BB',
+ u':man_tipping_hand:': u'\U0001F481\U0000200D\U00002642\U0000FE0F',
+ u':man_tipping_hand_dark_skin_tone:': u'\U0001F481\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_tipping_hand_light_skin_tone:': u'\U0001F481\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_tipping_hand_medium-dark_skin_tone:': u'\U0001F481\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_tipping_hand_medium-light_skin_tone:': u'\U0001F481\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_tipping_hand_medium_skin_tone:': u'\U0001F481\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire:': u'\U0001F9DB\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire_dark_skin_tone:': u'\U0001F9DB\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire_light_skin_tone:': u'\U0001F9DB\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire_medium-dark_skin_tone:': u'\U0001F9DB\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire_medium-light_skin_tone:': u'\U0001F9DB\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_vampire_medium_skin_tone:': u'\U0001F9DB\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_walking:': u'\U0001F6B6\U0000200D\U00002642\U0000FE0F',
+ u':man_walking_dark_skin_tone:': u'\U0001F6B6\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_walking_light_skin_tone:': u'\U0001F6B6\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_walking_medium-dark_skin_tone:': u'\U0001F6B6\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_walking_medium-light_skin_tone:': u'\U0001F6B6\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_walking_medium_skin_tone:': u'\U0001F6B6\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban:': u'\U0001F473\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban_dark_skin_tone:': u'\U0001F473\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban_light_skin_tone:': u'\U0001F473\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban_medium-dark_skin_tone:': u'\U0001F473\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban_medium-light_skin_tone:': u'\U0001F473\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':man_wearing_turban_medium_skin_tone:': u'\U0001F473\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':man_with_Chinese_cap:': u'\U0001F472',
+ u':man_with_Chinese_cap_dark_skin_tone:': u'\U0001F472\U0001F3FF',
+ u':man_with_Chinese_cap_light_skin_tone:': u'\U0001F472\U0001F3FB',
+ u':man_with_Chinese_cap_medium-dark_skin_tone:': u'\U0001F472\U0001F3FE',
+ u':man_with_Chinese_cap_medium-light_skin_tone:': u'\U0001F472\U0001F3FC',
+ u':man_with_Chinese_cap_medium_skin_tone:': u'\U0001F472\U0001F3FD',
+ u':man_zombie:': u'\U0001F9DF\U0000200D\U00002642\U0000FE0F',
+ u':mantelpiece_clock:': u'\U0001F570',
+ u':man’s_shoe:': u'\U0001F45E',
+ u':map_of_Japan:': u'\U0001F5FE',
+ u':maple_leaf:': u'\U0001F341',
+ u':martial_arts_uniform:': u'\U0001F94B',
+ u':meat_on_bone:': u'\U0001F356',
+ u':medical_symbol:': u'\U00002695',
+ u':megaphone:': u'\U0001F4E3',
+ u':melon:': u'\U0001F348',
+ u':memo:': u'\U0001F4DD',
+ u':men_with_bunny_ears:': u'\U0001F46F\U0000200D\U00002642\U0000FE0F',
+ u':men_wrestling:': u'\U0001F93C\U0000200D\U00002642\U0000FE0F',
+ u':menorah:': u'\U0001F54E',
+ u':men’s_room:': u'\U0001F6B9',
+ u':mermaid:': u'\U0001F9DC\U0000200D\U00002640\U0000FE0F',
+ u':mermaid_dark_skin_tone:': u'\U0001F9DC\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':mermaid_light_skin_tone:': u'\U0001F9DC\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':mermaid_medium-dark_skin_tone:': u'\U0001F9DC\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':mermaid_medium-light_skin_tone:': u'\U0001F9DC\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':mermaid_medium_skin_tone:': u'\U0001F9DC\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':merman:': u'\U0001F9DC\U0000200D\U00002642\U0000FE0F',
+ u':merman_dark_skin_tone:': u'\U0001F9DC\U0001F3FF\U0000200D\U00002642\U0000FE0F',
+ u':merman_light_skin_tone:': u'\U0001F9DC\U0001F3FB\U0000200D\U00002642\U0000FE0F',
+ u':merman_medium-dark_skin_tone:': u'\U0001F9DC\U0001F3FE\U0000200D\U00002642\U0000FE0F',
+ u':merman_medium-light_skin_tone:': u'\U0001F9DC\U0001F3FC\U0000200D\U00002642\U0000FE0F',
+ u':merman_medium_skin_tone:': u'\U0001F9DC\U0001F3FD\U0000200D\U00002642\U0000FE0F',
+ u':merperson:': u'\U0001F9DC',
+ u':merperson_dark_skin_tone:': u'\U0001F9DC\U0001F3FF',
+ u':merperson_light_skin_tone:': u'\U0001F9DC\U0001F3FB',
+ u':merperson_medium-dark_skin_tone:': u'\U0001F9DC\U0001F3FE',
+ u':merperson_medium-light_skin_tone:': u'\U0001F9DC\U0001F3FC',
+ u':merperson_medium_skin_tone:': u'\U0001F9DC\U0001F3FD',
+ u':metro:': u'\U0001F687',
+ u':microphone:': u'\U0001F3A4',
+ u':microscope:': u'\U0001F52C',
+ u':middle_finger:': u'\U0001F595',
+ u':middle_finger_dark_skin_tone:': u'\U0001F595\U0001F3FF',
+ u':middle_finger_light_skin_tone:': u'\U0001F595\U0001F3FB',
+ u':middle_finger_medium-dark_skin_tone:': u'\U0001F595\U0001F3FE',
+ u':middle_finger_medium-light_skin_tone:': u'\U0001F595\U0001F3FC',
+ u':middle_finger_medium_skin_tone:': u'\U0001F595\U0001F3FD',
+ u':military_medal:': u'\U0001F396',
+ u':milky_way:': u'\U0001F30C',
+ u':minibus:': u'\U0001F690',
+ u':moai:': u'\U0001F5FF',
+ u':mobile_phone:': u'\U0001F4F1',
+ u':mobile_phone_off:': u'\U0001F4F4',
+ u':mobile_phone_with_arrow:': u'\U0001F4F2',
+ u':money-mouth_face:': u'\U0001F911',
+ u':money_bag:': u'\U0001F4B0',
+ u':money_with_wings:': u'\U0001F4B8',
+ u':monkey:': u'\U0001F412',
+ u':monkey_face:': u'\U0001F435',
+ u':monorail:': u'\U0001F69D',
+ u':moon_viewing_ceremony:': u'\U0001F391',
+ u':mosque:': u'\U0001F54C',
+ u':motor_boat:': u'\U0001F6E5',
+ u':motor_scooter:': u'\U0001F6F5',
+ u':motorcycle:': u'\U0001F3CD',
+ u':motorway:': u'\U0001F6E3',
+ u':mount_fuji:': u'\U0001F5FB',
+ u':mountain:': u'\U000026F0',
+ u':mountain_cableway:': u'\U0001F6A0',
+ u':mountain_railway:': u'\U0001F69E',
+ u':mouse:': u'\U0001F401',
+ u':mouse_face:': u'\U0001F42D',
+ u':mouth:': u'\U0001F444',
+ u':movie_camera:': u'\U0001F3A5',
+ u':mushroom:': u'\U0001F344',
+ u':musical_keyboard:': u'\U0001F3B9',
+ u':musical_note:': u'\U0001F3B5',
+ u':musical_notes:': u'\U0001F3B6',
+ u':musical_score:': u'\U0001F3BC',
+ u':muted_speaker:': u'\U0001F507',
+ u':nail_polish:': u'\U0001F485',
+ u':nail_polish_dark_skin_tone:': u'\U0001F485\U0001F3FF',
+ u':nail_polish_light_skin_tone:': u'\U0001F485\U0001F3FB',
+ u':nail_polish_medium-dark_skin_tone:': u'\U0001F485\U0001F3FE',
+ u':nail_polish_medium-light_skin_tone:': u'\U0001F485\U0001F3FC',
+ u':nail_polish_medium_skin_tone:': u'\U0001F485\U0001F3FD',
+ u':name_badge:': u'\U0001F4DB',
+ u':national_park:': u'\U0001F3DE',
+ u':nauseated_face:': u'\U0001F922',
+ u':necktie:': u'\U0001F454',
+ u':nerd_face:': u'\U0001F913',
+ u':neutral_face:': u'\U0001F610',
+ u':new_moon:': u'\U0001F311',
+ u':new_moon_face:': u'\U0001F31A',
+ u':newspaper:': u'\U0001F4F0',
+ u':next_track_button:': u'\U000023ED',
+ u':night_with_stars:': u'\U0001F303',
+ u':nine-thirty:': u'\U0001F564',
+ u':nine_o’clock:': u'\U0001F558',
+ u':no_bicycles:': u'\U0001F6B3',
+ u':no_entry:': u'\U000026D4',
+ u':no_littering:': u'\U0001F6AF',
+ u':no_mobile_phones:': u'\U0001F4F5',
+ u':no_one_under_eighteen:': u'\U0001F51E',
+ u':no_pedestrians:': u'\U0001F6B7',
+ u':no_smoking:': u'\U0001F6AD',
+ u':non-potable_water:': u'\U0001F6B1',
+ u':nose:': u'\U0001F443',
+ u':nose_dark_skin_tone:': u'\U0001F443\U0001F3FF',
+ u':nose_light_skin_tone:': u'\U0001F443\U0001F3FB',
+ u':nose_medium-dark_skin_tone:': u'\U0001F443\U0001F3FE',
+ u':nose_medium-light_skin_tone:': u'\U0001F443\U0001F3FC',
+ u':nose_medium_skin_tone:': u'\U0001F443\U0001F3FD',
+ u':notebook:': u'\U0001F4D3',
+ u':notebook_with_decorative_cover:': u'\U0001F4D4',
+ u':nut_and_bolt:': u'\U0001F529',
+ u':octopus:': u'\U0001F419',
+ u':oden:': u'\U0001F362',
+ u':office_building:': u'\U0001F3E2',
+ u':ogre:': u'\U0001F479',
+ u':oil_drum:': u'\U0001F6E2',
+ u':old_key:': u'\U0001F5DD',
+ u':old_man:': u'\U0001F474',
+ u':old_man_dark_skin_tone:': u'\U0001F474\U0001F3FF',
+ u':old_man_light_skin_tone:': u'\U0001F474\U0001F3FB',
+ u':old_man_medium-dark_skin_tone:': u'\U0001F474\U0001F3FE',
+ u':old_man_medium-light_skin_tone:': u'\U0001F474\U0001F3FC',
+ u':old_man_medium_skin_tone:': u'\U0001F474\U0001F3FD',
+ u':old_woman:': u'\U0001F475',
+ u':old_woman_dark_skin_tone:': u'\U0001F475\U0001F3FF',
+ u':old_woman_light_skin_tone:': u'\U0001F475\U0001F3FB',
+ u':old_woman_medium-dark_skin_tone:': u'\U0001F475\U0001F3FE',
+ u':old_woman_medium-light_skin_tone:': u'\U0001F475\U0001F3FC',
+ u':old_woman_medium_skin_tone:': u'\U0001F475\U0001F3FD',
+ u':older_adult:': u'\U0001F9D3',
+ u':older_adult_dark_skin_tone:': u'\U0001F9D3\U0001F3FF',
+ u':older_adult_light_skin_tone:': u'\U0001F9D3\U0001F3FB',
+ u':older_adult_medium-dark_skin_tone:': u'\U0001F9D3\U0001F3FE',
+ u':older_adult_medium-light_skin_tone:': u'\U0001F9D3\U0001F3FC',
+ u':older_adult_medium_skin_tone:': u'\U0001F9D3\U0001F3FD',
+ u':om:': u'\U0001F549',
+ u':oncoming_automobile:': u'\U0001F698',
+ u':oncoming_bus:': u'\U0001F68D',
+ u':oncoming_fist:': u'\U0001F44A',
+ u':oncoming_fist_dark_skin_tone:': u'\U0001F44A\U0001F3FF',
+ u':oncoming_fist_light_skin_tone:': u'\U0001F44A\U0001F3FB',
+ u':oncoming_fist_medium-dark_skin_tone:': u'\U0001F44A\U0001F3FE',
+ u':oncoming_fist_medium-light_skin_tone:': u'\U0001F44A\U0001F3FC',
+ u':oncoming_fist_medium_skin_tone:': u'\U0001F44A\U0001F3FD',
+ u':oncoming_police_car:': u'\U0001F694',
+ u':oncoming_taxi:': u'\U0001F696',
+ u':one-thirty:': u'\U0001F55C',
+ u':one_o’clock:': u'\U0001F550',
+ u':open_book:': u'\U0001F4D6',
+ u':open_file_folder:': u'\U0001F4C2',
+ u':open_hands:': u'\U0001F450',
+ u':open_hands_dark_skin_tone:': u'\U0001F450\U0001F3FF',
+ u':open_hands_light_skin_tone:': u'\U0001F450\U0001F3FB',
+ u':open_hands_medium-dark_skin_tone:': u'\U0001F450\U0001F3FE',
+ u':open_hands_medium-light_skin_tone:': u'\U0001F450\U0001F3FC',
+ u':open_hands_medium_skin_tone:': u'\U0001F450\U0001F3FD',
+ u':open_mailbox_with_lowered_flag:': u'\U0001F4ED',
+ u':open_mailbox_with_raised_flag:': u'\U0001F4EC',
+ u':optical_disk:': u'\U0001F4BF',
+ u':orange_book:': u'\U0001F4D9',
+ u':orange_heart:': u'\U0001F9E1',
+ u':orthodox_cross:': u'\U00002626',
+ u':outbox_tray:': u'\U0001F4E4',
+ u':owl:': u'\U0001F989',
+ u':ox:': u'\U0001F402',
+ u':package:': u'\U0001F4E6',
+ u':page_facing_up:': u'\U0001F4C4',
+ u':page_with_curl:': u'\U0001F4C3',
+ u':pager:': u'\U0001F4DF',
+ u':paintbrush:': u'\U0001F58C',
+ u':palm_tree:': u'\U0001F334',
+ u':palms_up_together:': u'\U0001F932',
+ u':palms_up_together_dark_skin_tone:': u'\U0001F932\U0001F3FF',
+ u':palms_up_together_light_skin_tone:': u'\U0001F932\U0001F3FB',
+ u':palms_up_together_medium-dark_skin_tone:': u'\U0001F932\U0001F3FE',
+ u':palms_up_together_medium-light_skin_tone:': u'\U0001F932\U0001F3FC',
+ u':palms_up_together_medium_skin_tone:': u'\U0001F932\U0001F3FD',
+ u':pancakes:': u'\U0001F95E',
+ u':panda_face:': u'\U0001F43C',
+ u':paperclip:': u'\U0001F4CE',
+ u':part_alternation_mark:': u'\U0000303D',
+ u':party_popper:': u'\U0001F389',
+ u':passenger_ship:': u'\U0001F6F3',
+ u':passport_control:': u'\U0001F6C2',
+ u':pause_button:': u'\U000023F8',
+ u':paw_prints:': u'\U0001F43E',
+ u':peace_symbol:': u'\U0000262E',
+ u':peach:': u'\U0001F351',
+ u':peanuts:': u'\U0001F95C',
+ u':pear:': u'\U0001F350',
+ u':pen:': u'\U0001F58A',
+ u':pencil:': u'\U0000270F',
+ u':penguin:': u'\U0001F427',
+ u':pensive_face:': u'\U0001F614',
+ u':people_with_bunny_ears:': u'\U0001F46F',
+ u':people_wrestling:': u'\U0001F93C',
+ u':performing_arts:': u'\U0001F3AD',
+ u':persevering_face:': u'\U0001F623',
+ u':person_biking:': u'\U0001F6B4',
+ u':person_biking_dark_skin_tone:': u'\U0001F6B4\U0001F3FF',
+ u':person_biking_light_skin_tone:': u'\U0001F6B4\U0001F3FB',
+ u':person_biking_medium-dark_skin_tone:': u'\U0001F6B4\U0001F3FE',
+ u':person_biking_medium-light_skin_tone:': u'\U0001F6B4\U0001F3FC',
+ u':person_biking_medium_skin_tone:': u'\U0001F6B4\U0001F3FD',
+ u':person_bouncing_ball:': u'\U000026F9',
+ u':person_bouncing_ball_dark_skin_tone:': u'\U000026F9\U0001F3FF',
+ u':person_bouncing_ball_light_skin_tone:': u'\U000026F9\U0001F3FB',
+ u':person_bouncing_ball_medium-dark_skin_tone:': u'\U000026F9\U0001F3FE',
+ u':person_bouncing_ball_medium-light_skin_tone:': u'\U000026F9\U0001F3FC',
+ u':person_bouncing_ball_medium_skin_tone:': u'\U000026F9\U0001F3FD',
+ u':person_bowing:': u'\U0001F647',
+ u':person_bowing_dark_skin_tone:': u'\U0001F647\U0001F3FF',
+ u':person_bowing_light_skin_tone:': u'\U0001F647\U0001F3FB',
+ u':person_bowing_medium-dark_skin_tone:': u'\U0001F647\U0001F3FE',
+ u':person_bowing_medium-light_skin_tone:': u'\U0001F647\U0001F3FC',
+ u':person_bowing_medium_skin_tone:': u'\U0001F647\U0001F3FD',
+ u':person_cartwheeling:': u'\U0001F938',
+ u':person_cartwheeling_dark_skin_tone:': u'\U0001F938\U0001F3FF',
+ u':person_cartwheeling_light_skin_tone:': u'\U0001F938\U0001F3FB',
+ u':person_cartwheeling_medium-dark_skin_tone:': u'\U0001F938\U0001F3FE',
+ u':person_cartwheeling_medium-light_skin_tone:': u'\U0001F938\U0001F3FC',
+ u':person_cartwheeling_medium_skin_tone:': u'\U0001F938\U0001F3FD',
+ u':person_climbing:': u'\U0001F9D7',
+ u':person_climbing_dark_skin_tone:': u'\U0001F9D7\U0001F3FF',
+ u':person_climbing_light_skin_tone:': u'\U0001F9D7\U0001F3FB',
+ u':person_climbing_medium-dark_skin_tone:': u'\U0001F9D7\U0001F3FE',
+ u':person_climbing_medium-light_skin_tone:': u'\U0001F9D7\U0001F3FC',
+ u':person_climbing_medium_skin_tone:': u'\U0001F9D7\U0001F3FD',
+ u':person_facepalming:': u'\U0001F926',
+ u':person_facepalming_dark_skin_tone:': u'\U0001F926\U0001F3FF',
+ u':person_facepalming_light_skin_tone:': u'\U0001F926\U0001F3FB',
+ u':person_facepalming_medium-dark_skin_tone:': u'\U0001F926\U0001F3FE',
+ u':person_facepalming_medium-light_skin_tone:': u'\U0001F926\U0001F3FC',
+ u':person_facepalming_medium_skin_tone:': u'\U0001F926\U0001F3FD',
+ u':person_fencing:': u'\U0001F93A',
+ u':person_frowning:': u'\U0001F64D',
+ u':person_frowning_dark_skin_tone:': u'\U0001F64D\U0001F3FF',
+ u':person_frowning_light_skin_tone:': u'\U0001F64D\U0001F3FB',
+ u':person_frowning_medium-dark_skin_tone:': u'\U0001F64D\U0001F3FE',
+ u':person_frowning_medium-light_skin_tone:': u'\U0001F64D\U0001F3FC',
+ u':person_frowning_medium_skin_tone:': u'\U0001F64D\U0001F3FD',
+ u':person_gesturing_NO:': u'\U0001F645',
+ u':person_gesturing_NO_dark_skin_tone:': u'\U0001F645\U0001F3FF',
+ u':person_gesturing_NO_light_skin_tone:': u'\U0001F645\U0001F3FB',
+ u':person_gesturing_NO_medium-dark_skin_tone:': u'\U0001F645\U0001F3FE',
+ u':person_gesturing_NO_medium-light_skin_tone:': u'\U0001F645\U0001F3FC',
+ u':person_gesturing_NO_medium_skin_tone:': u'\U0001F645\U0001F3FD',
+ u':person_gesturing_OK:': u'\U0001F646',
+ u':person_gesturing_OK_dark_skin_tone:': u'\U0001F646\U0001F3FF',
+ u':person_gesturing_OK_light_skin_tone:': u'\U0001F646\U0001F3FB',
+ u':person_gesturing_OK_medium-dark_skin_tone:': u'\U0001F646\U0001F3FE',
+ u':person_gesturing_OK_medium-light_skin_tone:': u'\U0001F646\U0001F3FC',
+ u':person_gesturing_OK_medium_skin_tone:': u'\U0001F646\U0001F3FD',
+ u':person_getting_haircut:': u'\U0001F487',
+ u':person_getting_haircut_dark_skin_tone:': u'\U0001F487\U0001F3FF',
+ u':person_getting_haircut_light_skin_tone:': u'\U0001F487\U0001F3FB',
+ u':person_getting_haircut_medium-dark_skin_tone:': u'\U0001F487\U0001F3FE',
+ u':person_getting_haircut_medium-light_skin_tone:': u'\U0001F487\U0001F3FC',
+ u':person_getting_haircut_medium_skin_tone:': u'\U0001F487\U0001F3FD',
+ u':person_getting_massage:': u'\U0001F486',
+ u':person_getting_massage_dark_skin_tone:': u'\U0001F486\U0001F3FF',
+ u':person_getting_massage_light_skin_tone:': u'\U0001F486\U0001F3FB',
+ u':person_getting_massage_medium-dark_skin_tone:': u'\U0001F486\U0001F3FE',
+ u':person_getting_massage_medium-light_skin_tone:': u'\U0001F486\U0001F3FC',
+ u':person_getting_massage_medium_skin_tone:': u'\U0001F486\U0001F3FD',
+ u':person_golfing:': u'\U0001F3CC',
+ u':person_golfing_dark_skin_tone:': u'\U0001F3CC\U0001F3FF',
+ u':person_golfing_light_skin_tone:': u'\U0001F3CC\U0001F3FB',
+ u':person_golfing_medium-dark_skin_tone:': u'\U0001F3CC\U0001F3FE',
+ u':person_golfing_medium-light_skin_tone:': u'\U0001F3CC\U0001F3FC',
+ u':person_golfing_medium_skin_tone:': u'\U0001F3CC\U0001F3FD',
+ u':person_in_bed:': u'\U0001F6CC',
+ u':person_in_bed_dark_skin_tone:': u'\U0001F6CC\U0001F3FF',
+ u':person_in_bed_light_skin_tone:': u'\U0001F6CC\U0001F3FB',
+ u':person_in_bed_medium-dark_skin_tone:': u'\U0001F6CC\U0001F3FE',
+ u':person_in_bed_medium-light_skin_tone:': u'\U0001F6CC\U0001F3FC',
+ u':person_in_bed_medium_skin_tone:': u'\U0001F6CC\U0001F3FD',
+ u':person_in_lotus_position:': u'\U0001F9D8',
+ u':person_in_lotus_position_dark_skin_tone:': u'\U0001F9D8\U0001F3FF',
+ u':person_in_lotus_position_light_skin_tone:': u'\U0001F9D8\U0001F3FB',
+ u':person_in_lotus_position_medium-dark_skin_tone:': u'\U0001F9D8\U0001F3FE',
+ u':person_in_lotus_position_medium-light_skin_tone:': u'\U0001F9D8\U0001F3FC',
+ u':person_in_lotus_position_medium_skin_tone:': u'\U0001F9D8\U0001F3FD',
+ u':person_in_steamy_room:': u'\U0001F9D6',
+ u':person_in_steamy_room_dark_skin_tone:': u'\U0001F9D6\U0001F3FF',
+ u':person_in_steamy_room_light_skin_tone:': u'\U0001F9D6\U0001F3FB',
+ u':person_in_steamy_room_medium-dark_skin_tone:': u'\U0001F9D6\U0001F3FE',
+ u':person_in_steamy_room_medium-light_skin_tone:': u'\U0001F9D6\U0001F3FC',
+ u':person_in_steamy_room_medium_skin_tone:': u'\U0001F9D6\U0001F3FD',
+ u':person_juggling:': u'\U0001F939',
+ u':person_juggling_dark_skin_tone:': u'\U0001F939\U0001F3FF',
+ u':person_juggling_light_skin_tone:': u'\U0001F939\U0001F3FB',
+ u':person_juggling_medium-dark_skin_tone:': u'\U0001F939\U0001F3FE',
+ u':person_juggling_medium-light_skin_tone:': u'\U0001F939\U0001F3FC',
+ u':person_juggling_medium_skin_tone:': u'\U0001F939\U0001F3FD',
+ u':person_lifting_weights:': u'\U0001F3CB',
+ u':person_lifting_weights_dark_skin_tone:': u'\U0001F3CB\U0001F3FF',
+ u':person_lifting_weights_light_skin_tone:': u'\U0001F3CB\U0001F3FB',
+ u':person_lifting_weights_medium-dark_skin_tone:': u'\U0001F3CB\U0001F3FE',
+ u':person_lifting_weights_medium-light_skin_tone:': u'\U0001F3CB\U0001F3FC',
+ u':person_lifting_weights_medium_skin_tone:': u'\U0001F3CB\U0001F3FD',
+ u':person_mountain_biking:': u'\U0001F6B5',
+ u':person_mountain_biking_dark_skin_tone:': u'\U0001F6B5\U0001F3FF',
+ u':person_mountain_biking_light_skin_tone:': u'\U0001F6B5\U0001F3FB',
+ u':person_mountain_biking_medium-dark_skin_tone:': u'\U0001F6B5\U0001F3FE',
+ u':person_mountain_biking_medium-light_skin_tone:': u'\U0001F6B5\U0001F3FC',
+ u':person_mountain_biking_medium_skin_tone:': u'\U0001F6B5\U0001F3FD',
+ u':person_playing_handball:': u'\U0001F93E',
+ u':person_playing_handball_dark_skin_tone:': u'\U0001F93E\U0001F3FF',
+ u':person_playing_handball_light_skin_tone:': u'\U0001F93E\U0001F3FB',
+ u':person_playing_handball_medium-dark_skin_tone:': u'\U0001F93E\U0001F3FE',
+ u':person_playing_handball_medium-light_skin_tone:': u'\U0001F93E\U0001F3FC',
+ u':person_playing_handball_medium_skin_tone:': u'\U0001F93E\U0001F3FD',
+ u':person_playing_water_polo:': u'\U0001F93D',
+ u':person_playing_water_polo_dark_skin_tone:': u'\U0001F93D\U0001F3FF',
+ u':person_playing_water_polo_light_skin_tone:': u'\U0001F93D\U0001F3FB',
+ u':person_playing_water_polo_medium-dark_skin_tone:': u'\U0001F93D\U0001F3FE',
+ u':person_playing_water_polo_medium-light_skin_tone:': u'\U0001F93D\U0001F3FC',
+ u':person_playing_water_polo_medium_skin_tone:': u'\U0001F93D\U0001F3FD',
+ u':person_pouting:': u'\U0001F64E',
+ u':person_pouting_dark_skin_tone:': u'\U0001F64E\U0001F3FF',
+ u':person_pouting_light_skin_tone:': u'\U0001F64E\U0001F3FB',
+ u':person_pouting_medium-dark_skin_tone:': u'\U0001F64E\U0001F3FE',
+ u':person_pouting_medium-light_skin_tone:': u'\U0001F64E\U0001F3FC',
+ u':person_pouting_medium_skin_tone:': u'\U0001F64E\U0001F3FD',
+ u':person_raising_hand:': u'\U0001F64B',
+ u':person_raising_hand_dark_skin_tone:': u'\U0001F64B\U0001F3FF',
+ u':person_raising_hand_light_skin_tone:': u'\U0001F64B\U0001F3FB',
+ u':person_raising_hand_medium-dark_skin_tone:': u'\U0001F64B\U0001F3FE',
+ u':person_raising_hand_medium-light_skin_tone:': u'\U0001F64B\U0001F3FC',
+ u':person_raising_hand_medium_skin_tone:': u'\U0001F64B\U0001F3FD',
+ u':person_rowing_boat:': u'\U0001F6A3',
+ u':person_rowing_boat_dark_skin_tone:': u'\U0001F6A3\U0001F3FF',
+ u':person_rowing_boat_light_skin_tone:': u'\U0001F6A3\U0001F3FB',
+ u':person_rowing_boat_medium-dark_skin_tone:': u'\U0001F6A3\U0001F3FE',
+ u':person_rowing_boat_medium-light_skin_tone:': u'\U0001F6A3\U0001F3FC',
+ u':person_rowing_boat_medium_skin_tone:': u'\U0001F6A3\U0001F3FD',
+ u':person_running:': u'\U0001F3C3',
+ u':person_running_dark_skin_tone:': u'\U0001F3C3\U0001F3FF',
+ u':person_running_light_skin_tone:': u'\U0001F3C3\U0001F3FB',
+ u':person_running_medium-dark_skin_tone:': u'\U0001F3C3\U0001F3FE',
+ u':person_running_medium-light_skin_tone:': u'\U0001F3C3\U0001F3FC',
+ u':person_running_medium_skin_tone:': u'\U0001F3C3\U0001F3FD',
+ u':person_shrugging:': u'\U0001F937',
+ u':person_shrugging_dark_skin_tone:': u'\U0001F937\U0001F3FF',
+ u':person_shrugging_light_skin_tone:': u'\U0001F937\U0001F3FB',
+ u':person_shrugging_medium-dark_skin_tone:': u'\U0001F937\U0001F3FE',
+ u':person_shrugging_medium-light_skin_tone:': u'\U0001F937\U0001F3FC',
+ u':person_shrugging_medium_skin_tone:': u'\U0001F937\U0001F3FD',
+ u':person_surfing:': u'\U0001F3C4',
+ u':person_surfing_dark_skin_tone:': u'\U0001F3C4\U0001F3FF',
+ u':person_surfing_light_skin_tone:': u'\U0001F3C4\U0001F3FB',
+ u':person_surfing_medium-dark_skin_tone:': u'\U0001F3C4\U0001F3FE',
+ u':person_surfing_medium-light_skin_tone:': u'\U0001F3C4\U0001F3FC',
+ u':person_surfing_medium_skin_tone:': u'\U0001F3C4\U0001F3FD',
+ u':person_swimming:': u'\U0001F3CA',
+ u':person_swimming_dark_skin_tone:': u'\U0001F3CA\U0001F3FF',
+ u':person_swimming_light_skin_tone:': u'\U0001F3CA\U0001F3FB',
+ u':person_swimming_medium-dark_skin_tone:': u'\U0001F3CA\U0001F3FE',
+ u':person_swimming_medium-light_skin_tone:': u'\U0001F3CA\U0001F3FC',
+ u':person_swimming_medium_skin_tone:': u'\U0001F3CA\U0001F3FD',
+ u':person_taking_bath:': u'\U0001F6C0',
+ u':person_taking_bath_dark_skin_tone:': u'\U0001F6C0\U0001F3FF',
+ u':person_taking_bath_light_skin_tone:': u'\U0001F6C0\U0001F3FB',
+ u':person_taking_bath_medium-dark_skin_tone:': u'\U0001F6C0\U0001F3FE',
+ u':person_taking_bath_medium-light_skin_tone:': u'\U0001F6C0\U0001F3FC',
+ u':person_taking_bath_medium_skin_tone:': u'\U0001F6C0\U0001F3FD',
+ u':person_tipping_hand:': u'\U0001F481',
+ u':person_tipping_hand_dark_skin_tone:': u'\U0001F481\U0001F3FF',
+ u':person_tipping_hand_light_skin_tone:': u'\U0001F481\U0001F3FB',
+ u':person_tipping_hand_medium-dark_skin_tone:': u'\U0001F481\U0001F3FE',
+ u':person_tipping_hand_medium-light_skin_tone:': u'\U0001F481\U0001F3FC',
+ u':person_tipping_hand_medium_skin_tone:': u'\U0001F481\U0001F3FD',
+ u':person_walking:': u'\U0001F6B6',
+ u':person_walking_dark_skin_tone:': u'\U0001F6B6\U0001F3FF',
+ u':person_walking_light_skin_tone:': u'\U0001F6B6\U0001F3FB',
+ u':person_walking_medium-dark_skin_tone:': u'\U0001F6B6\U0001F3FE',
+ u':person_walking_medium-light_skin_tone:': u'\U0001F6B6\U0001F3FC',
+ u':person_walking_medium_skin_tone:': u'\U0001F6B6\U0001F3FD',
+ u':person_wearing_turban:': u'\U0001F473',
+ u':person_wearing_turban_dark_skin_tone:': u'\U0001F473\U0001F3FF',
+ u':person_wearing_turban_light_skin_tone:': u'\U0001F473\U0001F3FB',
+ u':person_wearing_turban_medium-dark_skin_tone:': u'\U0001F473\U0001F3FE',
+ u':person_wearing_turban_medium-light_skin_tone:': u'\U0001F473\U0001F3FC',
+ u':person_wearing_turban_medium_skin_tone:': u'\U0001F473\U0001F3FD',
+ u':pick:': u'\U000026CF',
+ u':pie:': u'\U0001F967',
+ u':pig:': u'\U0001F416',
+ u':pig_face:': u'\U0001F437',
+ u':pig_nose:': u'\U0001F43D',
+ u':pile_of_poo:': u'\U0001F4A9',
+ u':pill:': u'\U0001F48A',
+ u':pine_decoration:': u'\U0001F38D',
+ u':pineapple:': u'\U0001F34D',
+ u':ping_pong:': u'\U0001F3D3',
+ u':pistol:': u'\U0001F52B',
+ u':pizza:': u'\U0001F355',
+ u':place_of_worship:': u'\U0001F6D0',
+ u':play_button:': u'\U000025B6',
+ u':play_or_pause_button:': u'\U000023EF',
+ u':police_car:': u'\U0001F693',
+ u':police_car_light:': u'\U0001F6A8',
+ u':police_officer:': u'\U0001F46E',
+ u':police_officer_dark_skin_tone:': u'\U0001F46E\U0001F3FF',
+ u':police_officer_light_skin_tone:': u'\U0001F46E\U0001F3FB',
+ u':police_officer_medium-dark_skin_tone:': u'\U0001F46E\U0001F3FE',
+ u':police_officer_medium-light_skin_tone:': u'\U0001F46E\U0001F3FC',
+ u':police_officer_medium_skin_tone:': u'\U0001F46E\U0001F3FD',
+ u':poodle:': u'\U0001F429',
+ u':pool_8_ball:': u'\U0001F3B1',
+ u':popcorn:': u'\U0001F37F',
+ u':post_office:': u'\U0001F3E4',
+ u':postal_horn:': u'\U0001F4EF',
+ u':postbox:': u'\U0001F4EE',
+ u':pot_of_food:': u'\U0001F372',
+ u':potable_water:': u'\U0001F6B0',
+ u':potato:': u'\U0001F954',
+ u':poultry_leg:': u'\U0001F357',
+ u':pound_banknote:': u'\U0001F4B7',
+ u':pouting_cat_face:': u'\U0001F63E',
+ u':pouting_face:': u'\U0001F621',
+ u':prayer_beads:': u'\U0001F4FF',
+ u':pregnant_woman:': u'\U0001F930',
+ u':pregnant_woman_dark_skin_tone:': u'\U0001F930\U0001F3FF',
+ u':pregnant_woman_light_skin_tone:': u'\U0001F930\U0001F3FB',
+ u':pregnant_woman_medium-dark_skin_tone:': u'\U0001F930\U0001F3FE',
+ u':pregnant_woman_medium-light_skin_tone:': u'\U0001F930\U0001F3FC',
+ u':pregnant_woman_medium_skin_tone:': u'\U0001F930\U0001F3FD',
+ u':pretzel:': u'\U0001F968',
+ u':prince:': u'\U0001F934',
+ u':prince_dark_skin_tone:': u'\U0001F934\U0001F3FF',
+ u':prince_light_skin_tone:': u'\U0001F934\U0001F3FB',
+ u':prince_medium-dark_skin_tone:': u'\U0001F934\U0001F3FE',
+ u':prince_medium-light_skin_tone:': u'\U0001F934\U0001F3FC',
+ u':prince_medium_skin_tone:': u'\U0001F934\U0001F3FD',
+ u':princess:': u'\U0001F478',
+ u':princess_dark_skin_tone:': u'\U0001F478\U0001F3FF',
+ u':princess_light_skin_tone:': u'\U0001F478\U0001F3FB',
+ u':princess_medium-dark_skin_tone:': u'\U0001F478\U0001F3FE',
+ u':princess_medium-light_skin_tone:': u'\U0001F478\U0001F3FC',
+ u':princess_medium_skin_tone:': u'\U0001F478\U0001F3FD',
+ u':printer:': u'\U0001F5A8',
+ u':prohibited:': u'\U0001F6AB',
+ u':purple_heart:': u'\U0001F49C',
+ u':purse:': u'\U0001F45B',
+ u':pushpin:': u'\U0001F4CC',
+ u':question_mark:': u'\U00002753',
+ u':rabbit:': u'\U0001F407',
+ u':rabbit_face:': u'\U0001F430',
+ u':racing_car:': u'\U0001F3CE',
+ u':radio:': u'\U0001F4FB',
+ u':radio_button:': u'\U0001F518',
+ u':radioactive:': u'\U00002622',
+ u':railway_car:': u'\U0001F683',
+ u':railway_track:': u'\U0001F6E4',
+ u':rainbow:': u'\U0001F308',
+ u':rainbow_flag:': u'\U0001F3F3\U0000FE0F\U0000200D\U0001F308',
+ u':raised_back_of_hand:': u'\U0001F91A',
+ u':raised_back_of_hand_dark_skin_tone:': u'\U0001F91A\U0001F3FF',
+ u':raised_back_of_hand_light_skin_tone:': u'\U0001F91A\U0001F3FB',
+ u':raised_back_of_hand_medium-dark_skin_tone:': u'\U0001F91A\U0001F3FE',
+ u':raised_back_of_hand_medium-light_skin_tone:': u'\U0001F91A\U0001F3FC',
+ u':raised_back_of_hand_medium_skin_tone:': u'\U0001F91A\U0001F3FD',
+ u':raised_fist:': u'\U0000270A',
+ u':raised_fist_dark_skin_tone:': u'\U0000270A\U0001F3FF',
+ u':raised_fist_light_skin_tone:': u'\U0000270A\U0001F3FB',
+ u':raised_fist_medium-dark_skin_tone:': u'\U0000270A\U0001F3FE',
+ u':raised_fist_medium-light_skin_tone:': u'\U0000270A\U0001F3FC',
+ u':raised_fist_medium_skin_tone:': u'\U0000270A\U0001F3FD',
+ u':raised_hand:': u'\U0000270B',
+ u':raised_hand_dark_skin_tone:': u'\U0000270B\U0001F3FF',
+ u':raised_hand_light_skin_tone:': u'\U0000270B\U0001F3FB',
+ u':raised_hand_medium-dark_skin_tone:': u'\U0000270B\U0001F3FE',
+ u':raised_hand_medium-light_skin_tone:': u'\U0000270B\U0001F3FC',
+ u':raised_hand_medium_skin_tone:': u'\U0000270B\U0001F3FD',
+ u':raising_hands:': u'\U0001F64C',
+ u':raising_hands_dark_skin_tone:': u'\U0001F64C\U0001F3FF',
+ u':raising_hands_light_skin_tone:': u'\U0001F64C\U0001F3FB',
+ u':raising_hands_medium-dark_skin_tone:': u'\U0001F64C\U0001F3FE',
+ u':raising_hands_medium-light_skin_tone:': u'\U0001F64C\U0001F3FC',
+ u':raising_hands_medium_skin_tone:': u'\U0001F64C\U0001F3FD',
+ u':ram:': u'\U0001F40F',
+ u':rat:': u'\U0001F400',
+ u':record_button:': u'\U000023FA',
+ u':recycling_symbol:': u'\U0000267B',
+ u':red_apple:': u'\U0001F34E',
+ u':red_circle:': u'\U0001F534',
+ u':red_heart:': u'\U00002764',
+ u':red_paper_lantern:': u'\U0001F3EE',
+ u':red_triangle_pointed_down:': u'\U0001F53B',
+ u':red_triangle_pointed_up:': u'\U0001F53A',
+ u':registered:': u'\U000000AE',
+ u':relieved_face:': u'\U0001F60C',
+ u':reminder_ribbon:': u'\U0001F397',
+ u':repeat_button:': u'\U0001F501',
+ u':repeat_single_button:': u'\U0001F502',
+ u':rescue_worker’s_helmet:': u'\U000026D1',
+ u':restroom:': u'\U0001F6BB',
+ u':reverse_button:': u'\U000025C0',
+ u':revolving_hearts:': u'\U0001F49E',
+ u':rhinoceros:': u'\U0001F98F',
+ u':ribbon:': u'\U0001F380',
+ u':rice_ball:': u'\U0001F359',
+ u':rice_cracker:': u'\U0001F358',
+ u':right-facing_fist:': u'\U0001F91C',
+ u':right-facing_fist_dark_skin_tone:': u'\U0001F91C\U0001F3FF',
+ u':right-facing_fist_light_skin_tone:': u'\U0001F91C\U0001F3FB',
+ u':right-facing_fist_medium-dark_skin_tone:': u'\U0001F91C\U0001F3FE',
+ u':right-facing_fist_medium-light_skin_tone:': u'\U0001F91C\U0001F3FC',
+ u':right-facing_fist_medium_skin_tone:': u'\U0001F91C\U0001F3FD',
+ u':right_anger_bubble:': u'\U0001F5EF',
+ u':right_arrow:': u'\U000027A1',
+ u':right_arrow_curving_down:': u'\U00002935',
+ u':right_arrow_curving_left:': u'\U000021A9',
+ u':right_arrow_curving_up:': u'\U00002934',
+ u':ring:': u'\U0001F48D',
+ u':roasted_sweet_potato:': u'\U0001F360',
+ u':robot_face:': u'\U0001F916',
+ u':rocket:': u'\U0001F680',
+ u':rolled-up_newspaper:': u'\U0001F5DE',
+ u':roller_coaster:': u'\U0001F3A2',
+ u':rolling_on_the_floor_laughing:': u'\U0001F923',
+ u':rooster:': u'\U0001F413',
+ u':rose:': u'\U0001F339',
+ u':rosette:': u'\U0001F3F5',
+ u':round_pushpin:': u'\U0001F4CD',
+ u':rugby_football:': u'\U0001F3C9',
+ u':running_shirt:': u'\U0001F3BD',
+ u':running_shoe:': u'\U0001F45F',
+ u':sad_but_relieved_face:': u'\U0001F625',
+ u':sailboat:': u'\U000026F5',
+ u':sake:': u'\U0001F376',
+ u':sandwich:': u'\U0001F96A',
+ u':satellite:': u'\U0001F6F0',
+ u':satellite_antenna:': u'\U0001F4E1',
+ u':sauropod:': u'\U0001F995',
+ u':saxophone:': u'\U0001F3B7',
+ u':scarf:': u'\U0001F9E3',
+ u':school:': u'\U0001F3EB',
+ u':school_backpack:': u'\U0001F392',
+ u':scissors:': u'\U00002702',
+ u':scorpion:': u'\U0001F982',
+ u':scroll:': u'\U0001F4DC',
+ u':seat:': u'\U0001F4BA',
+ u':see-no-evil_monkey:': u'\U0001F648',
+ u':seedling:': u'\U0001F331',
+ u':selfie:': u'\U0001F933',
+ u':selfie_dark_skin_tone:': u'\U0001F933\U0001F3FF',
+ u':selfie_light_skin_tone:': u'\U0001F933\U0001F3FB',
+ u':selfie_medium-dark_skin_tone:': u'\U0001F933\U0001F3FE',
+ u':selfie_medium-light_skin_tone:': u'\U0001F933\U0001F3FC',
+ u':selfie_medium_skin_tone:': u'\U0001F933\U0001F3FD',
+ u':seven-thirty:': u'\U0001F562',
+ u':seven_o’clock:': u'\U0001F556',
+ u':shallow_pan_of_food:': u'\U0001F958',
+ u':shamrock:': u'\U00002618',
+ u':shark:': u'\U0001F988',
+ u':shaved_ice:': u'\U0001F367',
+ u':sheaf_of_rice:': u'\U0001F33E',
+ u':shield:': u'\U0001F6E1',
+ u':shinto_shrine:': u'\U000026E9',
+ u':ship:': u'\U0001F6A2',
+ u':shooting_star:': u'\U0001F320',
+ u':shopping_bags:': u'\U0001F6CD',
+ u':shopping_cart:': u'\U0001F6D2',
+ u':shortcake:': u'\U0001F370',
+ u':shower:': u'\U0001F6BF',
+ u':shrimp:': u'\U0001F990',
+ u':shuffle_tracks_button:': u'\U0001F500',
+ u':shushing_face:': u'\U0001F92B',
+ u':sign_of_the_horns:': u'\U0001F918',
+ u':sign_of_the_horns_dark_skin_tone:': u'\U0001F918\U0001F3FF',
+ u':sign_of_the_horns_light_skin_tone:': u'\U0001F918\U0001F3FB',
+ u':sign_of_the_horns_medium-dark_skin_tone:': u'\U0001F918\U0001F3FE',
+ u':sign_of_the_horns_medium-light_skin_tone:': u'\U0001F918\U0001F3FC',
+ u':sign_of_the_horns_medium_skin_tone:': u'\U0001F918\U0001F3FD',
+ u':six-thirty:': u'\U0001F561',
+ u':six_o’clock:': u'\U0001F555',
+ u':skier:': u'\U000026F7',
+ u':skis:': u'\U0001F3BF',
+ u':skull:': u'\U0001F480',
+ u':skull_and_crossbones:': u'\U00002620',
+ u':sled:': u'\U0001F6F7',
+ u':sleeping_face:': u'\U0001F634',
+ u':sleepy_face:': u'\U0001F62A',
+ u':slightly_frowning_face:': u'\U0001F641',
+ u':slightly_smiling_face:': u'\U0001F642',
+ u':slot_machine:': u'\U0001F3B0',
+ u':small_airplane:': u'\U0001F6E9',
+ u':small_blue_diamond:': u'\U0001F539',
+ u':small_orange_diamond:': u'\U0001F538',
+ u':smiling_cat_face_with_heart-eyes:': u'\U0001F63B',
+ u':smiling_face:': u'\U0000263A',
+ u':smiling_face_with_halo:': u'\U0001F607',
+ u':smiling_face_with_heart-eyes:': u'\U0001F60D',
+ u':smiling_face_with_horns:': u'\U0001F608',
+ u':smiling_face_with_smiling_eyes:': u'\U0001F60A',
+ u':smiling_face_with_sunglasses:': u'\U0001F60E',
+ u':smirking_face:': u'\U0001F60F',
+ u':snail:': u'\U0001F40C',
+ u':snake:': u'\U0001F40D',
+ u':sneezing_face:': u'\U0001F927',
+ u':snow-capped_mountain:': u'\U0001F3D4',
+ u':snowboarder:': u'\U0001F3C2',
+ u':snowboarder_dark_skin_tone:': u'\U0001F3C2\U0001F3FF',
+ u':snowboarder_light_skin_tone:': u'\U0001F3C2\U0001F3FB',
+ u':snowboarder_medium-dark_skin_tone:': u'\U0001F3C2\U0001F3FE',
+ u':snowboarder_medium-light_skin_tone:': u'\U0001F3C2\U0001F3FC',
+ u':snowboarder_medium_skin_tone:': u'\U0001F3C2\U0001F3FD',
+ u':snowflake:': u'\U00002744',
+ u':snowman:': u'\U00002603',
+ u':snowman_without_snow:': u'\U000026C4',
+ u':soccer_ball:': u'\U000026BD',
+ u':socks:': u'\U0001F9E6',
+ u':soft_ice_cream:': u'\U0001F366',
+ u':spade_suit:': u'\U00002660',
+ u':spaghetti:': u'\U0001F35D',
+ u':sparkle:': u'\U00002747',
+ u':sparkler:': u'\U0001F387',
+ u':sparkles:': u'\U00002728',
+ u':sparkling_heart:': u'\U0001F496',
+ u':speak-no-evil_monkey:': u'\U0001F64A',
+ u':speaker_high_volume:': u'\U0001F50A',
+ u':speaker_low_volume:': u'\U0001F508',
+ u':speaker_medium_volume:': u'\U0001F509',
+ u':speaking_head:': u'\U0001F5E3',
+ u':speech_balloon:': u'\U0001F4AC',
+ u':speedboat:': u'\U0001F6A4',
+ u':spider:': u'\U0001F577',
+ u':spider_web:': u'\U0001F578',
+ u':spiral_calendar:': u'\U0001F5D3',
+ u':spiral_notepad:': u'\U0001F5D2',
+ u':spiral_shell:': u'\U0001F41A',
+ u':spoon:': u'\U0001F944',
+ u':sport_utility_vehicle:': u'\U0001F699',
+ u':sports_medal:': u'\U0001F3C5',
+ u':spouting_whale:': u'\U0001F433',
+ u':squid:': u'\U0001F991',
+ u':squinting_face_with_tongue:': u'\U0001F61D',
+ u':stadium:': u'\U0001F3DF',
+ u':star-struck:': u'\U0001F929',
+ u':star_and_crescent:': u'\U0000262A',
+ u':star_of_David:': u'\U00002721',
+ u':station:': u'\U0001F689',
+ u':steaming_bowl:': u'\U0001F35C',
+ u':stop_button:': u'\U000023F9',
+ u':stop_sign:': u'\U0001F6D1',
+ u':stopwatch:': u'\U000023F1',
+ u':straight_ruler:': u'\U0001F4CF',
+ u':strawberry:': u'\U0001F353',
+ u':studio_microphone:': u'\U0001F399',
+ u':stuffed_flatbread:': u'\U0001F959',
+ u':sun:': u'\U00002600',
+ u':sun_behind_cloud:': u'\U000026C5',
+ u':sun_behind_large_cloud:': u'\U0001F325',
+ u':sun_behind_rain_cloud:': u'\U0001F326',
+ u':sun_behind_small_cloud:': u'\U0001F324',
+ u':sun_with_face:': u'\U0001F31E',
+ u':sunflower:': u'\U0001F33B',
+ u':sunglasses:': u'\U0001F576',
+ u':sunrise:': u'\U0001F305',
+ u':sunrise_over_mountains:': u'\U0001F304',
+ u':sunset:': u'\U0001F307',
+ u':sushi:': u'\U0001F363',
+ u':suspension_railway:': u'\U0001F69F',
+ u':sweat_droplets:': u'\U0001F4A6',
+ u':synagogue:': u'\U0001F54D',
+ u':syringe:': u'\U0001F489',
+ u':t-shirt:': u'\U0001F455',
+ u':taco:': u'\U0001F32E',
+ u':takeout_box:': u'\U0001F961',
+ u':tanabata_tree:': u'\U0001F38B',
+ u':tangerine:': u'\U0001F34A',
+ u':taxi:': u'\U0001F695',
+ u':teacup_without_handle:': u'\U0001F375',
+ u':tear-off_calendar:': u'\U0001F4C6',
+ u':telephone:': u'\U0000260E',
+ u':telephone_receiver:': u'\U0001F4DE',
+ u':telescope:': u'\U0001F52D',
+ u':television:': u'\U0001F4FA',
+ u':ten-thirty:': u'\U0001F565',
+ u':ten_o’clock:': u'\U0001F559',
+ u':tennis:': u'\U0001F3BE',
+ u':tent:': u'\U000026FA',
+ u':thermometer:': u'\U0001F321',
+ u':thinking_face:': u'\U0001F914',
+ u':thought_balloon:': u'\U0001F4AD',
+ u':three-thirty:': u'\U0001F55E',
+ u':three_o’clock:': u'\U0001F552',
+ u':thumbs_down:': u'\U0001F44E',
+ u':thumbs_down_dark_skin_tone:': u'\U0001F44E\U0001F3FF',
+ u':thumbs_down_light_skin_tone:': u'\U0001F44E\U0001F3FB',
+ u':thumbs_down_medium-dark_skin_tone:': u'\U0001F44E\U0001F3FE',
+ u':thumbs_down_medium-light_skin_tone:': u'\U0001F44E\U0001F3FC',
+ u':thumbs_down_medium_skin_tone:': u'\U0001F44E\U0001F3FD',
+ u':thumbs_up:': u'\U0001F44D',
+ u':thumbs_up_dark_skin_tone:': u'\U0001F44D\U0001F3FF',
+ u':thumbs_up_light_skin_tone:': u'\U0001F44D\U0001F3FB',
+ u':thumbs_up_medium-dark_skin_tone:': u'\U0001F44D\U0001F3FE',
+ u':thumbs_up_medium-light_skin_tone:': u'\U0001F44D\U0001F3FC',
+ u':thumbs_up_medium_skin_tone:': u'\U0001F44D\U0001F3FD',
+ u':ticket:': u'\U0001F3AB',
+ u':tiger:': u'\U0001F405',
+ u':tiger_face:': u'\U0001F42F',
+ u':timer_clock:': u'\U000023F2',
+ u':tired_face:': u'\U0001F62B',
+ u':toilet:': u'\U0001F6BD',
+ u':tomato:': u'\U0001F345',
+ u':tongue:': u'\U0001F445',
+ u':top_hat:': u'\U0001F3A9',
+ u':tornado:': u'\U0001F32A',
+ u':trackball:': u'\U0001F5B2',
+ u':tractor:': u'\U0001F69C',
+ u':trade_mark:': u'\U00002122',
+ u':train:': u'\U0001F686',
+ u':tram:': u'\U0001F68A',
+ u':tram_car:': u'\U0001F68B',
+ u':triangular_flag:': u'\U0001F6A9',
+ u':triangular_ruler:': u'\U0001F4D0',
+ u':trident_emblem:': u'\U0001F531',
+ u':trolleybus:': u'\U0001F68E',
+ u':trophy:': u'\U0001F3C6',
+ u':tropical_drink:': u'\U0001F379',
+ u':tropical_fish:': u'\U0001F420',
+ u':trumpet:': u'\U0001F3BA',
+ u':tulip:': u'\U0001F337',
+ u':tumbler_glass:': u'\U0001F943',
+ u':turkey:': u'\U0001F983',
+ u':turtle:': u'\U0001F422',
+ u':twelve-thirty:': u'\U0001F567',
+ u':twelve_o’clock:': u'\U0001F55B',
+ u':two-hump_camel:': u'\U0001F42B',
+ u':two-thirty:': u'\U0001F55D',
+ u':two_hearts:': u'\U0001F495',
+ u':two_men_holding_hands:': u'\U0001F46C',
+ u':two_o’clock:': u'\U0001F551',
+ u':two_women_holding_hands:': u'\U0001F46D',
+ u':umbrella:': u'\U00002602',
+ u':umbrella_on_ground:': u'\U000026F1',
+ u':umbrella_with_rain_drops:': u'\U00002614',
+ u':unamused_face:': u'\U0001F612',
+ u':unicorn_face:': u'\U0001F984',
+ u':unlocked:': u'\U0001F513',
+ u':up-down_arrow:': u'\U00002195',
+ u':up-left_arrow:': u'\U00002196',
+ u':up-right_arrow:': u'\U00002197',
+ u':up_arrow:': u'\U00002B06',
+ u':upside-down_face:': u'\U0001F643',
+ u':upwards_button:': u'\U0001F53C',
+ u':vampire:': u'\U0001F9DB',
+ u':vampire_dark_skin_tone:': u'\U0001F9DB\U0001F3FF',
+ u':vampire_light_skin_tone:': u'\U0001F9DB\U0001F3FB',
+ u':vampire_medium-dark_skin_tone:': u'\U0001F9DB\U0001F3FE',
+ u':vampire_medium-light_skin_tone:': u'\U0001F9DB\U0001F3FC',
+ u':vampire_medium_skin_tone:': u'\U0001F9DB\U0001F3FD',
+ u':vertical_traffic_light:': u'\U0001F6A6',
+ u':vibration_mode:': u'\U0001F4F3',
+ u':victory_hand:': u'\U0000270C',
+ u':victory_hand_dark_skin_tone:': u'\U0000270C\U0001F3FF',
+ u':victory_hand_light_skin_tone:': u'\U0000270C\U0001F3FB',
+ u':victory_hand_medium-dark_skin_tone:': u'\U0000270C\U0001F3FE',
+ u':victory_hand_medium-light_skin_tone:': u'\U0000270C\U0001F3FC',
+ u':victory_hand_medium_skin_tone:': u'\U0000270C\U0001F3FD',
+ u':video_camera:': u'\U0001F4F9',
+ u':video_game:': u'\U0001F3AE',
+ u':videocassette:': u'\U0001F4FC',
+ u':violin:': u'\U0001F3BB',
+ u':volcano:': u'\U0001F30B',
+ u':volleyball:': u'\U0001F3D0',
+ u':vulcan_salute:': u'\U0001F596',
+ u':vulcan_salute_dark_skin_tone:': u'\U0001F596\U0001F3FF',
+ u':vulcan_salute_light_skin_tone:': u'\U0001F596\U0001F3FB',
+ u':vulcan_salute_medium-dark_skin_tone:': u'\U0001F596\U0001F3FE',
+ u':vulcan_salute_medium-light_skin_tone:': u'\U0001F596\U0001F3FC',
+ u':vulcan_salute_medium_skin_tone:': u'\U0001F596\U0001F3FD',
+ u':waning_crescent_moon:': u'\U0001F318',
+ u':waning_gibbous_moon:': u'\U0001F316',
+ u':warning:': u'\U000026A0',
+ u':wastebasket:': u'\U0001F5D1',
+ u':watch:': u'\U0000231A',
+ u':water_buffalo:': u'\U0001F403',
+ u':water_closet:': u'\U0001F6BE',
+ u':water_wave:': u'\U0001F30A',
+ u':watermelon:': u'\U0001F349',
+ u':waving_hand:': u'\U0001F44B',
+ u':waving_hand_dark_skin_tone:': u'\U0001F44B\U0001F3FF',
+ u':waving_hand_light_skin_tone:': u'\U0001F44B\U0001F3FB',
+ u':waving_hand_medium-dark_skin_tone:': u'\U0001F44B\U0001F3FE',
+ u':waving_hand_medium-light_skin_tone:': u'\U0001F44B\U0001F3FC',
+ u':waving_hand_medium_skin_tone:': u'\U0001F44B\U0001F3FD',
+ u':wavy_dash:': u'\U00003030',
+ u':waxing_crescent_moon:': u'\U0001F312',
+ u':waxing_gibbous_moon:': u'\U0001F314',
+ u':weary_cat_face:': u'\U0001F640',
+ u':weary_face:': u'\U0001F629',
+ u':wedding:': u'\U0001F492',
+ u':whale:': u'\U0001F40B',
+ u':wheel_of_dharma:': u'\U00002638',
+ u':wheelchair_symbol:': u'\U0000267F',
+ u':white_circle:': u'\U000026AA',
+ u':white_exclamation_mark:': u'\U00002755',
+ u':white_flag:': u'\U0001F3F3',
+ u':white_flower:': u'\U0001F4AE',
+ u':white_heavy_check_mark:': u'\U00002705',
+ u':white_large_square:': u'\U00002B1C',
+ u':white_medium-small_square:': u'\U000025FD',
+ u':white_medium_square:': u'\U000025FB',
+ u':white_medium_star:': u'\U00002B50',
+ u':white_question_mark:': u'\U00002754',
+ u':white_small_square:': u'\U000025AB',
+ u':white_square_button:': u'\U0001F533',
+ u':wilted_flower:': u'\U0001F940',
+ u':wind_chime:': u'\U0001F390',
+ u':wind_face:': u'\U0001F32C',
+ u':wine_glass:': u'\U0001F377',
+ u':winking_face:': u'\U0001F609',
+ u':winking_face_with_tongue:': u'\U0001F61C',
+ u':wolf_face:': u'\U0001F43A',
+ u':woman:': u'\U0001F469',
+ u':woman_artist:': u'\U0001F469\U0000200D\U0001F3A8',
+ u':woman_artist_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F3A8',
+ u':woman_artist_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F3A8',
+ u':woman_artist_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F3A8',
+ u':woman_artist_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F3A8',
+ u':woman_artist_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F3A8',
+ u':woman_astronaut:': u'\U0001F469\U0000200D\U0001F680',
+ u':woman_astronaut_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F680',
+ u':woman_astronaut_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F680',
+ u':woman_astronaut_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F680',
+ u':woman_astronaut_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F680',
+ u':woman_astronaut_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F680',
+ u':woman_biking:': u'\U0001F6B4\U0000200D\U00002640\U0000FE0F',
+ u':woman_biking_dark_skin_tone:': u'\U0001F6B4\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_biking_light_skin_tone:': u'\U0001F6B4\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_biking_medium-dark_skin_tone:': u'\U0001F6B4\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_biking_medium-light_skin_tone:': u'\U0001F6B4\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_biking_medium_skin_tone:': u'\U0001F6B4\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball:': u'\U000026F9\U0000FE0F\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball_dark_skin_tone:': u'\U000026F9\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball_light_skin_tone:': u'\U000026F9\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball_medium-dark_skin_tone:': u'\U000026F9\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball_medium-light_skin_tone:': u'\U000026F9\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_bouncing_ball_medium_skin_tone:': u'\U000026F9\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing:': u'\U0001F647\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing_dark_skin_tone:': u'\U0001F647\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing_light_skin_tone:': u'\U0001F647\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing_medium-dark_skin_tone:': u'\U0001F647\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing_medium-light_skin_tone:': u'\U0001F647\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_bowing_medium_skin_tone:': u'\U0001F647\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling:': u'\U0001F938\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling_dark_skin_tone:': u'\U0001F938\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling_light_skin_tone:': u'\U0001F938\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling_medium-dark_skin_tone:': u'\U0001F938\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling_medium-light_skin_tone:': u'\U0001F938\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_cartwheeling_medium_skin_tone:': u'\U0001F938\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing:': u'\U0001F9D7\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing_dark_skin_tone:': u'\U0001F9D7\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing_light_skin_tone:': u'\U0001F9D7\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing_medium-dark_skin_tone:': u'\U0001F9D7\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing_medium-light_skin_tone:': u'\U0001F9D7\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_climbing_medium_skin_tone:': u'\U0001F9D7\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker:': u'\U0001F477\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker_dark_skin_tone:': u'\U0001F477\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker_light_skin_tone:': u'\U0001F477\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker_medium-dark_skin_tone:': u'\U0001F477\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker_medium-light_skin_tone:': u'\U0001F477\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_construction_worker_medium_skin_tone:': u'\U0001F477\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_cook:': u'\U0001F469\U0000200D\U0001F373',
+ u':woman_cook_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F373',
+ u':woman_cook_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F373',
+ u':woman_cook_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F373',
+ u':woman_cook_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F373',
+ u':woman_cook_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F373',
+ u':woman_dancing:': u'\U0001F483',
+ u':woman_dancing_dark_skin_tone:': u'\U0001F483\U0001F3FF',
+ u':woman_dancing_light_skin_tone:': u'\U0001F483\U0001F3FB',
+ u':woman_dancing_medium-dark_skin_tone:': u'\U0001F483\U0001F3FE',
+ u':woman_dancing_medium-light_skin_tone:': u'\U0001F483\U0001F3FC',
+ u':woman_dancing_medium_skin_tone:': u'\U0001F483\U0001F3FD',
+ u':woman_dark_skin_tone:': u'\U0001F469\U0001F3FF',
+ u':woman_detective:': u'\U0001F575\U0000FE0F\U0000200D\U00002640\U0000FE0F',
+ u':woman_detective_dark_skin_tone:': u'\U0001F575\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_detective_light_skin_tone:': u'\U0001F575\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_detective_medium-dark_skin_tone:': u'\U0001F575\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_detective_medium-light_skin_tone:': u'\U0001F575\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_detective_medium_skin_tone:': u'\U0001F575\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf:': u'\U0001F9DD\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf_dark_skin_tone:': u'\U0001F9DD\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf_light_skin_tone:': u'\U0001F9DD\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf_medium-dark_skin_tone:': u'\U0001F9DD\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf_medium-light_skin_tone:': u'\U0001F9DD\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_elf_medium_skin_tone:': u'\U0001F9DD\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming:': u'\U0001F926\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming_dark_skin_tone:': u'\U0001F926\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming_light_skin_tone:': u'\U0001F926\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming_medium-dark_skin_tone:': u'\U0001F926\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming_medium-light_skin_tone:': u'\U0001F926\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_facepalming_medium_skin_tone:': u'\U0001F926\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_factory_worker:': u'\U0001F469\U0000200D\U0001F3ED',
+ u':woman_factory_worker_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F3ED',
+ u':woman_factory_worker_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F3ED',
+ u':woman_factory_worker_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F3ED',
+ u':woman_factory_worker_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F3ED',
+ u':woman_factory_worker_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F3ED',
+ u':woman_fairy:': u'\U0001F9DA\U0000200D\U00002640\U0000FE0F',
+ u':woman_fairy_dark_skin_tone:': u'\U0001F9DA\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_fairy_light_skin_tone:': u'\U0001F9DA\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_fairy_medium-dark_skin_tone:': u'\U0001F9DA\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_fairy_medium-light_skin_tone:': u'\U0001F9DA\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_fairy_medium_skin_tone:': u'\U0001F9DA\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_farmer:': u'\U0001F469\U0000200D\U0001F33E',
+ u':woman_farmer_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F33E',
+ u':woman_farmer_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F33E',
+ u':woman_farmer_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F33E',
+ u':woman_farmer_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F33E',
+ u':woman_farmer_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F33E',
+ u':woman_firefighter:': u'\U0001F469\U0000200D\U0001F692',
+ u':woman_firefighter_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F692',
+ u':woman_firefighter_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F692',
+ u':woman_firefighter_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F692',
+ u':woman_firefighter_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F692',
+ u':woman_firefighter_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F692',
+ u':woman_frowning:': u'\U0001F64D\U0000200D\U00002640\U0000FE0F',
+ u':woman_frowning_dark_skin_tone:': u'\U0001F64D\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_frowning_light_skin_tone:': u'\U0001F64D\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_frowning_medium-dark_skin_tone:': u'\U0001F64D\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_frowning_medium-light_skin_tone:': u'\U0001F64D\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_frowning_medium_skin_tone:': u'\U0001F64D\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_genie:': u'\U0001F9DE\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO:': u'\U0001F645\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO_dark_skin_tone:': u'\U0001F645\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO_light_skin_tone:': u'\U0001F645\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO_medium-dark_skin_tone:': u'\U0001F645\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO_medium-light_skin_tone:': u'\U0001F645\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_NO_medium_skin_tone:': u'\U0001F645\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK:': u'\U0001F646\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK_dark_skin_tone:': u'\U0001F646\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK_light_skin_tone:': u'\U0001F646\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK_medium-dark_skin_tone:': u'\U0001F646\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK_medium-light_skin_tone:': u'\U0001F646\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_gesturing_OK_medium_skin_tone:': u'\U0001F646\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut:': u'\U0001F487\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut_dark_skin_tone:': u'\U0001F487\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut_light_skin_tone:': u'\U0001F487\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut_medium-dark_skin_tone:': u'\U0001F487\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut_medium-light_skin_tone:': u'\U0001F487\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_haircut_medium_skin_tone:': u'\U0001F487\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage:': u'\U0001F486\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage_dark_skin_tone:': u'\U0001F486\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage_light_skin_tone:': u'\U0001F486\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage_medium-dark_skin_tone:': u'\U0001F486\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage_medium-light_skin_tone:': u'\U0001F486\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_getting_massage_medium_skin_tone:': u'\U0001F486\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing:': u'\U0001F3CC\U0000FE0F\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing_dark_skin_tone:': u'\U0001F3CC\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing_light_skin_tone:': u'\U0001F3CC\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing_medium-dark_skin_tone:': u'\U0001F3CC\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing_medium-light_skin_tone:': u'\U0001F3CC\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_golfing_medium_skin_tone:': u'\U0001F3CC\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard:': u'\U0001F482\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard_dark_skin_tone:': u'\U0001F482\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard_light_skin_tone:': u'\U0001F482\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard_medium-dark_skin_tone:': u'\U0001F482\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard_medium-light_skin_tone:': u'\U0001F482\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_guard_medium_skin_tone:': u'\U0001F482\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_health_worker:': u'\U0001F469\U0000200D\U00002695\U0000FE0F',
+ u':woman_health_worker_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U00002695\U0000FE0F',
+ u':woman_health_worker_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U00002695\U0000FE0F',
+ u':woman_health_worker_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U00002695\U0000FE0F',
+ u':woman_health_worker_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U00002695\U0000FE0F',
+ u':woman_health_worker_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U00002695\U0000FE0F',
+ u':woman_in_lotus_position:': u'\U0001F9D8\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_lotus_position_dark_skin_tone:': u'\U0001F9D8\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_lotus_position_light_skin_tone:': u'\U0001F9D8\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_lotus_position_medium-dark_skin_tone:': u'\U0001F9D8\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_lotus_position_medium-light_skin_tone:': u'\U0001F9D8\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_lotus_position_medium_skin_tone:': u'\U0001F9D8\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room:': u'\U0001F9D6\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room_dark_skin_tone:': u'\U0001F9D6\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room_light_skin_tone:': u'\U0001F9D6\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room_medium-dark_skin_tone:': u'\U0001F9D6\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room_medium-light_skin_tone:': u'\U0001F9D6\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_in_steamy_room_medium_skin_tone:': u'\U0001F9D6\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_judge:': u'\U0001F469\U0000200D\U00002696\U0000FE0F',
+ u':woman_judge_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U00002696\U0000FE0F',
+ u':woman_judge_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U00002696\U0000FE0F',
+ u':woman_judge_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U00002696\U0000FE0F',
+ u':woman_judge_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U00002696\U0000FE0F',
+ u':woman_judge_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U00002696\U0000FE0F',
+ u':woman_juggling:': u'\U0001F939\U0000200D\U00002640\U0000FE0F',
+ u':woman_juggling_dark_skin_tone:': u'\U0001F939\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_juggling_light_skin_tone:': u'\U0001F939\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_juggling_medium-dark_skin_tone:': u'\U0001F939\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_juggling_medium-light_skin_tone:': u'\U0001F939\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_juggling_medium_skin_tone:': u'\U0001F939\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights:': u'\U0001F3CB\U0000FE0F\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights_dark_skin_tone:': u'\U0001F3CB\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights_light_skin_tone:': u'\U0001F3CB\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights_medium-dark_skin_tone:': u'\U0001F3CB\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights_medium-light_skin_tone:': u'\U0001F3CB\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_lifting_weights_medium_skin_tone:': u'\U0001F3CB\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_light_skin_tone:': u'\U0001F469\U0001F3FB',
+ u':woman_mage:': u'\U0001F9D9\U0000200D\U00002640\U0000FE0F',
+ u':woman_mage_dark_skin_tone:': u'\U0001F9D9\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_mage_light_skin_tone:': u'\U0001F9D9\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_mage_medium-dark_skin_tone:': u'\U0001F9D9\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_mage_medium-light_skin_tone:': u'\U0001F9D9\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_mage_medium_skin_tone:': u'\U0001F9D9\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_mechanic:': u'\U0001F469\U0000200D\U0001F527',
+ u':woman_mechanic_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F527',
+ u':woman_mechanic_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F527',
+ u':woman_mechanic_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F527',
+ u':woman_mechanic_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F527',
+ u':woman_mechanic_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F527',
+ u':woman_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE',
+ u':woman_medium-light_skin_tone:': u'\U0001F469\U0001F3FC',
+ u':woman_medium_skin_tone:': u'\U0001F469\U0001F3FD',
+ u':woman_mountain_biking:': u'\U0001F6B5\U0000200D\U00002640\U0000FE0F',
+ u':woman_mountain_biking_dark_skin_tone:': u'\U0001F6B5\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_mountain_biking_light_skin_tone:': u'\U0001F6B5\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_mountain_biking_medium-dark_skin_tone:': u'\U0001F6B5\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_mountain_biking_medium-light_skin_tone:': u'\U0001F6B5\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_mountain_biking_medium_skin_tone:': u'\U0001F6B5\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_office_worker:': u'\U0001F469\U0000200D\U0001F4BC',
+ u':woman_office_worker_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F4BC',
+ u':woman_office_worker_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F4BC',
+ u':woman_office_worker_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F4BC',
+ u':woman_office_worker_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F4BC',
+ u':woman_office_worker_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F4BC',
+ u':woman_pilot:': u'\U0001F469\U0000200D\U00002708\U0000FE0F',
+ u':woman_pilot_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U00002708\U0000FE0F',
+ u':woman_pilot_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U00002708\U0000FE0F',
+ u':woman_pilot_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U00002708\U0000FE0F',
+ u':woman_pilot_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U00002708\U0000FE0F',
+ u':woman_pilot_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U00002708\U0000FE0F',
+ u':woman_playing_handball:': u'\U0001F93E\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_handball_dark_skin_tone:': u'\U0001F93E\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_handball_light_skin_tone:': u'\U0001F93E\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_handball_medium-dark_skin_tone:': u'\U0001F93E\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_handball_medium-light_skin_tone:': u'\U0001F93E\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_handball_medium_skin_tone:': u'\U0001F93E\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo:': u'\U0001F93D\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo_dark_skin_tone:': u'\U0001F93D\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo_light_skin_tone:': u'\U0001F93D\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo_medium-dark_skin_tone:': u'\U0001F93D\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo_medium-light_skin_tone:': u'\U0001F93D\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_playing_water_polo_medium_skin_tone:': u'\U0001F93D\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer:': u'\U0001F46E\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer_dark_skin_tone:': u'\U0001F46E\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer_light_skin_tone:': u'\U0001F46E\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer_medium-dark_skin_tone:': u'\U0001F46E\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer_medium-light_skin_tone:': u'\U0001F46E\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_police_officer_medium_skin_tone:': u'\U0001F46E\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting:': u'\U0001F64E\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting_dark_skin_tone:': u'\U0001F64E\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting_light_skin_tone:': u'\U0001F64E\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting_medium-dark_skin_tone:': u'\U0001F64E\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting_medium-light_skin_tone:': u'\U0001F64E\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_pouting_medium_skin_tone:': u'\U0001F64E\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand:': u'\U0001F64B\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand_dark_skin_tone:': u'\U0001F64B\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand_light_skin_tone:': u'\U0001F64B\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand_medium-dark_skin_tone:': u'\U0001F64B\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand_medium-light_skin_tone:': u'\U0001F64B\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_raising_hand_medium_skin_tone:': u'\U0001F64B\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat:': u'\U0001F6A3\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat_dark_skin_tone:': u'\U0001F6A3\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat_light_skin_tone:': u'\U0001F6A3\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat_medium-dark_skin_tone:': u'\U0001F6A3\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat_medium-light_skin_tone:': u'\U0001F6A3\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_rowing_boat_medium_skin_tone:': u'\U0001F6A3\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_running:': u'\U0001F3C3\U0000200D\U00002640\U0000FE0F',
+ u':woman_running_dark_skin_tone:': u'\U0001F3C3\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_running_light_skin_tone:': u'\U0001F3C3\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_running_medium-dark_skin_tone:': u'\U0001F3C3\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_running_medium-light_skin_tone:': u'\U0001F3C3\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_running_medium_skin_tone:': u'\U0001F3C3\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_scientist:': u'\U0001F469\U0000200D\U0001F52C',
+ u':woman_scientist_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F52C',
+ u':woman_scientist_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F52C',
+ u':woman_scientist_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F52C',
+ u':woman_scientist_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F52C',
+ u':woman_scientist_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F52C',
+ u':woman_shrugging:': u'\U0001F937\U0000200D\U00002640\U0000FE0F',
+ u':woman_shrugging_dark_skin_tone:': u'\U0001F937\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_shrugging_light_skin_tone:': u'\U0001F937\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_shrugging_medium-dark_skin_tone:': u'\U0001F937\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_shrugging_medium-light_skin_tone:': u'\U0001F937\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_shrugging_medium_skin_tone:': u'\U0001F937\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_singer:': u'\U0001F469\U0000200D\U0001F3A4',
+ u':woman_singer_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F3A4',
+ u':woman_singer_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F3A4',
+ u':woman_singer_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F3A4',
+ u':woman_singer_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F3A4',
+ u':woman_singer_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F3A4',
+ u':woman_student:': u'\U0001F469\U0000200D\U0001F393',
+ u':woman_student_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F393',
+ u':woman_student_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F393',
+ u':woman_student_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F393',
+ u':woman_student_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F393',
+ u':woman_student_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F393',
+ u':woman_surfing:': u'\U0001F3C4\U0000200D\U00002640\U0000FE0F',
+ u':woman_surfing_dark_skin_tone:': u'\U0001F3C4\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_surfing_light_skin_tone:': u'\U0001F3C4\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_surfing_medium-dark_skin_tone:': u'\U0001F3C4\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_surfing_medium-light_skin_tone:': u'\U0001F3C4\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_surfing_medium_skin_tone:': u'\U0001F3C4\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming:': u'\U0001F3CA\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming_dark_skin_tone:': u'\U0001F3CA\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming_light_skin_tone:': u'\U0001F3CA\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming_medium-dark_skin_tone:': u'\U0001F3CA\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming_medium-light_skin_tone:': u'\U0001F3CA\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_swimming_medium_skin_tone:': u'\U0001F3CA\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_teacher:': u'\U0001F469\U0000200D\U0001F3EB',
+ u':woman_teacher_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F3EB',
+ u':woman_teacher_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F3EB',
+ u':woman_teacher_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F3EB',
+ u':woman_teacher_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F3EB',
+ u':woman_teacher_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F3EB',
+ u':woman_technologist:': u'\U0001F469\U0000200D\U0001F4BB',
+ u':woman_technologist_dark_skin_tone:': u'\U0001F469\U0001F3FF\U0000200D\U0001F4BB',
+ u':woman_technologist_light_skin_tone:': u'\U0001F469\U0001F3FB\U0000200D\U0001F4BB',
+ u':woman_technologist_medium-dark_skin_tone:': u'\U0001F469\U0001F3FE\U0000200D\U0001F4BB',
+ u':woman_technologist_medium-light_skin_tone:': u'\U0001F469\U0001F3FC\U0000200D\U0001F4BB',
+ u':woman_technologist_medium_skin_tone:': u'\U0001F469\U0001F3FD\U0000200D\U0001F4BB',
+ u':woman_tipping_hand:': u'\U0001F481\U0000200D\U00002640\U0000FE0F',
+ u':woman_tipping_hand_dark_skin_tone:': u'\U0001F481\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_tipping_hand_light_skin_tone:': u'\U0001F481\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_tipping_hand_medium-dark_skin_tone:': u'\U0001F481\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_tipping_hand_medium-light_skin_tone:': u'\U0001F481\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_tipping_hand_medium_skin_tone:': u'\U0001F481\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire:': u'\U0001F9DB\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire_dark_skin_tone:': u'\U0001F9DB\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire_light_skin_tone:': u'\U0001F9DB\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire_medium-dark_skin_tone:': u'\U0001F9DB\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire_medium-light_skin_tone:': u'\U0001F9DB\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_vampire_medium_skin_tone:': u'\U0001F9DB\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking:': u'\U0001F6B6\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking_dark_skin_tone:': u'\U0001F6B6\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking_light_skin_tone:': u'\U0001F6B6\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking_medium-dark_skin_tone:': u'\U0001F6B6\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking_medium-light_skin_tone:': u'\U0001F6B6\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_walking_medium_skin_tone:': u'\U0001F6B6\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban:': u'\U0001F473\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban_dark_skin_tone:': u'\U0001F473\U0001F3FF\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban_light_skin_tone:': u'\U0001F473\U0001F3FB\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban_medium-dark_skin_tone:': u'\U0001F473\U0001F3FE\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban_medium-light_skin_tone:': u'\U0001F473\U0001F3FC\U0000200D\U00002640\U0000FE0F',
+ u':woman_wearing_turban_medium_skin_tone:': u'\U0001F473\U0001F3FD\U0000200D\U00002640\U0000FE0F',
+ u':woman_with_headscarf:': u'\U0001F9D5',
+ u':woman_with_headscarf_dark_skin_tone:': u'\U0001F9D5\U0001F3FF',
+ u':woman_with_headscarf_light_skin_tone:': u'\U0001F9D5\U0001F3FB',
+ u':woman_with_headscarf_medium-dark_skin_tone:': u'\U0001F9D5\U0001F3FE',
+ u':woman_with_headscarf_medium-light_skin_tone:': u'\U0001F9D5\U0001F3FC',
+ u':woman_with_headscarf_medium_skin_tone:': u'\U0001F9D5\U0001F3FD',
+ u':woman_zombie:': u'\U0001F9DF\U0000200D\U00002640\U0000FE0F',
+ u':woman’s_boot:': u'\U0001F462',
+ u':woman’s_clothes:': u'\U0001F45A',
+ u':woman’s_hat:': u'\U0001F452',
+ u':woman’s_sandal:': u'\U0001F461',
+ u':women_with_bunny_ears:': u'\U0001F46F\U0000200D\U00002640\U0000FE0F',
+ u':women_wrestling:': u'\U0001F93C\U0000200D\U00002640\U0000FE0F',
+ u':women’s_room:': u'\U0001F6BA',
+ u':world_map:': u'\U0001F5FA',
+ u':worried_face:': u'\U0001F61F',
+ u':wrapped_gift:': u'\U0001F381',
+ u':wrench:': u'\U0001F527',
+ u':writing_hand:': u'\U0000270D',
+ u':writing_hand_dark_skin_tone:': u'\U0000270D\U0001F3FF',
+ u':writing_hand_light_skin_tone:': u'\U0000270D\U0001F3FB',
+ u':writing_hand_medium-dark_skin_tone:': u'\U0000270D\U0001F3FE',
+ u':writing_hand_medium-light_skin_tone:': u'\U0000270D\U0001F3FC',
+ u':writing_hand_medium_skin_tone:': u'\U0000270D\U0001F3FD',
+ u':yellow_heart:': u'\U0001F49B',
+ u':yen_banknote:': u'\U0001F4B4',
+ u':yin_yang:': u'\U0000262F',
+ u':zany_face:': u'\U0001F92A',
+ u':zebra:': u'\U0001F993',
+ u':zipper-mouth_face:': u'\U0001F910',
+ u':zombie:': u'\U0001F9DF',
+ u':zzz:': u'\U0001F4A4',
+ u':Åland_Islands:': u'\U0001F1E6\U0001F1FD',
+}
+
+EMOJI_ALIAS_UNICODE = dict(EMOJI_UNICODE.items(), **{
+ u':admission_tickets:': u'\U0001F39F',
+ u':aerial_tramway:': u'\U0001F6A1',
+ u':airplane:': u'\U00002708',
+ u':airplane_arriving:': u'\U0001F6EC',
+ u':airplane_departure:': u'\U0001F6EB',
+ u':alarm_clock:': u'\U000023F0',
+ u':alembic:': u'\U00002697',
+ u':space_invader:': u'\U0001F47E',
+ u':ambulance:': u'\U0001F691',
+ u':football:': u'\U0001F3C8',
+ u':amphora:': u'\U0001F3FA',
+ u':anchor:': u'\U00002693',
+ u':anger:': u'\U0001F4A2',
+ u':angry:': u'\U0001F620',
+ u':anguished:': u'\U0001F627',
+ u':ant:': u'\U0001F41C',
+ u':signal_strength:': u'\U0001F4F6',
+ u':arrows_counterclockwise:': u'\U0001F504',
+ u':aquarius:': u'\U00002652',
+ u':aries:': u'\U00002648',
+ u':arrow_heading_down:': u'\U00002935',
+ u':arrow_heading_up:': u'\U00002934',
+ u':articulated_lorry:': u'\U0001F69B',
+ u':art:': u'\U0001F3A8',
+ u':astonished:': u'\U0001F632',
+ u':athletic_shoe:': u'\U0001F45F',
+ u':atom_symbol:': u'\U0000269B',
+ u':eggplant:': u'\U0001F346',
+ u':atm:': u'\U0001F3E7',
+ u':car:': u'\U0001F697',
+ u':red_car:': u'\U0001F697',
+ u':baby:': u'\U0001F476',
+ u':angel:': u'\U0001F47C',
+ u':baby_bottle:': u'\U0001F37C',
+ u':baby_chick:': u'\U0001F424',
+ u':baby_symbol:': u'\U0001F6BC',
+ u':back:': u'\U0001F519',
+ u':camel:': u'\U0001F42B',
+ u':badminton_racquet_and_shuttlecock:': u'\U0001F3F8',
+ u':baggage_claim:': u'\U0001F6C4',
+ u':balloon:': u'\U0001F388',
+ u':ballot_box_with_ballot:': u'\U0001F5F3',
+ u':ballot_box_with_check:': u'\U00002611',
+ u':banana:': u'\U0001F34C',
+ u':bank:': u'\U0001F3E6',
+ u':dollar:': u'\U0001F4B5',
+ u':euro:': u'\U0001F4B6',
+ u':pound:': u'\U0001F4B7',
+ u':yen:': u'\U0001F4B4',
+ u':bar_chart:': u'\U0001F4CA',
+ u':barber:': u'\U0001F488',
+ u':baseball:': u'\U000026BE',
+ u':basketball:': u'\U0001F3C0',
+ u':bath:': u'\U0001F6C0',
+ u':bathtub:': u'\U0001F6C1',
+ u':battery:': u'\U0001F50B',
+ u':beach_with_umbrella:': u'\U0001F3D6',
+ u':bear:': u'\U0001F43B',
+ u':heartbeat:': u'\U0001F493',
+ u':bed:': u'\U0001F6CF',
+ u':beer:': u'\U0001F37A',
+ u':bell:': u'\U0001F514',
+ u':no_bell:': u'\U0001F515',
+ u':bellhop_bell:': u'\U0001F6CE',
+ u':bento:': u'\U0001F371',
+ u':bike:': u'\U0001F6B2',
+ u':bicyclist:': u'\U0001F6B4',
+ u':bikini:': u'\U0001F459',
+ u':8ball:': u'\U0001F3B1',
+ u':biohazard_sign:': u'\U00002623',
+ u':bird:': u'\U0001F426',
+ u':birthday:': u'\U0001F382',
+ u':black_circle_for_record:': u'\U000023FA',
+ u':clubs:': u'\U00002663',
+ u':diamonds:': u'\U00002666',
+ u':arrow_double_down:': u'\U000023EC',
+ u':hearts:': u'\U00002665',
+ u':black_large_square:': u'\U00002B1B',
+ u':rewind:': u'\U000023EA',
+ u':black_left__pointing_double_triangle_with_vertical_bar:': u'\U000023EE',
+ u':arrow_backward:': u'\U000025C0',
+ u':black_medium_small_square:': u'\U000025FE',
+ u':black_medium_square:': u'\U000025FC',
+ u':black_nib:': u'\U00002712',
+ u':question:': u'\U00002753',
+ u':fast_forward:': u'\U000023E9',
+ u':black_right__pointing_double_triangle_with_vertical_bar:': u'\U000023ED',
+ u':arrow_forward:': u'\U000025B6',
+ u':black_right__pointing_triangle_with_double_vertical_bar:': u'\U000023EF',
+ u':arrow_right:': u'\U000027A1',
+ u':scissors:': u'\U00002702',
+ u':black_small_square:': u'\U000025AA',
+ u':spades:': u'\U00002660',
+ u':black_square_button:': u'\U0001F532',
+ u':black_square_for_stop:': u'\U000023F9',
+ u':sunny:': u'\U00002600',
+ u':phone:': u'\U0000260E',
+ u':telephone:': u'\U0000260E',
+ u':recycle:': u'\U0000267B',
+ u':arrow_double_up:': u'\U000023EB',
+ u':blossom:': u'\U0001F33C',
+ u':blowfish:': u'\U0001F421',
+ u':blue_book:': u'\U0001F4D8',
+ u':blue_heart:': u'\U0001F499',
+ u':boar:': u'\U0001F417',
+ u':bomb:': u'\U0001F4A3',
+ u':bookmark:': u'\U0001F516',
+ u':bookmark_tabs:': u'\U0001F4D1',
+ u':books:': u'\U0001F4DA',
+ u':bottle_with_popping_cork:': u'\U0001F37E',
+ u':bouquet:': u'\U0001F490',
+ u':bow_and_arrow:': u'\U0001F3F9',
+ u':bowling:': u'\U0001F3B3',
+ u':boy:': u'\U0001F466',
+ u':bread:': u'\U0001F35E',
+ u':bride_with_veil:': u'\U0001F470',
+ u':bridge_at_night:': u'\U0001F309',
+ u':briefcase:': u'\U0001F4BC',
+ u':broken_heart:': u'\U0001F494',
+ u':bug:': u'\U0001F41B',
+ u':building_construction:': u'\U0001F3D7',
+ u':burrito:': u'\U0001F32F',
+ u':bus:': u'\U0001F68C',
+ u':busstop:': u'\U0001F68F',
+ u':bust_in_silhouette:': u'\U0001F464',
+ u':busts_in_silhouette:': u'\U0001F465',
+ u':cactus:': u'\U0001F335',
+ u':date:': u'\U0001F4C5',
+ u':camera:': u'\U0001F4F7',
+ u':camera_with_flash:': u'\U0001F4F8',
+ u':camping:': u'\U0001F3D5',
+ u':cancer:': u'\U0000264B',
+ u':candle:': u'\U0001F56F',
+ u':candy:': u'\U0001F36C',
+ u':capricorn:': u'\U00002651',
+ u':card_file_box:': u'\U0001F5C3',
+ u':card_index:': u'\U0001F4C7',
+ u':card_index_dividers:': u'\U0001F5C2',
+ u':carousel_horse:': u'\U0001F3A0',
+ u':flags:': u'\U0001F38F',
+ u':cat2:': u'\U0001F408',
+ u':cat:': u'\U0001F431',
+ u':joy_cat:': u'\U0001F639',
+ u':smirk_cat:': u'\U0001F63C',
+ u':chains:': u'\U000026D3',
+ u':chart_with_downwards_trend:': u'\U0001F4C9',
+ u':chart_with_upwards_trend:': u'\U0001F4C8',
+ u':chart:': u'\U0001F4B9',
+ u':mega:': u'\U0001F4E3',
+ u':cheese_wedge:': u'\U0001F9C0',
+ u':checkered_flag:': u'\U0001F3C1',
+ u':cherries:': u'\U0001F352',
+ u':cherry_blossom:': u'\U0001F338',
+ u':chestnut:': u'\U0001F330',
+ u':chicken:': u'\U0001F414',
+ u':children_crossing:': u'\U0001F6B8',
+ u':chipmunk:': u'\U0001F43F',
+ u':chocolate_bar:': u'\U0001F36B',
+ u':christmas_tree:': u'\U0001F384',
+ u':church:': u'\U000026EA',
+ u':cinema:': u'\U0001F3A6',
+ u':accept:': u'\U0001F251',
+ u':ideograph_advantage:': u'\U0001F250',
+ u':congratulations:': u'\U00003297',
+ u':secret:': u'\U00003299',
+ u':m:': u'\U000024C2',
+ u':circus_tent:': u'\U0001F3AA',
+ u':cityscape:': u'\U0001F3D9',
+ u':city_sunset:': u'\U0001F306',
+ u':clapper:': u'\U0001F3AC',
+ u':clap:': u'\U0001F44F',
+ u':classical_building:': u'\U0001F3DB',
+ u':beers:': u'\U0001F37B',
+ u':clipboard:': u'\U0001F4CB',
+ u':clock830:': u'\U0001F563',
+ u':clock8:': u'\U0001F557',
+ u':clock1130:': u'\U0001F566',
+ u':clock11:': u'\U0001F55A',
+ u':clock530:': u'\U0001F560',
+ u':clock5:': u'\U0001F554',
+ u':clock430:': u'\U0001F55F',
+ u':clock4:': u'\U0001F553',
+ u':clock930:': u'\U0001F564',
+ u':clock9:': u'\U0001F558',
+ u':clock130:': u'\U0001F55C',
+ u':clock1:': u'\U0001F550',
+ u':clock730:': u'\U0001F562',
+ u':clock7:': u'\U0001F556',
+ u':clock630:': u'\U0001F561',
+ u':clock6:': u'\U0001F555',
+ u':clock1030:': u'\U0001F565',
+ u':clock10:': u'\U0001F559',
+ u':clock330:': u'\U0001F55E',
+ u':clock3:': u'\U0001F552',
+ u':clock1230:': u'\U0001F567',
+ u':clock12:': u'\U0001F55B',
+ u':clock230:': u'\U0001F55D',
+ u':clock2:': u'\U0001F551',
+ u':arrows_clockwise:': u'\U0001F503',
+ u':repeat:': u'\U0001F501',
+ u':repeat_one:': u'\U0001F502',
+ u':closed_book:': u'\U0001F4D5',
+ u':closed_lock_with_key:': u'\U0001F510',
+ u':mailbox_closed:': u'\U0001F4EA',
+ u':mailbox:': u'\U0001F4EB',
+ u':closed_umbrella:': u'\U0001F302',
+ u':cloud:': u'\U00002601',
+ u':cloud_with_lightning:': u'\U0001F329',
+ u':cloud_with_rain:': u'\U0001F327',
+ u':cloud_with_snow:': u'\U0001F328',
+ u':cloud_with_tornado:': u'\U0001F32A',
+ u':cocktail:': u'\U0001F378',
+ u':coffin:': u'\U000026B0',
+ u':boom:': u'\U0001F4A5',
+ u':collision:': u'\U0001F4A5',
+ u':comet:': u'\U00002604',
+ u':compression:': u'\U0001F5DC',
+ u':confetti_ball:': u'\U0001F38A',
+ u':confounded:': u'\U0001F616',
+ u':confused:': u'\U0001F615',
+ u':construction:': u'\U0001F6A7',
+ u':construction_worker:': u'\U0001F477',
+ u':control_knobs:': u'\U0001F39B',
+ u':convenience_store:': u'\U0001F3EA',
+ u':rice:': u'\U0001F35A',
+ u':cookie:': u'\U0001F36A',
+ u':egg:': u'\U0001F373',
+ u':copyright:': u'\U000000A9',
+ u':couch_and_lamp:': u'\U0001F6CB',
+ u':couple_with_heart:': u'\U0001F491',
+ u':cow2:': u'\U0001F404',
+ u':cow:': u'\U0001F42E',
+ u':crab:': u'\U0001F980',
+ u':credit_card:': u'\U0001F4B3',
+ u':crescent_moon:': u'\U0001F319',
+ u':cricket_bat_and_ball:': u'\U0001F3CF',
+ u':crocodile:': u'\U0001F40A',
+ u':x:': u'\U0000274C',
+ u':crossed_flags:': u'\U0001F38C',
+ u':crossed_swords:': u'\U00002694',
+ u':crown:': u'\U0001F451',
+ u':crying_cat_face:': u'\U0001F63F',
+ u':cry:': u'\U0001F622',
+ u':crystal_ball:': u'\U0001F52E',
+ u':curly_loop:': u'\U000027B0',
+ u':currency_exchange:': u'\U0001F4B1',
+ u':curry:': u'\U0001F35B',
+ u':custard:': u'\U0001F36E',
+ u':customs:': u'\U0001F6C3',
+ u':cyclone:': u'\U0001F300',
+ u':dagger_knife:': u'\U0001F5E1',
+ u':dancer:': u'\U0001F483',
+ u':dango:': u'\U0001F361',
+ u':dark_sunglasses:': u'\U0001F576',
+ u':dash:': u'\U0001F4A8',
+ u':deciduous_tree:': u'\U0001F333',
+ u':truck:': u'\U0001F69A',
+ u':department_store:': u'\U0001F3EC',
+ u':derelict_house_building:': u'\U0001F3DA',
+ u':desert:': u'\U0001F3DC',
+ u':desert_island:': u'\U0001F3DD',
+ u':desktop_computer:': u'\U0001F5A5',
+ u':diamond_shape_with_a_dot_inside:': u'\U0001F4A0',
+ u':dart:': u'\U0001F3AF',
+ u':disappointed_relieved:': u'\U0001F625',
+ u':disappointed:': u'\U0001F61E',
+ u':dizzy_face:': u'\U0001F635',
+ u':dizzy:': u'\U0001F4AB',
+ u':do_not_litter:': u'\U0001F6AF',
+ u':dog2:': u'\U0001F415',
+ u':dog:': u'\U0001F436',
+ u':dolphin:': u'\U0001F42C',
+ u':flipper:': u'\U0001F42C',
+ u':door:': u'\U0001F6AA',
+ u':loop:': u'\U000027BF',
+ u':bangbang:': u'\U0000203C',
+ u':double_vertical_bar:': u'\U000023F8',
+ u':doughnut:': u'\U0001F369',
+ u':dove_of_peace:': u'\U0001F54A',
+ u':small_red_triangle_down:': u'\U0001F53B',
+ u':arrow_down_small:': u'\U0001F53D',
+ u':arrow_down:': u'\U00002B07',
+ u':dragon:': u'\U0001F409',
+ u':dragon_face:': u'\U0001F432',
+ u':dress:': u'\U0001F457',
+ u':dromedary_camel:': u'\U0001F42A',
+ u':droplet:': u'\U0001F4A7',
+ u':dvd:': u'\U0001F4C0',
+ u':e__mail:': u'\U0001F4E7',
+ u':ear:': u'\U0001F442',
+ u':corn:': u'\U0001F33D',
+ u':ear_of_rice:': u'\U0001F33E',
+ u':earth_americas:': u'\U0001F30E',
+ u':earth_asia:': u'\U0001F30F',
+ u':earth_africa:': u'\U0001F30D',
+ u':eight_pointed_black_star:': u'\U00002734',
+ u':eight_spoked_asterisk:': u'\U00002733',
+ u':eject_symbol:': u'\U000023CF',
+ u':bulb:': u'\U0001F4A1',
+ u':electric_plug:': u'\U0001F50C',
+ u':flashlight:': u'\U0001F526',
+ u':elephant:': u'\U0001F418',
+ u':emoji_modifier_fitzpatrick_type__1__2:': u'\U0001F3FB',
+ u':emoji_modifier_fitzpatrick_type__3:': u'\U0001F3FC',
+ u':emoji_modifier_fitzpatrick_type__4:': u'\U0001F3FD',
+ u':emoji_modifier_fitzpatrick_type__5:': u'\U0001F3FE',
+ u':emoji_modifier_fitzpatrick_type__6:': u'\U0001F3FF',
+ u':end:': u'\U0001F51A',
+ u':email:': u'\U00002709',
+ u':envelope:': u'\U00002709',
+ u':envelope_with_arrow:': u'\U0001F4E9',
+ u':european_castle:': u'\U0001F3F0',
+ u':european_post_office:': u'\U0001F3E4',
+ u':evergreen_tree:': u'\U0001F332',
+ u':interrobang:': u'\U00002049',
+ u':expressionless:': u'\U0001F611',
+ u':alien:': u'\U0001F47D',
+ u':eye:': u'\U0001F441',
+ u':eyeglasses:': u'\U0001F453',
+ u':eyes:': u'\U0001F440',
+ u':massage:': u'\U0001F486',
+ u':yum:': u'\U0001F60B',
+ u':scream:': u'\U0001F631',
+ u':kissing_heart:': u'\U0001F618',
+ u':sweat:': u'\U0001F613',
+ u':face_with_head__bandage:': u'\U0001F915',
+ u':triumph:': u'\U0001F624',
+ u':mask:': u'\U0001F637',
+ u':no_good:': u'\U0001F645',
+ u':ok_woman:': u'\U0001F646',
+ u':open_mouth:': u'\U0001F62E',
+ u':cold_sweat:': u'\U0001F630',
+ u':face_with_rolling_eyes:': u'\U0001F644',
+ u':stuck_out_tongue:': u'\U0001F61B',
+ u':stuck_out_tongue_closed_eyes:': u'\U0001F61D',
+ u':stuck_out_tongue_winking_eye:': u'\U0001F61C',
+ u':joy:': u'\U0001F602',
+ u':face_with_thermometer:': u'\U0001F912',
+ u':no_mouth:': u'\U0001F636',
+ u':factory:': u'\U0001F3ED',
+ u':fallen_leaf:': u'\U0001F342',
+ u':family:': u'\U0001F46A',
+ u':santa:': u'\U0001F385',
+ u':fax:': u'\U0001F4E0',
+ u':fearful:': u'\U0001F628',
+ u':ferris_wheel:': u'\U0001F3A1',
+ u':ferry:': u'\U000026F4',
+ u':field_hockey_stick_and_ball:': u'\U0001F3D1',
+ u':file_cabinet:': u'\U0001F5C4',
+ u':file_folder:': u'\U0001F4C1',
+ u':film_frames:': u'\U0001F39E',
+ u':film_projector:': u'\U0001F4FD',
+ u':fire:': u'\U0001F525',
+ u':fire_engine:': u'\U0001F692',
+ u':sparkler:': u'\U0001F387',
+ u':fireworks:': u'\U0001F386',
+ u':first_quarter_moon:': u'\U0001F313',
+ u':first_quarter_moon_with_face:': u'\U0001F31B',
+ u':fish:': u'\U0001F41F',
+ u':fish_cake:': u'\U0001F365',
+ u':fishing_pole_and_fish:': u'\U0001F3A3',
+ u':facepunch:': u'\U0001F44A',
+ u':punch:': u'\U0001F44A',
+ u':flag_for_Afghanistan:': u'\U0001F1E6\U0001F1EB',
+ u':flag_for_Albania:': u'\U0001F1E6\U0001F1F1',
+ u':flag_for_Algeria:': u'\U0001F1E9\U0001F1FF',
+ u':flag_for_American_Samoa:': u'\U0001F1E6\U0001F1F8',
+ u':flag_for_Andorra:': u'\U0001F1E6\U0001F1E9',
+ u':flag_for_Angola:': u'\U0001F1E6\U0001F1F4',
+ u':flag_for_Anguilla:': u'\U0001F1E6\U0001F1EE',
+ u':flag_for_Antarctica:': u'\U0001F1E6\U0001F1F6',
+ u':flag_for_Antigua_&_Barbuda:': u'\U0001F1E6\U0001F1EC',
+ u':flag_for_Argentina:': u'\U0001F1E6\U0001F1F7',
+ u':flag_for_Armenia:': u'\U0001F1E6\U0001F1F2',
+ u':flag_for_Aruba:': u'\U0001F1E6\U0001F1FC',
+ u':flag_for_Ascension_Island:': u'\U0001F1E6\U0001F1E8',
+ u':flag_for_Australia:': u'\U0001F1E6\U0001F1FA',
+ u':flag_for_Austria:': u'\U0001F1E6\U0001F1F9',
+ u':flag_for_Azerbaijan:': u'\U0001F1E6\U0001F1FF',
+ u':flag_for_Bahamas:': u'\U0001F1E7\U0001F1F8',
+ u':flag_for_Bahrain:': u'\U0001F1E7\U0001F1ED',
+ u':flag_for_Bangladesh:': u'\U0001F1E7\U0001F1E9',
+ u':flag_for_Barbados:': u'\U0001F1E7\U0001F1E7',
+ u':flag_for_Belarus:': u'\U0001F1E7\U0001F1FE',
+ u':flag_for_Belgium:': u'\U0001F1E7\U0001F1EA',
+ u':flag_for_Belize:': u'\U0001F1E7\U0001F1FF',
+ u':flag_for_Benin:': u'\U0001F1E7\U0001F1EF',
+ u':flag_for_Bermuda:': u'\U0001F1E7\U0001F1F2',
+ u':flag_for_Bhutan:': u'\U0001F1E7\U0001F1F9',
+ u':flag_for_Bolivia:': u'\U0001F1E7\U0001F1F4',
+ u':flag_for_Bosnia_&_Herzegovina:': u'\U0001F1E7\U0001F1E6',
+ u':flag_for_Botswana:': u'\U0001F1E7\U0001F1FC',
+ u':flag_for_Bouvet_Island:': u'\U0001F1E7\U0001F1FB',
+ u':flag_for_Brazil:': u'\U0001F1E7\U0001F1F7',
+ u':flag_for_British_Indian_Ocean_Territory:': u'\U0001F1EE\U0001F1F4',
+ u':flag_for_British_Virgin_Islands:': u'\U0001F1FB\U0001F1EC',
+ u':flag_for_Brunei:': u'\U0001F1E7\U0001F1F3',
+ u':flag_for_Bulgaria:': u'\U0001F1E7\U0001F1EC',
+ u':flag_for_Burkina_Faso:': u'\U0001F1E7\U0001F1EB',
+ u':flag_for_Burundi:': u'\U0001F1E7\U0001F1EE',
+ u':flag_for_Cambodia:': u'\U0001F1F0\U0001F1ED',
+ u':flag_for_Cameroon:': u'\U0001F1E8\U0001F1F2',
+ u':flag_for_Canada:': u'\U0001F1E8\U0001F1E6',
+ u':flag_for_Canary_Islands:': u'\U0001F1EE\U0001F1E8',
+ u':flag_for_Cape_Verde:': u'\U0001F1E8\U0001F1FB',
+ u':flag_for_Caribbean_Netherlands:': u'\U0001F1E7\U0001F1F6',
+ u':flag_for_Cayman_Islands:': u'\U0001F1F0\U0001F1FE',
+ u':flag_for_Central_African_Republic:': u'\U0001F1E8\U0001F1EB',
+ u':flag_for_Ceuta_&_Melilla:': u'\U0001F1EA\U0001F1E6',
+ u':flag_for_Chad:': u'\U0001F1F9\U0001F1E9',
+ u':flag_for_Chile:': u'\U0001F1E8\U0001F1F1',
+ u':flag_for_China:': u'\U0001F1E8\U0001F1F3',
+ u':flag_for_Christmas_Island:': u'\U0001F1E8\U0001F1FD',
+ u':flag_for_Clipperton_Island:': u'\U0001F1E8\U0001F1F5',
+ u':flag_for_Cocos__Islands:': u'\U0001F1E8\U0001F1E8',
+ u':flag_for_Colombia:': u'\U0001F1E8\U0001F1F4',
+ u':flag_for_Comoros:': u'\U0001F1F0\U0001F1F2',
+ u':flag_for_Congo____Brazzaville:': u'\U0001F1E8\U0001F1EC',
+ u':flag_for_Congo____Kinshasa:': u'\U0001F1E8\U0001F1E9',
+ u':flag_for_Cook_Islands:': u'\U0001F1E8\U0001F1F0',
+ u':flag_for_Costa_Rica:': u'\U0001F1E8\U0001F1F7',
+ u':flag_for_Croatia:': u'\U0001F1ED\U0001F1F7',
+ u':flag_for_Cuba:': u'\U0001F1E8\U0001F1FA',
+ u':flag_for_Curaçao:': u'\U0001F1E8\U0001F1FC',
+ u':flag_for_Cyprus:': u'\U0001F1E8\U0001F1FE',
+ u':flag_for_Czech_Republic:': u'\U0001F1E8\U0001F1FF',
+ u':flag_for_Côte_d’Ivoire:': u'\U0001F1E8\U0001F1EE',
+ u':flag_for_Denmark:': u'\U0001F1E9\U0001F1F0',
+ u':flag_for_Diego_Garcia:': u'\U0001F1E9\U0001F1EC',
+ u':flag_for_Djibouti:': u'\U0001F1E9\U0001F1EF',
+ u':flag_for_Dominica:': u'\U0001F1E9\U0001F1F2',
+ u':flag_for_Dominican_Republic:': u'\U0001F1E9\U0001F1F4',
+ u':flag_for_Ecuador:': u'\U0001F1EA\U0001F1E8',
+ u':flag_for_Egypt:': u'\U0001F1EA\U0001F1EC',
+ u':flag_for_El_Salvador:': u'\U0001F1F8\U0001F1FB',
+ u':flag_for_Equatorial_Guinea:': u'\U0001F1EC\U0001F1F6',
+ u':flag_for_Eritrea:': u'\U0001F1EA\U0001F1F7',
+ u':flag_for_Estonia:': u'\U0001F1EA\U0001F1EA',
+ u':flag_for_Ethiopia:': u'\U0001F1EA\U0001F1F9',
+ u':flag_for_European_Union:': u'\U0001F1EA\U0001F1FA',
+ u':flag_for_Falkland_Islands:': u'\U0001F1EB\U0001F1F0',
+ u':flag_for_Faroe_Islands:': u'\U0001F1EB\U0001F1F4',
+ u':flag_for_Fiji:': u'\U0001F1EB\U0001F1EF',
+ u':flag_for_Finland:': u'\U0001F1EB\U0001F1EE',
+ u':flag_for_France:': u'\U0001F1EB\U0001F1F7',
+ u':flag_for_French_Guiana:': u'\U0001F1EC\U0001F1EB',
+ u':flag_for_French_Polynesia:': u'\U0001F1F5\U0001F1EB',
+ u':flag_for_French_Southern_Territories:': u'\U0001F1F9\U0001F1EB',
+ u':flag_for_Gabon:': u'\U0001F1EC\U0001F1E6',
+ u':flag_for_Gambia:': u'\U0001F1EC\U0001F1F2',
+ u':flag_for_Georgia:': u'\U0001F1EC\U0001F1EA',
+ u':flag_for_Germany:': u'\U0001F1E9\U0001F1EA',
+ u':flag_for_Ghana:': u'\U0001F1EC\U0001F1ED',
+ u':flag_for_Gibraltar:': u'\U0001F1EC\U0001F1EE',
+ u':flag_for_Greece:': u'\U0001F1EC\U0001F1F7',
+ u':flag_for_Greenland:': u'\U0001F1EC\U0001F1F1',
+ u':flag_for_Grenada:': u'\U0001F1EC\U0001F1E9',
+ u':flag_for_Guadeloupe:': u'\U0001F1EC\U0001F1F5',
+ u':flag_for_Guam:': u'\U0001F1EC\U0001F1FA',
+ u':flag_for_Guatemala:': u'\U0001F1EC\U0001F1F9',
+ u':flag_for_Guernsey:': u'\U0001F1EC\U0001F1EC',
+ u':flag_for_Guinea:': u'\U0001F1EC\U0001F1F3',
+ u':flag_for_Guinea__Bissau:': u'\U0001F1EC\U0001F1FC',
+ u':flag_for_Guyana:': u'\U0001F1EC\U0001F1FE',
+ u':flag_for_Haiti:': u'\U0001F1ED\U0001F1F9',
+ u':flag_for_Heard_&_McDonald_Islands:': u'\U0001F1ED\U0001F1F2',
+ u':flag_for_Honduras:': u'\U0001F1ED\U0001F1F3',
+ u':flag_for_Hong_Kong:': u'\U0001F1ED\U0001F1F0',
+ u':flag_for_Hungary:': u'\U0001F1ED\U0001F1FA',
+ u':flag_for_Iceland:': u'\U0001F1EE\U0001F1F8',
+ u':flag_for_India:': u'\U0001F1EE\U0001F1F3',
+ u':flag_for_Indonesia:': u'\U0001F1EE\U0001F1E9',
+ u':flag_for_Iran:': u'\U0001F1EE\U0001F1F7',
+ u':flag_for_Iraq:': u'\U0001F1EE\U0001F1F6',
+ u':flag_for_Ireland:': u'\U0001F1EE\U0001F1EA',
+ u':flag_for_Isle_of_Man:': u'\U0001F1EE\U0001F1F2',
+ u':flag_for_Israel:': u'\U0001F1EE\U0001F1F1',
+ u':flag_for_Italy:': u'\U0001F1EE\U0001F1F9',
+ u':flag_for_Jamaica:': u'\U0001F1EF\U0001F1F2',
+ u':flag_for_Japan:': u'\U0001F1EF\U0001F1F5',
+ u':flag_for_Jersey:': u'\U0001F1EF\U0001F1EA',
+ u':flag_for_Jordan:': u'\U0001F1EF\U0001F1F4',
+ u':flag_for_Kazakhstan:': u'\U0001F1F0\U0001F1FF',
+ u':flag_for_Kenya:': u'\U0001F1F0\U0001F1EA',
+ u':flag_for_Kiribati:': u'\U0001F1F0\U0001F1EE',
+ u':flag_for_Kosovo:': u'\U0001F1FD\U0001F1F0',
+ u':flag_for_Kuwait:': u'\U0001F1F0\U0001F1FC',
+ u':flag_for_Kyrgyzstan:': u'\U0001F1F0\U0001F1EC',
+ u':flag_for_Laos:': u'\U0001F1F1\U0001F1E6',
+ u':flag_for_Latvia:': u'\U0001F1F1\U0001F1FB',
+ u':flag_for_Lebanon:': u'\U0001F1F1\U0001F1E7',
+ u':flag_for_Lesotho:': u'\U0001F1F1\U0001F1F8',
+ u':flag_for_Liberia:': u'\U0001F1F1\U0001F1F7',
+ u':flag_for_Libya:': u'\U0001F1F1\U0001F1FE',
+ u':flag_for_Liechtenstein:': u'\U0001F1F1\U0001F1EE',
+ u':flag_for_Lithuania:': u'\U0001F1F1\U0001F1F9',
+ u':flag_for_Luxembourg:': u'\U0001F1F1\U0001F1FA',
+ u':flag_for_Macau:': u'\U0001F1F2\U0001F1F4',
+ u':flag_for_Macedonia:': u'\U0001F1F2\U0001F1F0',
+ u':flag_for_Madagascar:': u'\U0001F1F2\U0001F1EC',
+ u':flag_for_Malawi:': u'\U0001F1F2\U0001F1FC',
+ u':flag_for_Malaysia:': u'\U0001F1F2\U0001F1FE',
+ u':flag_for_Maldives:': u'\U0001F1F2\U0001F1FB',
+ u':flag_for_Mali:': u'\U0001F1F2\U0001F1F1',
+ u':flag_for_Malta:': u'\U0001F1F2\U0001F1F9',
+ u':flag_for_Marshall_Islands:': u'\U0001F1F2\U0001F1ED',
+ u':flag_for_Martinique:': u'\U0001F1F2\U0001F1F6',
+ u':flag_for_Mauritania:': u'\U0001F1F2\U0001F1F7',
+ u':flag_for_Mauritius:': u'\U0001F1F2\U0001F1FA',
+ u':flag_for_Mayotte:': u'\U0001F1FE\U0001F1F9',
+ u':flag_for_Mexico:': u'\U0001F1F2\U0001F1FD',
+ u':flag_for_Micronesia:': u'\U0001F1EB\U0001F1F2',
+ u':flag_for_Moldova:': u'\U0001F1F2\U0001F1E9',
+ u':flag_for_Monaco:': u'\U0001F1F2\U0001F1E8',
+ u':flag_for_Mongolia:': u'\U0001F1F2\U0001F1F3',
+ u':flag_for_Montenegro:': u'\U0001F1F2\U0001F1EA',
+ u':flag_for_Montserrat:': u'\U0001F1F2\U0001F1F8',
+ u':flag_for_Morocco:': u'\U0001F1F2\U0001F1E6',
+ u':flag_for_Mozambique:': u'\U0001F1F2\U0001F1FF',
+ u':flag_for_Myanmar:': u'\U0001F1F2\U0001F1F2',
+ u':flag_for_Namibia:': u'\U0001F1F3\U0001F1E6',
+ u':flag_for_Nauru:': u'\U0001F1F3\U0001F1F7',
+ u':flag_for_Nepal:': u'\U0001F1F3\U0001F1F5',
+ u':flag_for_Netherlands:': u'\U0001F1F3\U0001F1F1',
+ u':flag_for_New_Caledonia:': u'\U0001F1F3\U0001F1E8',
+ u':flag_for_New_Zealand:': u'\U0001F1F3\U0001F1FF',
+ u':flag_for_Nicaragua:': u'\U0001F1F3\U0001F1EE',
+ u':flag_for_Niger:': u'\U0001F1F3\U0001F1EA',
+ u':flag_for_Nigeria:': u'\U0001F1F3\U0001F1EC',
+ u':flag_for_Niue:': u'\U0001F1F3\U0001F1FA',
+ u':flag_for_Norfolk_Island:': u'\U0001F1F3\U0001F1EB',
+ u':flag_for_North_Korea:': u'\U0001F1F0\U0001F1F5',
+ u':flag_for_Northern_Mariana_Islands:': u'\U0001F1F2\U0001F1F5',
+ u':flag_for_Norway:': u'\U0001F1F3\U0001F1F4',
+ u':flag_for_Oman:': u'\U0001F1F4\U0001F1F2',
+ u':flag_for_Pakistan:': u'\U0001F1F5\U0001F1F0',
+ u':flag_for_Palau:': u'\U0001F1F5\U0001F1FC',
+ u':flag_for_Palestinian_Territories:': u'\U0001F1F5\U0001F1F8',
+ u':flag_for_Panama:': u'\U0001F1F5\U0001F1E6',
+ u':flag_for_Papua_New_Guinea:': u'\U0001F1F5\U0001F1EC',
+ u':flag_for_Paraguay:': u'\U0001F1F5\U0001F1FE',
+ u':flag_for_Peru:': u'\U0001F1F5\U0001F1EA',
+ u':flag_for_Philippines:': u'\U0001F1F5\U0001F1ED',
+ u':flag_for_Pitcairn_Islands:': u'\U0001F1F5\U0001F1F3',
+ u':flag_for_Poland:': u'\U0001F1F5\U0001F1F1',
+ u':flag_for_Portugal:': u'\U0001F1F5\U0001F1F9',
+ u':flag_for_Puerto_Rico:': u'\U0001F1F5\U0001F1F7',
+ u':flag_for_Qatar:': u'\U0001F1F6\U0001F1E6',
+ u':flag_for_Romania:': u'\U0001F1F7\U0001F1F4',
+ u':flag_for_Russia:': u'\U0001F1F7\U0001F1FA',
+ u':flag_for_Rwanda:': u'\U0001F1F7\U0001F1FC',
+ u':flag_for_Réunion:': u'\U0001F1F7\U0001F1EA',
+ u':flag_for_Samoa:': u'\U0001F1FC\U0001F1F8',
+ u':flag_for_San_Marino:': u'\U0001F1F8\U0001F1F2',
+ u':flag_for_Saudi_Arabia:': u'\U0001F1F8\U0001F1E6',
+ u':flag_for_Senegal:': u'\U0001F1F8\U0001F1F3',
+ u':flag_for_Serbia:': u'\U0001F1F7\U0001F1F8',
+ u':flag_for_Seychelles:': u'\U0001F1F8\U0001F1E8',
+ u':flag_for_Sierra_Leone:': u'\U0001F1F8\U0001F1F1',
+ u':flag_for_Singapore:': u'\U0001F1F8\U0001F1EC',
+ u':flag_for_Sint_Maarten:': u'\U0001F1F8\U0001F1FD',
+ u':flag_for_Slovakia:': u'\U0001F1F8\U0001F1F0',
+ u':flag_for_Slovenia:': u'\U0001F1F8\U0001F1EE',
+ u':flag_for_Solomon_Islands:': u'\U0001F1F8\U0001F1E7',
+ u':flag_for_Somalia:': u'\U0001F1F8\U0001F1F4',
+ u':flag_for_South_Africa:': u'\U0001F1FF\U0001F1E6',
+ u':flag_for_South_Georgia_&_South_Sandwich_Islands:': u'\U0001F1EC\U0001F1F8',
+ u':flag_for_South_Korea:': u'\U0001F1F0\U0001F1F7',
+ u':flag_for_South_Sudan:': u'\U0001F1F8\U0001F1F8',
+ u':flag_for_Spain:': u'\U0001F1EA\U0001F1F8',
+ u':flag_for_Sri_Lanka:': u'\U0001F1F1\U0001F1F0',
+ u':flag_for_St._Barthélemy:': u'\U0001F1E7\U0001F1F1',
+ u':flag_for_St._Helena:': u'\U0001F1F8\U0001F1ED',
+ u':flag_for_St._Kitts_&_Nevis:': u'\U0001F1F0\U0001F1F3',
+ u':flag_for_St._Lucia:': u'\U0001F1F1\U0001F1E8',
+ u':flag_for_St._Martin:': u'\U0001F1F2\U0001F1EB',
+ u':flag_for_St._Pierre_&_Miquelon:': u'\U0001F1F5\U0001F1F2',
+ u':flag_for_St._Vincent_&_Grenadines:': u'\U0001F1FB\U0001F1E8',
+ u':flag_for_Sudan:': u'\U0001F1F8\U0001F1E9',
+ u':flag_for_Suriname:': u'\U0001F1F8\U0001F1F7',
+ u':flag_for_Svalbard_&_Jan_Mayen:': u'\U0001F1F8\U0001F1EF',
+ u':flag_for_Swaziland:': u'\U0001F1F8\U0001F1FF',
+ u':flag_for_Sweden:': u'\U0001F1F8\U0001F1EA',
+ u':flag_for_Switzerland:': u'\U0001F1E8\U0001F1ED',
+ u':flag_for_Syria:': u'\U0001F1F8\U0001F1FE',
+ u':flag_for_São_Tomé_&_Príncipe:': u'\U0001F1F8\U0001F1F9',
+ u':flag_for_Taiwan:': u'\U0001F1F9\U0001F1FC',
+ u':flag_for_Tajikistan:': u'\U0001F1F9\U0001F1EF',
+ u':flag_for_Tanzania:': u'\U0001F1F9\U0001F1FF',
+ u':flag_for_Thailand:': u'\U0001F1F9\U0001F1ED',
+ u':flag_for_Timor__Leste:': u'\U0001F1F9\U0001F1F1',
+ u':flag_for_Togo:': u'\U0001F1F9\U0001F1EC',
+ u':flag_for_Tokelau:': u'\U0001F1F9\U0001F1F0',
+ u':flag_for_Tonga:': u'\U0001F1F9\U0001F1F4',
+ u':flag_for_Trinidad_&_Tobago:': u'\U0001F1F9\U0001F1F9',
+ u':flag_for_Tristan_da_Cunha:': u'\U0001F1F9\U0001F1E6',
+ u':flag_for_Tunisia:': u'\U0001F1F9\U0001F1F3',
+ u':flag_for_Turkey:': u'\U0001F1F9\U0001F1F7',
+ u':flag_for_Turkmenistan:': u'\U0001F1F9\U0001F1F2',
+ u':flag_for_Turks_&_Caicos_Islands:': u'\U0001F1F9\U0001F1E8',
+ u':flag_for_Tuvalu:': u'\U0001F1F9\U0001F1FB',
+ u':flag_for_U.S._Outlying_Islands:': u'\U0001F1FA\U0001F1F2',
+ u':flag_for_U.S._Virgin_Islands:': u'\U0001F1FB\U0001F1EE',
+ u':flag_for_Uganda:': u'\U0001F1FA\U0001F1EC',
+ u':flag_for_Ukraine:': u'\U0001F1FA\U0001F1E6',
+ u':flag_for_United_Arab_Emirates:': u'\U0001F1E6\U0001F1EA',
+ u':flag_for_United_Kingdom:': u'\U0001F1EC\U0001F1E7',
+ u':flag_for_United_States:': u'\U0001F1FA\U0001F1F8',
+ u':flag_for_Uruguay:': u'\U0001F1FA\U0001F1FE',
+ u':flag_for_Uzbekistan:': u'\U0001F1FA\U0001F1FF',
+ u':flag_for_Vanuatu:': u'\U0001F1FB\U0001F1FA',
+ u':flag_for_Vatican_City:': u'\U0001F1FB\U0001F1E6',
+ u':flag_for_Venezuela:': u'\U0001F1FB\U0001F1EA',
+ u':flag_for_Vietnam:': u'\U0001F1FB\U0001F1F3',
+ u':flag_for_Wallis_&_Futuna:': u'\U0001F1FC\U0001F1EB',
+ u':flag_for_Western_Sahara:': u'\U0001F1EA\U0001F1ED',
+ u':flag_for_Yemen:': u'\U0001F1FE\U0001F1EA',
+ u':flag_for_Zambia:': u'\U0001F1FF\U0001F1F2',
+ u':flag_for_Zimbabwe:': u'\U0001F1FF\U0001F1FC',
+ u':flag_for_Åland_Islands:': u'\U0001F1E6\U0001F1FD',
+ u':golf:': u'\U000026F3',
+ u':fleur__de__lis:': u'\U0000269C',
+ u':muscle:': u'\U0001F4AA',
+ u':floppy_disk:': u'\U0001F4BE',
+ u':flower_playing_cards:': u'\U0001F3B4',
+ u':flushed:': u'\U0001F633',
+ u':fog:': u'\U0001F32B',
+ u':foggy:': u'\U0001F301',
+ u':footprints:': u'\U0001F463',
+ u':fork_and_knife:': u'\U0001F374',
+ u':fork_and_knife_with_plate:': u'\U0001F37D',
+ u':fountain:': u'\U000026F2',
+ u':four_leaf_clover:': u'\U0001F340',
+ u':frame_with_picture:': u'\U0001F5BC',
+ u':fries:': u'\U0001F35F',
+ u':fried_shrimp:': u'\U0001F364',
+ u':frog:': u'\U0001F438',
+ u':hatched_chick:': u'\U0001F425',
+ u':frowning:': u'\U0001F626',
+ u':fuelpump:': u'\U000026FD',
+ u':full_moon:': u'\U0001F315',
+ u':full_moon_with_face:': u'\U0001F31D',
+ u':funeral_urn:': u'\U000026B1',
+ u':game_die:': u'\U0001F3B2',
+ u':gear:': u'\U00002699',
+ u':gem:': u'\U0001F48E',
+ u':gemini:': u'\U0000264A',
+ u':ghost:': u'\U0001F47B',
+ u':girl:': u'\U0001F467',
+ u':globe_with_meridians:': u'\U0001F310',
+ u':star2:': u'\U0001F31F',
+ u':goat:': u'\U0001F410',
+ u':golfer:': u'\U0001F3CC',
+ u':mortar_board:': u'\U0001F393',
+ u':grapes:': u'\U0001F347',
+ u':green_apple:': u'\U0001F34F',
+ u':green_book:': u'\U0001F4D7',
+ u':green_heart:': u'\U0001F49A',
+ u':grimacing:': u'\U0001F62C',
+ u':smile_cat:': u'\U0001F638',
+ u':grinning:': u'\U0001F600',
+ u':grin:': u'\U0001F601',
+ u':heartpulse:': u'\U0001F497',
+ u':guardsman:': u'\U0001F482',
+ u':guitar:': u'\U0001F3B8',
+ u':haircut:': u'\U0001F487',
+ u':hamburger:': u'\U0001F354',
+ u':hammer:': u'\U0001F528',
+ u':hammer_and_pick:': u'\U00002692',
+ u':hammer_and_wrench:': u'\U0001F6E0',
+ u':hamster:': u'\U0001F439',
+ u':handbag:': u'\U0001F45C',
+ u':raising_hand:': u'\U0001F64B',
+ u':hatching_chick:': u'\U0001F423',
+ u':headphones:': u'\U0001F3A7',
+ u':hear_no_evil:': u'\U0001F649',
+ u':heart_decoration:': u'\U0001F49F',
+ u':cupid:': u'\U0001F498',
+ u':gift_heart:': u'\U0001F49D',
+ u':heart:': u'\U00002764',
+ u':heavy_check_mark:': u'\U00002714',
+ u':heavy_division_sign:': u'\U00002797',
+ u':heavy_dollar_sign:': u'\U0001F4B2',
+ u':exclamation:': u'\U00002757',
+ u':heavy_exclamation_mark:': u'\U00002757',
+ u':heavy_heart_exclamation_mark_ornament:': u'\U00002763',
+ u':o:': u'\U00002B55',
+ u':heavy_minus_sign:': u'\U00002796',
+ u':heavy_multiplication_x:': u'\U00002716',
+ u':heavy_plus_sign:': u'\U00002795',
+ u':helicopter:': u'\U0001F681',
+ u':helm_symbol:': u'\U00002388',
+ u':helmet_with_white_cross:': u'\U000026D1',
+ u':herb:': u'\U0001F33F',
+ u':hibiscus:': u'\U0001F33A',
+ u':high_heel:': u'\U0001F460',
+ u':bullettrain_side:': u'\U0001F684',
+ u':bullettrain_front:': u'\U0001F685',
+ u':high_brightness:': u'\U0001F506',
+ u':zap:': u'\U000026A1',
+ u':hocho:': u'\U0001F52A',
+ u':knife:': u'\U0001F52A',
+ u':hole:': u'\U0001F573',
+ u':honey_pot:': u'\U0001F36F',
+ u':bee:': u'\U0001F41D',
+ u':traffic_light:': u'\U0001F6A5',
+ u':racehorse:': u'\U0001F40E',
+ u':horse:': u'\U0001F434',
+ u':horse_racing:': u'\U0001F3C7',
+ u':hospital:': u'\U0001F3E5',
+ u':coffee:': u'\U00002615',
+ u':hot_dog:': u'\U0001F32D',
+ u':hot_pepper:': u'\U0001F336',
+ u':hotsprings:': u'\U00002668',
+ u':hotel:': u'\U0001F3E8',
+ u':hourglass:': u'\U0000231B',
+ u':hourglass_flowing_sand:': u'\U000023F3',
+ u':house:': u'\U0001F3E0',
+ u':house_buildings:': u'\U0001F3D8',
+ u':house_with_garden:': u'\U0001F3E1',
+ u':hugging_face:': u'\U0001F917',
+ u':100:': u'\U0001F4AF',
+ u':hushed:': u'\U0001F62F',
+ u':ice_cream:': u'\U0001F368',
+ u':ice_hockey_stick_and_puck:': u'\U0001F3D2',
+ u':ice_skate:': u'\U000026F8',
+ u':imp:': u'\U0001F47F',
+ u':inbox_tray:': u'\U0001F4E5',
+ u':incoming_envelope:': u'\U0001F4E8',
+ u':information_desk_person:': u'\U0001F481',
+ u':information_source:': u'\U00002139',
+ u':capital_abcd:': u'\U0001F520',
+ u':abc:': u'\U0001F524',
+ u':abcd:': u'\U0001F521',
+ u':1234:': u'\U0001F522',
+ u':symbols:': u'\U0001F523',
+ u':izakaya_lantern:': u'\U0001F3EE',
+ u':lantern:': u'\U0001F3EE',
+ u':jack_o_lantern:': u'\U0001F383',
+ u':japanese_castle:': u'\U0001F3EF',
+ u':dolls:': u'\U0001F38E',
+ u':japanese_goblin:': u'\U0001F47A',
+ u':japanese_ogre:': u'\U0001F479',
+ u':post_office:': u'\U0001F3E3',
+ u':beginner:': u'\U0001F530',
+ u':jeans:': u'\U0001F456',
+ u':joystick:': u'\U0001F579',
+ u':kaaba:': u'\U0001F54B',
+ u':key:': u'\U0001F511',
+ u':keyboard:': u'\U00002328',
+ u':keycap_asterisk:': u'\U0000002A\U000020E3',
+ u':keycap_digit_eight:': u'\U00000038\U000020E3',
+ u':keycap_digit_five:': u'\U00000035\U000020E3',
+ u':keycap_digit_four:': u'\U00000034\U000020E3',
+ u':keycap_digit_nine:': u'\U00000039\U000020E3',
+ u':keycap_digit_one:': u'\U00000031\U000020E3',
+ u':keycap_digit_seven:': u'\U00000037\U000020E3',
+ u':keycap_digit_six:': u'\U00000036\U000020E3',
+ u':keycap_digit_three:': u'\U00000033\U000020E3',
+ u':keycap_digit_two:': u'\U00000032\U000020E3',
+ u':keycap_digit_zero:': u'\U00000030\U000020E3',
+ u':keycap_number_sign:': u'\U00000023\U000020E3',
+ u':keycap_ten:': u'\U0001F51F',
+ u':kimono:': u'\U0001F458',
+ u':couplekiss:': u'\U0001F48F',
+ u':kiss:': u'\U0001F48B',
+ u':kissing_cat:': u'\U0001F63D',
+ u':kissing:': u'\U0001F617',
+ u':kissing_closed_eyes:': u'\U0001F61A',
+ u':kissing_smiling_eyes:': u'\U0001F619',
+ u':koala:': u'\U0001F428',
+ u':label:': u'\U0001F3F7',
+ u':beetle:': u'\U0001F41E',
+ u':large_blue_circle:': u'\U0001F535',
+ u':large_blue_diamond:': u'\U0001F537',
+ u':large_orange_diamond:': u'\U0001F536',
+ u':red_circle:': u'\U0001F534',
+ u':last_quarter_moon:': u'\U0001F317',
+ u':last_quarter_moon_with_face:': u'\U0001F31C',
+ u':latin_cross:': u'\U0000271D',
+ u':leaves:': u'\U0001F343',
+ u':ledger:': u'\U0001F4D2',
+ u':mag:': u'\U0001F50D',
+ u':left_luggage:': u'\U0001F6C5',
+ u':left_right_arrow:': u'\U00002194',
+ u':leftwards_arrow_with_hook:': u'\U000021A9',
+ u':arrow_left:': u'\U00002B05',
+ u':lemon:': u'\U0001F34B',
+ u':leo:': u'\U0000264C',
+ u':leopard:': u'\U0001F406',
+ u':level_slider:': u'\U0001F39A',
+ u':libra:': u'\U0000264E',
+ u':light_rail:': u'\U0001F688',
+ u':link:': u'\U0001F517',
+ u':linked_paperclips:': u'\U0001F587',
+ u':lion_face:': u'\U0001F981',
+ u':lipstick:': u'\U0001F484',
+ u':lock:': u'\U0001F512',
+ u':lock_with_ink_pen:': u'\U0001F50F',
+ u':lollipop:': u'\U0001F36D',
+ u':sob:': u'\U0001F62D',
+ u':love_hotel:': u'\U0001F3E9',
+ u':love_letter:': u'\U0001F48C',
+ u':low_brightness:': u'\U0001F505',
+ u':lower_left_ballpoint_pen:': u'\U0001F58A',
+ u':lower_left_crayon:': u'\U0001F58D',
+ u':lower_left_fountain_pen:': u'\U0001F58B',
+ u':lower_left_paintbrush:': u'\U0001F58C',
+ u':mahjong:': u'\U0001F004',
+ u':man:': u'\U0001F468',
+ u':couple:': u'\U0001F46B',
+ u':man_in_business_suit_levitating:': u'\U0001F574',
+ u':man_with_gua_pi_mao:': u'\U0001F472',
+ u':man_with_turban:': u'\U0001F473',
+ u':mans_shoe:': u'\U0001F45E',
+ u':shoe:': u'\U0001F45E',
+ u':mantelpiece_clock:': u'\U0001F570',
+ u':maple_leaf:': u'\U0001F341',
+ u':meat_on_bone:': u'\U0001F356',
+ u':black_circle:': u'\U000026AB',
+ u':white_circle:': u'\U000026AA',
+ u':melon:': u'\U0001F348',
+ u':memo:': u'\U0001F4DD',
+ u':pencil:': u'\U0001F4DD',
+ u':menorah_with_nine_branches:': u'\U0001F54E',
+ u':mens:': u'\U0001F6B9',
+ u':metro:': u'\U0001F687',
+ u':microphone:': u'\U0001F3A4',
+ u':microscope:': u'\U0001F52C',
+ u':military_medal:': u'\U0001F396',
+ u':milky_way:': u'\U0001F30C',
+ u':minibus:': u'\U0001F690',
+ u':minidisc:': u'\U0001F4BD',
+ u':iphone:': u'\U0001F4F1',
+ u':mobile_phone_off:': u'\U0001F4F4',
+ u':calling:': u'\U0001F4F2',
+ u':money__mouth_face:': u'\U0001F911',
+ u':moneybag:': u'\U0001F4B0',
+ u':money_with_wings:': u'\U0001F4B8',
+ u':monkey:': u'\U0001F412',
+ u':monkey_face:': u'\U0001F435',
+ u':monorail:': u'\U0001F69D',
+ u':rice_scene:': u'\U0001F391',
+ u':mosque:': u'\U0001F54C',
+ u':motor_boat:': u'\U0001F6E5',
+ u':motorway:': u'\U0001F6E3',
+ u':mount_fuji:': u'\U0001F5FB',
+ u':mountain:': u'\U000026F0',
+ u':mountain_bicyclist:': u'\U0001F6B5',
+ u':mountain_cableway:': u'\U0001F6A0',
+ u':mountain_railway:': u'\U0001F69E',
+ u':mouse2:': u'\U0001F401',
+ u':mouse:': u'\U0001F42D',
+ u':lips:': u'\U0001F444',
+ u':movie_camera:': u'\U0001F3A5',
+ u':moyai:': u'\U0001F5FF',
+ u':notes:': u'\U0001F3B6',
+ u':mushroom:': u'\U0001F344',
+ u':musical_keyboard:': u'\U0001F3B9',
+ u':musical_note:': u'\U0001F3B5',
+ u':musical_score:': u'\U0001F3BC',
+ u':nail_care:': u'\U0001F485',
+ u':name_badge:': u'\U0001F4DB',
+ u':national_park:': u'\U0001F3DE',
+ u':necktie:': u'\U0001F454',
+ u':ab:': u'\U0001F18E',
+ u':negative_squared_cross_mark:': u'\U0000274E',
+ u':a:': u'\U0001F170',
+ u':b:': u'\U0001F171',
+ u':o2:': u'\U0001F17E',
+ u':parking:': u'\U0001F17F',
+ u':nerd_face:': u'\U0001F913',
+ u':neutral_face:': u'\U0001F610',
+ u':new_moon:': u'\U0001F311',
+ u':honeybee:': u'\U0001F41D',
+ u':new_moon_with_face:': u'\U0001F31A',
+ u':newspaper:': u'\U0001F4F0',
+ u':night_with_stars:': u'\U0001F303',
+ u':no_bicycles:': u'\U0001F6B3',
+ u':no_entry:': u'\U000026D4',
+ u':no_entry_sign:': u'\U0001F6AB',
+ u':no_mobile_phones:': u'\U0001F4F5',
+ u':underage:': u'\U0001F51E',
+ u':no_pedestrians:': u'\U0001F6B7',
+ u':no_smoking:': u'\U0001F6AD',
+ u':non__potable_water:': u'\U0001F6B1',
+ u':arrow_upper_right:': u'\U00002197',
+ u':arrow_upper_left:': u'\U00002196',
+ u':nose:': u'\U0001F443',
+ u':notebook:': u'\U0001F4D3',
+ u':notebook_with_decorative_cover:': u'\U0001F4D4',
+ u':nut_and_bolt:': u'\U0001F529',
+ u':octopus:': u'\U0001F419',
+ u':oden:': u'\U0001F362',
+ u':office:': u'\U0001F3E2',
+ u':oil_drum:': u'\U0001F6E2',
+ u':ok_hand:': u'\U0001F44C',
+ u':old_key:': u'\U0001F5DD',
+ u':older_man:': u'\U0001F474',
+ u':older_woman:': u'\U0001F475',
+ u':om_symbol:': u'\U0001F549',
+ u':on:': u'\U0001F51B',
+ u':oncoming_automobile:': u'\U0001F698',
+ u':oncoming_bus:': u'\U0001F68D',
+ u':oncoming_police_car:': u'\U0001F694',
+ u':oncoming_taxi:': u'\U0001F696',
+ u':book:': u'\U0001F4D6',
+ u':open_book:': u'\U0001F4D6',
+ u':open_file_folder:': u'\U0001F4C2',
+ u':open_hands:': u'\U0001F450',
+ u':unlock:': u'\U0001F513',
+ u':mailbox_with_no_mail:': u'\U0001F4ED',
+ u':mailbox_with_mail:': u'\U0001F4EC',
+ u':ophiuchus:': u'\U000026CE',
+ u':cd:': u'\U0001F4BF',
+ u':orange_book:': u'\U0001F4D9',
+ u':orthodox_cross:': u'\U00002626',
+ u':outbox_tray:': u'\U0001F4E4',
+ u':ox:': u'\U0001F402',
+ u':package:': u'\U0001F4E6',
+ u':page_facing_up:': u'\U0001F4C4',
+ u':page_with_curl:': u'\U0001F4C3',
+ u':pager:': u'\U0001F4DF',
+ u':palm_tree:': u'\U0001F334',
+ u':panda_face:': u'\U0001F43C',
+ u':paperclip:': u'\U0001F4CE',
+ u':part_alternation_mark:': u'\U0000303D',
+ u':tada:': u'\U0001F389',
+ u':passenger_ship:': u'\U0001F6F3',
+ u':passport_control:': u'\U0001F6C2',
+ u':feet:': u'\U0001F43E',
+ u':paw_prints:': u'\U0001F43E',
+ u':peace_symbol:': u'\U0000262E',
+ u':peach:': u'\U0001F351',
+ u':pear:': u'\U0001F350',
+ u':walking:': u'\U0001F6B6',
+ u':pencil2:': u'\U0000270F',
+ u':penguin:': u'\U0001F427',
+ u':pensive:': u'\U0001F614',
+ u':performing_arts:': u'\U0001F3AD',
+ u':persevere:': u'\U0001F623',
+ u':bow:': u'\U0001F647',
+ u':person_frowning:': u'\U0001F64D',
+ u':raised_hands:': u'\U0001F64C',
+ u':person_with_ball:': u'\U000026F9',
+ u':person_with_blond_hair:': u'\U0001F471',
+ u':pray:': u'\U0001F64F',
+ u':person_with_pouting_face:': u'\U0001F64E',
+ u':computer:': u'\U0001F4BB',
+ u':pick:': u'\U000026CF',
+ u':pig2:': u'\U0001F416',
+ u':pig:': u'\U0001F437',
+ u':pig_nose:': u'\U0001F43D',
+ u':hankey:': u'\U0001F4A9',
+ u':poop:': u'\U0001F4A9',
+ u':shit:': u'\U0001F4A9',
+ u':pill:': u'\U0001F48A',
+ u':bamboo:': u'\U0001F38D',
+ u':pineapple:': u'\U0001F34D',
+ u':pisces:': u'\U00002653',
+ u':gun:': u'\U0001F52B',
+ u':place_of_worship:': u'\U0001F6D0',
+ u':black_joker:': u'\U0001F0CF',
+ u':police_car:': u'\U0001F693',
+ u':rotating_light:': u'\U0001F6A8',
+ u':cop:': u'\U0001F46E',
+ u':poodle:': u'\U0001F429',
+ u':popcorn:': u'\U0001F37F',
+ u':postal_horn:': u'\U0001F4EF',
+ u':postbox:': u'\U0001F4EE',
+ u':stew:': u'\U0001F372',
+ u':potable_water:': u'\U0001F6B0',
+ u':pouch:': u'\U0001F45D',
+ u':poultry_leg:': u'\U0001F357',
+ u':pouting_cat:': u'\U0001F63E',
+ u':rage:': u'\U0001F621',
+ u':prayer_beads:': u'\U0001F4FF',
+ u':princess:': u'\U0001F478',
+ u':printer:': u'\U0001F5A8',
+ u':loudspeaker:': u'\U0001F4E2',
+ u':purple_heart:': u'\U0001F49C',
+ u':purse:': u'\U0001F45B',
+ u':pushpin:': u'\U0001F4CC',
+ u':put_litter_in_its_place:': u'\U0001F6AE',
+ u':rabbit2:': u'\U0001F407',
+ u':rabbit:': u'\U0001F430',
+ u':racing_car:': u'\U0001F3CE',
+ u':racing_motorcycle:': u'\U0001F3CD',
+ u':radio:': u'\U0001F4FB',
+ u':radio_button:': u'\U0001F518',
+ u':radioactive_sign:': u'\U00002622',
+ u':railway_car:': u'\U0001F683',
+ u':railway_track:': u'\U0001F6E4',
+ u':rainbow:': u'\U0001F308',
+ u':fist:': u'\U0000270A',
+ u':hand:': u'\U0000270B',
+ u':raised_hand:': u'\U0000270B',
+ u':raised_hand_with_fingers_splayed:': u'\U0001F590',
+ u':raised_hand_with_part_between_middle_and_ring_fingers:': u'\U0001F596',
+ u':ram:': u'\U0001F40F',
+ u':rat:': u'\U0001F400',
+ u':blue_car:': u'\U0001F699',
+ u':apple:': u'\U0001F34E',
+ u':registered:': u'\U000000AE',
+ u':relieved:': u'\U0001F60C',
+ u':reminder_ribbon:': u'\U0001F397',
+ u':restroom:': u'\U0001F6BB',
+ u':reversed_hand_with_middle_finger_extended:': u'\U0001F595',
+ u':revolving_hearts:': u'\U0001F49E',
+ u':ribbon:': u'\U0001F380',
+ u':rice_ball:': u'\U0001F359',
+ u':rice_cracker:': u'\U0001F358',
+ u':mag_right:': u'\U0001F50E',
+ u':right_anger_bubble:': u'\U0001F5EF',
+ u':arrow_right_hook:': u'\U000021AA',
+ u':ring:': u'\U0001F48D',
+ u':sweet_potato:': u'\U0001F360',
+ u':robot_face:': u'\U0001F916',
+ u':rocket:': u'\U0001F680',
+ u':rolled__up_newspaper:': u'\U0001F5DE',
+ u':roller_coaster:': u'\U0001F3A2',
+ u':rooster:': u'\U0001F413',
+ u':rose:': u'\U0001F339',
+ u':rosette:': u'\U0001F3F5',
+ u':round_pushpin:': u'\U0001F4CD',
+ u':rowboat:': u'\U0001F6A3',
+ u':rugby_football:': u'\U0001F3C9',
+ u':runner:': u'\U0001F3C3',
+ u':running:': u'\U0001F3C3',
+ u':running_shirt_with_sash:': u'\U0001F3BD',
+ u':sagittarius:': u'\U00002650',
+ u':boat:': u'\U000026F5',
+ u':sailboat:': u'\U000026F5',
+ u':sake:': u'\U0001F376',
+ u':satellite:': u'\U0001F4E1',
+ u':saxophone:': u'\U0001F3B7',
+ u':scales:': u'\U00002696',
+ u':school:': u'\U0001F3EB',
+ u':school_satchel:': u'\U0001F392',
+ u':scorpion:': u'\U0001F982',
+ u':scorpius:': u'\U0000264F',
+ u':scroll:': u'\U0001F4DC',
+ u':seat:': u'\U0001F4BA',
+ u':see_no_evil:': u'\U0001F648',
+ u':seedling:': u'\U0001F331',
+ u':shamrock:': u'\U00002618',
+ u':shaved_ice:': u'\U0001F367',
+ u':sheep:': u'\U0001F411',
+ u':shield:': u'\U0001F6E1',
+ u':shinto_shrine:': u'\U000026E9',
+ u':ship:': u'\U0001F6A2',
+ u':stars:': u'\U0001F320',
+ u':shopping_bags:': u'\U0001F6CD',
+ u':cake:': u'\U0001F370',
+ u':shower:': u'\U0001F6BF',
+ u':sign_of_the_horns:': u'\U0001F918',
+ u':japan:': u'\U0001F5FE',
+ u':six_pointed_star:': u'\U0001F52F',
+ u':ski:': u'\U0001F3BF',
+ u':skier:': u'\U000026F7',
+ u':skull:': u'\U0001F480',
+ u':skull_and_crossbones:': u'\U00002620',
+ u':sleeping_accommodation:': u'\U0001F6CC',
+ u':sleeping:': u'\U0001F634',
+ u':zzz:': u'\U0001F4A4',
+ u':sleepy:': u'\U0001F62A',
+ u':sleuth_or_spy:': u'\U0001F575',
+ u':pizza:': u'\U0001F355',
+ u':slightly_frowning_face:': u'\U0001F641',
+ u':slightly_smiling_face:': u'\U0001F642',
+ u':slot_machine:': u'\U0001F3B0',
+ u':small_airplane:': u'\U0001F6E9',
+ u':small_blue_diamond:': u'\U0001F539',
+ u':small_orange_diamond:': u'\U0001F538',
+ u':heart_eyes_cat:': u'\U0001F63B',
+ u':smiley_cat:': u'\U0001F63A',
+ u':innocent:': u'\U0001F607',
+ u':heart_eyes:': u'\U0001F60D',
+ u':smiling_imp:': u'\U0001F608',
+ u':smiley:': u'\U0001F603',
+ u':sweat_smile:': u'\U0001F605',
+ u':smile:': u'\U0001F604',
+ u':laughing:': u'\U0001F606',
+ u':satisfied:': u'\U0001F606',
+ u':blush:': u'\U0001F60A',
+ u':sunglasses:': u'\U0001F60E',
+ u':smirk:': u'\U0001F60F',
+ u':smoking:': u'\U0001F6AC',
+ u':snail:': u'\U0001F40C',
+ u':snake:': u'\U0001F40D',
+ u':snow_capped_mountain:': u'\U0001F3D4',
+ u':snowboarder:': u'\U0001F3C2',
+ u':snowflake:': u'\U00002744',
+ u':snowman:': u'\U00002603',
+ u':soccer:': u'\U000026BD',
+ u':icecream:': u'\U0001F366',
+ u':soon:': u'\U0001F51C',
+ u':arrow_lower_right:': u'\U00002198',
+ u':arrow_lower_left:': u'\U00002199',
+ u':spaghetti:': u'\U0001F35D',
+ u':sparkle:': u'\U00002747',
+ u':sparkles:': u'\U00002728',
+ u':sparkling_heart:': u'\U0001F496',
+ u':speak_no_evil:': u'\U0001F64A',
+ u':speaker:': u'\U0001F508',
+ u':mute:': u'\U0001F507',
+ u':sound:': u'\U0001F509',
+ u':loud_sound:': u'\U0001F50A',
+ u':speaking_head_in_silhouette:': u'\U0001F5E3',
+ u':speech_balloon:': u'\U0001F4AC',
+ u':speedboat:': u'\U0001F6A4',
+ u':spider:': u'\U0001F577',
+ u':spider_web:': u'\U0001F578',
+ u':spiral_calendar_pad:': u'\U0001F5D3',
+ u':spiral_note_pad:': u'\U0001F5D2',
+ u':shell:': u'\U0001F41A',
+ u':sweat_drops:': u'\U0001F4A6',
+ u':sports_medal:': u'\U0001F3C5',
+ u':whale:': u'\U0001F433',
+ u':u5272:': u'\U0001F239',
+ u':u5408:': u'\U0001F234',
+ u':u55b6:': u'\U0001F23A',
+ u':u6307:': u'\U0001F22F',
+ u':u6708:': u'\U0001F237',
+ u':u6709:': u'\U0001F236',
+ u':u6e80:': u'\U0001F235',
+ u':u7121:': u'\U0001F21A',
+ u':u7533:': u'\U0001F238',
+ u':u7981:': u'\U0001F232',
+ u':u7a7a:': u'\U0001F233',
+ u':cl:': u'\U0001F191',
+ u':cool:': u'\U0001F192',
+ u':free:': u'\U0001F193',
+ u':id:': u'\U0001F194',
+ u':koko:': u'\U0001F201',
+ u':sa:': u'\U0001F202',
+ u':new:': u'\U0001F195',
+ u':ng:': u'\U0001F196',
+ u':ok:': u'\U0001F197',
+ u':sos:': u'\U0001F198',
+ u':up:': u'\U0001F199',
+ u':vs:': u'\U0001F19A',
+ u':stadium:': u'\U0001F3DF',
+ u':star_and_crescent:': u'\U0000262A',
+ u':star_of_david:': u'\U00002721',
+ u':station:': u'\U0001F689',
+ u':statue_of_liberty:': u'\U0001F5FD',
+ u':steam_locomotive:': u'\U0001F682',
+ u':ramen:': u'\U0001F35C',
+ u':stopwatch:': u'\U000023F1',
+ u':straight_ruler:': u'\U0001F4CF',
+ u':strawberry:': u'\U0001F353',
+ u':studio_microphone:': u'\U0001F399',
+ u':partly_sunny:': u'\U000026C5',
+ u':sun_with_face:': u'\U0001F31E',
+ u':sunflower:': u'\U0001F33B',
+ u':sunrise:': u'\U0001F305',
+ u':sunrise_over_mountains:': u'\U0001F304',
+ u':city_sunrise:': u'\U0001F307',
+ u':surfer:': u'\U0001F3C4',
+ u':sushi:': u'\U0001F363',
+ u':suspension_railway:': u'\U0001F69F',
+ u':swimmer:': u'\U0001F3CA',
+ u':synagogue:': u'\U0001F54D',
+ u':syringe:': u'\U0001F489',
+ u':shirt:': u'\U0001F455',
+ u':tshirt:': u'\U0001F455',
+ u':table_tennis_paddle_and_ball:': u'\U0001F3D3',
+ u':taco:': u'\U0001F32E',
+ u':tanabata_tree:': u'\U0001F38B',
+ u':tangerine:': u'\U0001F34A',
+ u':taurus:': u'\U00002649',
+ u':taxi:': u'\U0001F695',
+ u':tea:': u'\U0001F375',
+ u':calendar:': u'\U0001F4C6',
+ u':telephone_receiver:': u'\U0001F4DE',
+ u':telescope:': u'\U0001F52D',
+ u':tv:': u'\U0001F4FA',
+ u':tennis:': u'\U0001F3BE',
+ u':tent:': u'\U000026FA',
+ u':thermometer:': u'\U0001F321',
+ u':thinking_face:': u'\U0001F914',
+ u':thought_balloon:': u'\U0001F4AD',
+ u':three_button_mouse:': u'\U0001F5B1',
+ u':+1:': u'\U0001F44D',
+ u':thumbsup:': u'\U0001F44D',
+ u':__1:': u'\U0001F44E',
+ u':-1:': u'\U0001F44E',
+ u':thumbsdown:': u'\U0001F44E',
+ u':thunder_cloud_and_rain:': u'\U000026C8',
+ u':ticket:': u'\U0001F3AB',
+ u':tiger2:': u'\U0001F405',
+ u':tiger:': u'\U0001F42F',
+ u':timer_clock:': u'\U000023F2',
+ u':tired_face:': u'\U0001F62B',
+ u':toilet:': u'\U0001F6BD',
+ u':tokyo_tower:': u'\U0001F5FC',
+ u':tomato:': u'\U0001F345',
+ u':tongue:': u'\U0001F445',
+ u':tophat:': u'\U0001F3A9',
+ u':top:': u'\U0001F51D',
+ u':trackball:': u'\U0001F5B2',
+ u':tractor:': u'\U0001F69C',
+ u':tm:': u'\U00002122',
+ u':train2:': u'\U0001F686',
+ u':tram:': u'\U0001F68A',
+ u':train:': u'\U0001F68B',
+ u':triangular_flag_on_post:': u'\U0001F6A9',
+ u':triangular_ruler:': u'\U0001F4D0',
+ u':trident:': u'\U0001F531',
+ u':trolleybus:': u'\U0001F68E',
+ u':trophy:': u'\U0001F3C6',
+ u':tropical_drink:': u'\U0001F379',
+ u':tropical_fish:': u'\U0001F420',
+ u':trumpet:': u'\U0001F3BA',
+ u':tulip:': u'\U0001F337',
+ u':turkey:': u'\U0001F983',
+ u':turtle:': u'\U0001F422',
+ u':twisted_rightwards_arrows:': u'\U0001F500',
+ u':two_hearts:': u'\U0001F495',
+ u':two_men_holding_hands:': u'\U0001F46C',
+ u':two_women_holding_hands:': u'\U0001F46D',
+ u':umbrella:': u'\U00002602',
+ u':umbrella_on_ground:': u'\U000026F1',
+ u':unamused:': u'\U0001F612',
+ u':unicorn_face:': u'\U0001F984',
+ u':small_red_triangle:': u'\U0001F53A',
+ u':arrow_up_small:': u'\U0001F53C',
+ u':arrow_up_down:': u'\U00002195',
+ u':upside__down_face:': u'\U0001F643',
+ u':arrow_up:': u'\U00002B06',
+ u':vertical_traffic_light:': u'\U0001F6A6',
+ u':vibration_mode:': u'\U0001F4F3',
+ u':v:': u'\U0000270C',
+ u':video_camera:': u'\U0001F4F9',
+ u':video_game:': u'\U0001F3AE',
+ u':vhs:': u'\U0001F4FC',
+ u':violin:': u'\U0001F3BB',
+ u':virgo:': u'\U0000264D',
+ u':volcano:': u'\U0001F30B',
+ u':volleyball:': u'\U0001F3D0',
+ u':waning_crescent_moon:': u'\U0001F318',
+ u':waning_gibbous_moon:': u'\U0001F316',
+ u':warning:': u'\U000026A0',
+ u':wastebasket:': u'\U0001F5D1',
+ u':watch:': u'\U0000231A',
+ u':water_buffalo:': u'\U0001F403',
+ u':wc:': u'\U0001F6BE',
+ u':ocean:': u'\U0001F30A',
+ u':watermelon:': u'\U0001F349',
+ u':waving_black_flag:': u'\U0001F3F4',
+ u':wave:': u'\U0001F44B',
+ u':waving_white_flag:': u'\U0001F3F3',
+ u':wavy_dash:': u'\U00003030',
+ u':waxing_crescent_moon:': u'\U0001F312',
+ u':moon:': u'\U0001F314',
+ u':waxing_gibbous_moon:': u'\U0001F314',
+ u':scream_cat:': u'\U0001F640',
+ u':weary:': u'\U0001F629',
+ u':wedding:': u'\U0001F492',
+ u':weight_lifter:': u'\U0001F3CB',
+ u':whale2:': u'\U0001F40B',
+ u':wheel_of_dharma:': u'\U00002638',
+ u':wheelchair:': u'\U0000267F',
+ u':point_down:': u'\U0001F447',
+ u':grey_exclamation:': u'\U00002755',
+ u':white_flower:': u'\U0001F4AE',
+ u':white_frowning_face:': u'\U00002639',
+ u':white_check_mark:': u'\U00002705',
+ u':white_large_square:': u'\U00002B1C',
+ u':point_left:': u'\U0001F448',
+ u':white_medium_small_square:': u'\U000025FD',
+ u':white_medium_square:': u'\U000025FB',
+ u':star:': u'\U00002B50',
+ u':grey_question:': u'\U00002754',
+ u':point_right:': u'\U0001F449',
+ u':white_small_square:': u'\U000025AB',
+ u':relaxed:': u'\U0000263A',
+ u':white_square_button:': u'\U0001F533',
+ u':white_sun_behind_cloud:': u'\U0001F325',
+ u':white_sun_behind_cloud_with_rain:': u'\U0001F326',
+ u':white_sun_with_small_cloud:': u'\U0001F324',
+ u':point_up_2:': u'\U0001F446',
+ u':point_up:': u'\U0000261D',
+ u':wind_blowing_face:': u'\U0001F32C',
+ u':wind_chime:': u'\U0001F390',
+ u':wine_glass:': u'\U0001F377',
+ u':wink:': u'\U0001F609',
+ u':wolf:': u'\U0001F43A',
+ u':woman:': u'\U0001F469',
+ u':dancers:': u'\U0001F46F',
+ u':boot:': u'\U0001F462',
+ u':womans_clothes:': u'\U0001F45A',
+ u':womans_hat:': u'\U0001F452',
+ u':sandal:': u'\U0001F461',
+ u':womens:': u'\U0001F6BA',
+ u':world_map:': u'\U0001F5FA',
+ u':worried:': u'\U0001F61F',
+ u':gift:': u'\U0001F381',
+ u':wrench:': u'\U0001F527',
+ u':writing_hand:': u'\U0000270D',
+ u':yellow_heart:': u'\U0001F49B',
+ u':yin_yang:': u'\U0000262F',
+ u':zipper__mouth_face:': u'\U0001F910'
+})
+
+
+UNICODE_EMOJI = {v: k for k, v in EMOJI_UNICODE.items()}
+UNICODE_EMOJI_ALIAS = {v: k for k, v in EMOJI_ALIAS_UNICODE.items()}
diff --git a/encoding/__init__.py b/encoding/__init__.py
new file mode 100644
index 0000000..afbf7e7
--- /dev/null
+++ b/encoding/__init__.py
@@ -0,0 +1,5 @@
+from .encoding import Encoding
+
+def setup(bot):
+ n = Encoding(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/encoding/encoding.py b/encoding/encoding.py
new file mode 100644
index 0000000..bb91cbb
--- /dev/null
+++ b/encoding/encoding.py
@@ -0,0 +1,180 @@
+import discord
+from redbot.core import commands
+from redbot.core.utils.chat_formatting import pagify, box
+import binascii
+import random
+import hashlib
+from string import ascii_lowercase as lc, ascii_uppercase as uc
+
+
+
+class Encoding(getattr(commands, "Cog", object)):
+ """
+ Convert messages into fun encodings
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.table = {
+ "A": ["00", "01", "10", "11", "00", "00", "00", "01", "01", "01", "10", "10", "10", "11", "11", "11"],
+ "G": ["01", "10", "11", "00", "11", "10", "01", "11", "00", "10", "11", "00", "01", "00", "01", "10"],
+ "C": ["10", "11", "00", "01", "10", "11", "10", "10", "11", "00", "01", "11", "00", "01", "00", "01"],
+ "T": ["11", "00", "01", "10", "01", "01", "11", "00", "10", "11", "00", "01", "11", "10", "10", "00"]
+ }
+ # A = 00
+ # G = 10
+ # C = 11
+ # T = 01
+ def remove_non_ascii(self, data):
+ msg = b""
+ for char in data:
+ if char in range(0, 127):
+ msg += bytes(chr(char).encode("utf8"))
+ return msg
+
+ def search_words(self, data):
+ count = 0
+ try:
+ for char in data:
+ if ord(char) in range(47, 122):
+ count += 1
+ except TypeError:
+ for char in data:
+ if char in range(47, 122):
+ count += 1
+ try:
+ if(count/len(data)) >= 0.75:
+ return True
+ except ZeroDivisionError:
+ return False
+ return False
+
+ @commands.group(name='hash', invoke_without_command=True)
+ async def hash_cmd(self, ctx, *, txt:str):
+ """
+ MD5 Encrypt Text
+ """
+ md5 = hashlib.md5(txt.encode()).hexdigest()
+ await ctx.send('**MD5**\n'+md5)
+
+ @hash_cmd.command(name='sha1')
+ async def hash_sha1(self, ctx, *, txt:str):
+ """
+ SHA1 Encrypt Text
+ """
+ sha = hashlib.sha1(txt.encode()).hexdigest()
+ await ctx.send('**SHA1**\n'+sha)
+
+ @hash_cmd.command(name='sha256')
+ async def hash_sha256(self, ctx, *, txt:str):
+ """
+ SHA256 Encrypt Text
+ """
+ sha256 = hashlib.sha256(txt.encode()).hexdigest()
+ await ctx.send('**SHA256**\n'+sha256)
+
+ @hash_cmd.command(name='sha512')
+ async def hash_sha512(self, ctx, *, txt:str):
+ """
+ SHA512 Encrypt Text
+ """
+ sha512 = hashlib.sha512(txt.encode()).hexdigest()
+ await ctx.send('**SHA512**\n'+sha512)
+
+
+ @commands.group(name="encode")
+ async def _encode(self, ctx: commands.Context):
+ """Encode a string."""
+ pass
+
+ @commands.group(name="decode")
+ async def _decode(self, ctx: commands.Context):
+ """Decode a string."""
+ pass
+
+ @_encode.command(name="binary")
+ async def encode_binary(self, ctx: commands.Context, *, message: str):
+ """
+ Encode text into binary sequences of 8
+ """
+ ascii_bin = ' '.join(bin(x)[2:].zfill(8) for x in message.encode('UTF-8'))
+ await ctx.send(ascii_bin)
+
+ @_decode.command(name="binary")
+ async def decode_binary(self, ctx: commands.Context, *, message: str):
+ """
+ Decide binary sequences of 8
+ """
+ msg = message.replace(" ", "")
+ bin_ascii = "".join([chr(int(msg[i:i+8],2)) for i in range(0,len(msg),8)])
+ await ctx.send(bin_ascii)
+
+ def rot_encode(self, n):
+ """
+ https://stackoverflow.com/questions/47580337/short-rot-n-decode-function-in-python
+ """
+ lookup = str.maketrans(lc + uc, lc[n:] + lc[:n] + uc[n:] + uc[:n])
+ return lambda s: s.translate(lookup)
+
+ @_encode.command(name="rot", aliases=["caeser"])
+ async def caeser_encode(self, ctx: commands.Context, rot_key:int, *, message:str):
+ """
+ Encode a caeser cipher message with specified key
+ """
+ await ctx.send(self.rot_encode(rot_key)(message))
+
+ @_decode.command(name="rot", aliases=["caeser"])
+ async def caeser_decode(self, ctx: commands.Context, rot_key:int, *, message:str):
+ """
+ Decode a caeser cipher message with specified key
+ """
+ await ctx.send(self.rot_encode(-rot_key)(message))
+
+
+ @_encode.command(name="dna")
+ async def dna_encode(self, ctx: commands.Context, *, message: str):
+ """
+ Encodes a string into DNA 4 byte ACGT format
+ """
+ dna = {"00": "A", "01": "T", "10": "G", "11": "C"}
+ message = message.strip(" ")
+ binary = ' '.join(bin(x)[2:].zfill(8) for x in message.encode('UTF-8')).replace(" ", "")
+ binlist = [binary[i:i+2] for i in range(0, len(binary), 2)]
+ newmsg = ""
+ count = 0
+ for letter in binlist:
+ newmsg += dna[letter]
+ count += 1
+ if count == 4:
+ count = 0
+ newmsg += " "
+ await ctx.send(newmsg)
+
+
+ @_decode.command(name="dna")
+ async def dna_decode(self ,ctx: commands.Context, *, message: str):
+ """
+ Decodes a string of DNA in 4 byte ACGT format.
+ """
+ message = message.strip(" ")
+ mapping = {}
+ replacement = ""
+ for i in range(0, 16):
+ skip = [" ", "\n", "\r"]
+ for character in message:
+ if character in skip:
+ continue
+ replacement += self.table[character][i]
+ try:
+ n = int("0b" + replacement, 2)
+ mapping[i] = n.to_bytes((n.bit_length() + 7) // 8, 'big').decode("utf8", "ignore")
+ except TypeError:
+ pass
+ replacement = ""
+ num = 1
+ new_msg = "Possible solutions:\n"
+ for result in mapping.values():
+ new_msg += str(num) + ": " + result + "\n"
+ num += 1
+ for page in pagify(new_msg, shorten_by=20):
+ await ctx.send(f"```\n{page}\n```")
diff --git a/encoding/info.json b/encoding/info.json
new file mode 100644
index 0000000..460e354
--- /dev/null
+++ b/encoding/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"DNA and binary encoding/decoding and hashing of messages",
+ "install_msg":"Do `[p]encode`, `[p]decode` or `[p]help hash` to see available commands.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"encoding",
+ "permissions":[],
+ "requirements":[],
+ "short":"General commands",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/faces/__init__.py b/faces/__init__.py
new file mode 100644
index 0000000..4a02834
--- /dev/null
+++ b/faces/__init__.py
@@ -0,0 +1,4 @@
+from .faces import Faces
+
+def setup(bot):
+ bot.add_cog(Faces(bot))
\ No newline at end of file
diff --git a/faces/data/CIAJapaneseStyleFaces.json b/faces/data/CIAJapaneseStyleFaces.json
new file mode 100644
index 0000000..3cac95e
--- /dev/null
+++ b/faces/data/CIAJapaneseStyleFaces.json
@@ -0,0 +1,429 @@
+[
+ "¢‿¢",
+ "©¿© o",
+ "ª{•̃̾_•̃̾}ª",
+ "¬_¬",
+ "¯\(º_o)/¯",
+ "¯\\(º o)/¯",
+ "¯\\_(⊙︿⊙)_/¯",
+ "¯\\_(ツ)_/¯",
+ "°ω°",
+ "°Д°",
+ "°‿‿°",
+ "°ﺑ°",
+ "´ ▽ ` )ノ",
+ "¿ⓧ_ⓧﮌ",
+ "Ò,ó",
+ "ó‿ó",
+ "ô⌐ô",
+ "ôヮô",
+ "ŎםŎ",
+ "ŏﺡó",
+ "ʕ•̫͡•ʔ",
+ "ʕ•ᴥ•ʔ",
+ "ʘ‿ʘ",
+ "˚•_•˚",
+ "˚⌇˚",
+ "˚▱˚",
+ "̿ ̿̿'̿'\\̵͇̿̿\\=(•̪●)=/̵͇̿̿/'̿̿ ̿ ̿ ̿",
+ "͡° ͜ʖ ͡°",
+ "Σ ◕ ◡ ◕",
+ "Σ (゚Д゚;)",
+ "Σ(゚Д゚;≡;゚д゚)",
+ "Σ(゚Д゚ )",
+ "Σ(||゚Д゚)",
+ "Φ,Φ",
+ "δﺡό",
+ "σ_σ",
+ "д_д",
+ "ф_ф",
+ "щ(゚Д゚щ)",
+ "щ(ಠ益ಠщ)",
+ "щ(ಥДಥщ)",
+ "Ծ_Ծ",
+ "أ‿أ",
+ "ب_ب",
+ "ح˚௰˚づ",
+ "ح˚ᆺ˚ว",
+ "حᇂﮌᇂ)",
+ "٩๏̯͡๏۶",
+ "٩๏̯͡๏)۶",
+ "٩◔̯◔۶",
+ "٩(×̯×)۶",
+ "٩(̾●̮̮̃̾•̃̾)۶",
+ "٩(͡๏̯͡๏)۶",
+ "٩(͡๏̯ ͡๏)۶",
+ "٩(ಥ_ಥ)۶",
+ "٩(•̮̮̃•̃)۶",
+ "٩(●̮̮̃•̃)۶",
+ "٩(●̮̮̃●̃)۶",
+ "٩(。͡•‿•。)۶",
+ "٩(-̮̮̃•̃)۶",
+ "٩(-̮̮̃-̃)۶",
+ "۞_۞",
+ "۞_۟۞",
+ "۹ↁﮌↁ",
+ "۹⌤_⌤۹",
+ "॓_॔",
+ "१✌◡✌५",
+ "१|˚–˚|५",
+ "ਉ_ਉ",
+ "ଘ_ଘ",
+ "இ_இ",
+ "ఠ_ఠ",
+ "రృర",
+ "ಠ¿ಠi",
+ "ಠ‿ಠ",
+ "ಠ⌣ಠ",
+ "ಠ╭╮ಠ",
+ "ಠ▃ಠ",
+ "ಠ◡ಠ",
+ "ಠ益ಠ",
+ "ಠ益ಠ",
+ "ಠ︵ಠ凸",
+ "ಠ , ಥ",
+ "ಠ.ಠ",
+ "ಠoಠ",
+ "ಠ_ృ",
+ "ಠ_ಠ",
+ "ಠ_๏",
+ "ಠ~ಠ",
+ "ಡ_ಡ",
+ "ತಎತ",
+ "ತ_ತ",
+ "ಥдಥ",
+ "ಥ‿ಥ",
+ "ಥ⌣ಥ",
+ "ಥ◡ಥ",
+ "ಥ﹏ಥ",
+ "ಥ_ಥ",
+ "ಭ_ಭ",
+ "ರ_ರ",
+ "ಸ , ໖",
+ "ಸ_ಸ",
+ "ക_ക",
+ "อ้_อ้",
+ "อ_อ",
+ "โ๏௰๏ใ ื",
+ "๏̯͡๏﴿",
+ "๏̯͡๏",
+ "๏̯͡๏﴿",
+ "๏[-ิิ_•ิ]๏",
+ "๏_๏",
+ "໖_໖",
+ "༺‿༻",
+ "ლ(´ڡ`ლ)",
+ "ლ(́◉◞౪◟◉‵ლ)",
+ "ლ(ಠ益ಠლ)",
+ "ლ(╹◡╹ლ)",
+ "ლ(◉◞౪◟◉‵ლ)",
+ "ლ,ᔑ•ﺪ͟͠•ᔐ.ლ",
+ "ᄽὁȍ ̪ őὀᄿ",
+ "ᕕ( ᐛ )ᕗ",
+ "ᕙ(⇀‸↼‶)ᕗ",
+ "ᕦ(ò_óˇ)ᕤ",
+ "ᶘ ᵒᴥᵒᶅ",
+ "‘︿’",
+ "•▱•",
+ "•✞_✞•",
+ "•ﺑ•",
+ "•(⌚_⌚)•",
+ "•_•)",
+ "‷̗ↂ凸ↂ‴̖",
+ "‹•.•›",
+ "‹› ‹(•¿•)› ‹›",
+ "‹(ᵒᴥᵒ)›",
+ "‹(•¿•)›",
+ "ↁ_ↁ",
+ "⇎_⇎",
+ "∩(︶▽︶)∩",
+ "∩( ・ω・)∩",
+ "≖‿≖",
+ "≧ヮ≦",
+ "⊂•⊃_⊂•⊃",
+ "⊂⌒~⊃。Д。)⊃",
+ "⊂(◉‿◉)つ",
+ "⊂(゚Д゚,,⊂⌒`つ",
+ "⊙ω⊙",
+ "⊙▂⊙",
+ "⊙▃⊙",
+ "⊙△⊙",
+ "⊙︿⊙",
+ "⊙﹏⊙",
+ "⊙0⊙",
+ "⊛ठ̯⊛",
+ "⋋ō_ō`",
+ "━━━ヽ(ヽ(゚ヽ(゚∀ヽ(゚∀゚ヽ(゚∀゚)ノ゚∀゚)ノ∀゚)ノ゚)ノ)ノ━━━",
+ "┌∩┐(◕_◕)┌∩┐",
+ "┌( ಠ_ಠ)┘",
+ "┌( ಥ_ಥ)┘",
+ "╚(•⌂•)╝",
+ "╭╮╭╮☜{•̃̾_•̃̾}☞╭╮╭╮",
+ "╭✬⌢✬╮",
+ "╮(─▽─)╭",
+ "╯‵Д′)╯彡┻━┻",
+ "╰☆╮",
+ "□_□",
+ "►_◄",
+ "◃┆◉◡◉┆▷",
+ "◉△◉",
+ "◉︵◉",
+ "◉_◉",
+ "○_○",
+ "●¿●\\ ~",
+ "●_●",
+ "◔̯◔",
+ "◔ᴗ◔",
+ "◔ ⌣ ◔",
+ "◔_◔",
+ "◕ω◕",
+ "◕‿◕",
+ "◕◡◕",
+ "◕ ◡ ◕",
+ "◖♪_♪|◗",
+ "◖|◔◡◉|◗",
+ "◘_◘",
+ "◙‿◙",
+ "◜㍕◝",
+ "◪_◪",
+ "◮_◮",
+ "☁ ☝ˆ~ˆ☂",
+ "☆¸☆",
+ "☉‿⊙",
+ "☉_☉",
+ "☐_☐",
+ "☜ق❂Ⴢ❂ق☞",
+ "☜(⌒▽⌒)☞",
+ "☜(゚ヮ゚☜)",
+ "☜-(ΘLΘ)-☞",
+ "☝☞✌",
+ "☮▁▂▃▄☾ ♛ ◡ ♛ ☽▄▃▂▁☮",
+ "☹_☹",
+ "☻_☻",
+ "☼.☼",
+ "☾˙❀‿❀˙☽",
+ "♀ح♀ヾ",
+ "♥‿♥",
+ "♥╣[-_-]╠♥",
+ "♥╭╮♥",
+ "♥◡♥",
+ "✌♫♪˙❤‿❤˙♫♪✌",
+ "✌.ʕʘ‿ʘʔ.✌",
+ "✌.|•͡˘‿•͡˘|.✌",
+ "✖‿✖",
+ "✖_✖",
+ "❐‿❑",
+ "⨀_⨀",
+ "⨀_Ꙩ",
+ "⨂_⨂",
+ "〆(・∀・@)",
+ "《〠_〠》",
+ "【•】_【•】",
+ "〠_〠",
+ "〴⋋_⋌〵",
+ "の� �の",
+ "ニガー? ━━━━━━(゚∀゚)━━━━━━ ニガー?",
+ "ペ㍕˚\\",
+ "ヽ(´ー` )ノ",
+ "ヽ(๏∀๏ )ノ",
+ "ヽ(`Д´)ノ",
+ "ヽ(o`皿′o)ノ",
+ "ヽ(`Д´)ノ",
+ "ㅎ_ㅎ",
+ "乂◜◬◝乂",
+ "凸ಠ益ಠ)凸",
+ "句_句",
+ "Ꙩ⌵Ꙩ",
+ "Ꙩ_Ꙩ",
+ "ꙩ_ꙩ",
+ "Ꙫ_Ꙫ",
+ "ꙫ_ꙫ",
+ "ꙮ_ꙮ",
+ "흫_흫",
+ "句_句",
+ "﴾͡๏̯͡๏﴿ O'RLY?",
+ "¯\\(ºдಠ)/¯",
+ "(·×·)",
+ "(⌒Д⌒)",
+ "(╹ェ╹)",
+ "(♯・∀・)⊃",
+ "( ´∀`)☆",
+ "( ´∀`)",
+ "(゜Д゜)",
+ "(・∀・)",
+ "(・A・)",
+ "(゚∀゚)",
+ "( ̄へ ̄)",
+ "( ´☣///_ゝ///☣`)",
+ "( つ Д `)",
+ "_☆( ´_⊃`)☆_",
+ "。◕‿‿◕。",
+ "。◕ ‿ ◕。",
+ "!⑈ˆ~ˆ!⑈",
+ "!(`・ω・。)",
+ "(¬‿¬)",
+ "(¬▂¬)",
+ "(¬_¬)",
+ "(°ℇ °)",
+ "(°∀°)",
+ "(´ω`)",
+ "(´◉◞౪◟◉)",
+ "(´ヘ`;)",
+ "(´・ω・`)",
+ "(´ー`)",
+ "(ʘ‿ʘ)",
+ "(ʘ_ʘ)",
+ "(˚இ˚)",
+ "(͡๏̯͡๏)",
+ "(ΘεΘ;)",
+ "(ι´Д`)ノ",
+ "(Ծ‸ Ծ)",
+ "(॓_॔)",
+ "(० ्०)",
+ "(ு८ு_ .:)",
+ "(ಠ‾ಠ)",
+ "(ಠ‿ʘ)",
+ "(ಠ‿ಠ)",
+ "(ಠ⌣ಠ)",
+ "(ಠ益ಠ ╬)",
+ "(ಠ益ಠ)",
+ "(ಠ_ృ)",
+ "(ಠ_ಠ)",
+ "(ಥ﹏ಥ)",
+ "(ಥ_ಥ)",
+ "(๏̯͡๏ )",
+ "(ღ˘⌣˘ღ) ♫・*:.。. .。.:*・",
+ "(ღ˘⌣˘ღ)",
+ "(ᵔᴥᵔ)",
+ "(•ω•)",
+ "(•‿•)",
+ "(•⊙ω⊙•)",
+ "(• ε •)",
+ "(∩▂∩)",
+ "(∩︵∩)",
+ "(∪ ◡ ∪)",
+ "(≧ω≦)",
+ "(≧◡≦)",
+ "(≧ロ≦)",
+ "(⊙ヮ⊙)",
+ "(⊙_◎)",
+ "(⋋▂⋌)",
+ "(⌐■_■)",
+ "(─‿‿─)",
+ "(┛◉Д◉)┛┻━┻",
+ "(╥_╥)",
+ "(╬ಠ益ಠ)",
+ "(╬◣д◢)",
+ "(╬ ಠ益ಠ)",
+ "(╯°□°)╯︵ ┻━┻",
+ "(╯ಊ╰)",
+ "(╯◕_◕)╯",
+ "(╯︵╰,)",
+ "(╯3╰)",
+ "(╯_╰)",
+ "(╹◡╹)凸",
+ "(▰˘◡˘▰)",
+ "(●´ω`●)",
+ "(●´∀`●)",
+ "(◑‿◐)",
+ "(◑◡◑)",
+ "(◕‿◕✿)",
+ "(◕‿◕)",
+ "(◕‿-)",
+ "(◕︵◕)",
+ "(◕ ^ ◕)",
+ "(◕_◕)",
+ "(◜௰◝)",
+ "(◡‿◡✿)",
+ "(◣_◢)",
+ "(☞゚∀゚)☞",
+ "(☞゚ヮ゚)☞",
+ "(☞゚ ∀゚ )☞",
+ "(☼◡☼)",
+ "(☼_☼)",
+ "(✌゚∀゚)☞",
+ "(✖╭╮✖)",
+ "(✪㉨✪)",
+ "(✿◠‿◠)",
+ "(✿ ♥‿♥)",
+ "( ・∀・)",
+ "( ・ัω・ั)?",
+ "( ゚∀゚)o彡゜えーりんえーりん!!",
+ "(。・_・。)",
+ "(つд`)",
+ "(づ。◕‿‿◕。)づ",
+ "(ノಠ益ಠ)ノ彡┻━┻",
+ "(ノ ◑‿◑)ノ",
+ "(ノ_・。)",
+ "(・∀・ )",
+ "(屮゚Д゚)屮",
+ "(︶ω︶)",
+ "(︶︹︺)",
+ "(ﺧ益ﺨ)",
+ "(;一_一)",
+ "(`・ω・´)”",
+ "(。◕‿‿◕。)",
+ "(。◕‿◕。)",
+ "(。◕ ‿ ◕。)",
+ "(。♥‿♥。)",
+ "(。・ω..・)っ",
+ "(・ェ-)",
+ "(ノ◕ヮ◕)ノ*:・゚✧",
+ "(゚Д゚)",
+ "(゚Д゚)y─┛~~",
+ "(゚∀゚)",
+ "(゚ヮ゚)",
+ "( ̄□ ̄)",
+ "( ̄。 ̄)",
+ "( ̄ー ̄)",
+ "( ̄(エ) ̄)",
+ "( °٢° )",
+ "( ´_ゝ`)",
+ "( ͡° ͜ʖ ͡°)",
+ "( ͡~ ͜ʖ ͡°)",
+ "( ಠ◡ಠ )",
+ "( •_•)>⌐■-■",
+ "( ゚,_ゝ゚)",
+ "( ・ิз・ิ)",
+ "( ゚д゚)、",
+ "( ^▽^)σ)~O~)",
+ "((((゜д゜;))))",
+ "(*´д`*)",
+ "(*..Д`)",
+ "(*..д`*)",
+ "(*~▽~)",
+ "(-’๏_๏’-)",
+ "(-_- )ノ",
+ "(/◔ ◡ ◔)/",
+ "(///_ಥ)",
+ "(;´Д`)",
+ "(=ω=;)",
+ "(=゜ω゜)",
+ "(>'o')>♥<('o'<)",
+ "(n˘v˘•)¬",
+ "(o´ω`o)",
+ "(V)(°,,°)(V)",
+ "(\/) (°,,°) (\/) WOOPwoopwowopwoopwoopwoop!",
+ "(^▽^)",
+ "(`・ω・´)",
+ "(~ ̄▽ ̄)~",
+ "/╲/\\╭ºoꍘoº╮/\\╱\\",
+ "<【☯】‿【☯】>",
+ "= (゚д゚)ウ",
+ "@_@",
+ "d(*⌒▽⌒*)b",
+ "o(≧∀≦)o",
+ "o(≧o≦)o",
+ "q(❂‿❂)p",
+ "y=ー( ゚д゚)・∵.",
+ "\\˚ㄥ˚\\",
+ "\\ᇂ_ᇂ\\",
+ "\\(ಠ ὡ ಠ )/",
+ "\\(◕ ◡ ◕\\)",
+ "^̮^",
+ "^ㅂ^",
+ "_(͡๏̯͡๏)_",
+ "{´◕ ◡ ◕`}",
+ "{ಠ_ಠ}__,,|,",
+ "{◕ ◡ ◕}"
+]
\ No newline at end of file
diff --git a/faces/faces.py b/faces/faces.py
new file mode 100644
index 0000000..ef0e6ca
--- /dev/null
+++ b/faces/faces.py
@@ -0,0 +1,36 @@
+import discord
+from random import choice
+import random
+from redbot.core import commands
+from . import faceslist
+
+class Faces(getattr(commands, "Cog", object)):
+ """
+ Generate fun/random unicode faces courtesy of the CIA files
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.faces = faceslist.faces
+
+ @commands.command(pass_context=True, aliases=["japaneseface"])
+ async def face(self, ctx, number=None):
+ """Japanese Faces at random courtesy of the CIA"""
+ if number is None:
+ await ctx.send(choice(self.faces))
+ return
+ if "<@" in str(number):
+ random.seed(number.strip("<@!>"))
+ userface = self.faces[random.randint(0, len(self.faces))]
+ await ctx.send(userface)
+ return
+ if number.isdigit():
+ if int(number) <= len(self.faces):
+ await ctx.send(self.faces[int(number)-1])
+ return
+ else:
+ await ctx.send("That number is too large, pick less than {}!"
+ .format(len(self.faces)))
+ return
+ if not number.isdigit() and "<@!" not in number:
+ await ctx.send(self.faces[len(number)])
diff --git a/faces/faceslist.py b/faces/faceslist.py
new file mode 100644
index 0000000..8ba2509
--- /dev/null
+++ b/faces/faceslist.py
@@ -0,0 +1,429 @@
+faces = [
+ "¢‿¢",
+ "©¿© o",
+ "ª{•̃̾_•̃̾}ª",
+ "¬_¬",
+ "¯\(º_o)/¯",
+ "¯\\(º o)/¯",
+ "¯\\_(⊙︿⊙)_/¯",
+ "¯\\_(ツ)_/¯",
+ "°ω°",
+ "°Д°",
+ "°‿‿°",
+ "°ﺑ°",
+ "´ ▽ ` )ノ",
+ "¿ⓧ_ⓧﮌ",
+ "Ò,ó",
+ "ó‿ó",
+ "ô⌐ô",
+ "ôヮô",
+ "ŎםŎ",
+ "ŏﺡó",
+ "ʕ•̫͡•ʔ",
+ "ʕ•ᴥ•ʔ",
+ "ʘ‿ʘ",
+ "˚•_•˚",
+ "˚⌇˚",
+ "˚▱˚",
+ "̿ ̿̿'̿'\\̵͇̿̿\\=(•̪●)=/̵͇̿̿/'̿̿ ̿ ̿ ̿",
+ "͡° ͜ʖ ͡°",
+ "Σ ◕ ◡ ◕",
+ "Σ (゚Д゚;)",
+ "Σ(゚Д゚;≡;゚д゚)",
+ "Σ(゚Д゚ )",
+ "Σ(||゚Д゚)",
+ "Φ,Φ",
+ "δﺡό",
+ "σ_σ",
+ "д_д",
+ "ф_ф",
+ "щ(゚Д゚щ)",
+ "щ(ಠ益ಠщ)",
+ "щ(ಥДಥщ)",
+ "Ծ_Ծ",
+ "أ‿أ",
+ "ب_ب",
+ "ح˚௰˚づ",
+ "ح˚ᆺ˚ว",
+ "حᇂﮌᇂ)",
+ "٩๏̯͡๏۶",
+ "٩๏̯͡๏)۶",
+ "٩◔̯◔۶",
+ "٩(×̯×)۶",
+ "٩(̾●̮̮̃̾•̃̾)۶",
+ "٩(͡๏̯͡๏)۶",
+ "٩(͡๏̯ ͡๏)۶",
+ "٩(ಥ_ಥ)۶",
+ "٩(•̮̮̃•̃)۶",
+ "٩(●̮̮̃•̃)۶",
+ "٩(●̮̮̃●̃)۶",
+ "٩(。͡•‿•。)۶",
+ "٩(-̮̮̃•̃)۶",
+ "٩(-̮̮̃-̃)۶",
+ "۞_۞",
+ "۞_۟۞",
+ "۹ↁﮌↁ",
+ "۹⌤_⌤۹",
+ "॓_॔",
+ "१✌◡✌५",
+ "१|˚–˚|५",
+ "ਉ_ਉ",
+ "ଘ_ଘ",
+ "இ_இ",
+ "ఠ_ఠ",
+ "రృర",
+ "ಠ¿ಠi",
+ "ಠ‿ಠ",
+ "ಠ⌣ಠ",
+ "ಠ╭╮ಠ",
+ "ಠ▃ಠ",
+ "ಠ◡ಠ",
+ "ಠ益ಠ",
+ "ಠ益ಠ",
+ "ಠ︵ಠ凸",
+ "ಠ , ಥ",
+ "ಠ.ಠ",
+ "ಠoಠ",
+ "ಠ_ృ",
+ "ಠ_ಠ",
+ "ಠ_๏",
+ "ಠ~ಠ",
+ "ಡ_ಡ",
+ "ತಎತ",
+ "ತ_ತ",
+ "ಥдಥ",
+ "ಥ‿ಥ",
+ "ಥ⌣ಥ",
+ "ಥ◡ಥ",
+ "ಥ﹏ಥ",
+ "ಥ_ಥ",
+ "ಭ_ಭ",
+ "ರ_ರ",
+ "ಸ , ໖",
+ "ಸ_ಸ",
+ "ക_ക",
+ "อ้_อ้",
+ "อ_อ",
+ "โ๏௰๏ใ ื",
+ "๏̯͡๏﴿",
+ "๏̯͡๏",
+ "๏̯͡๏﴿",
+ "๏[-ิิ_•ิ]๏",
+ "๏_๏",
+ "໖_໖",
+ "༺‿༻",
+ "ლ(´ڡ`ლ)",
+ "ლ(́◉◞౪◟◉‵ლ)",
+ "ლ(ಠ益ಠლ)",
+ "ლ(╹◡╹ლ)",
+ "ლ(◉◞౪◟◉‵ლ)",
+ "ლ,ᔑ•ﺪ͟͠•ᔐ.ლ",
+ "ᄽὁȍ ̪ őὀᄿ",
+ "ᕕ( ᐛ )ᕗ",
+ "ᕙ(⇀‸↼‶)ᕗ",
+ "ᕦ(ò_óˇ)ᕤ",
+ "ᶘ ᵒᴥᵒᶅ",
+ "‘︿’",
+ "•▱•",
+ "•✞_✞•",
+ "•ﺑ•",
+ "•(⌚_⌚)•",
+ "•_•)",
+ "‷̗ↂ凸ↂ‴̖",
+ "‹•.•›",
+ "‹› ‹(•¿•)› ‹›",
+ "‹(ᵒᴥᵒ)›",
+ "‹(•¿•)›",
+ "ↁ_ↁ",
+ "⇎_⇎",
+ "∩(︶▽︶)∩",
+ "∩( ・ω・)∩",
+ "≖‿≖",
+ "≧ヮ≦",
+ "⊂•⊃_⊂•⊃",
+ "⊂⌒~⊃。Д。)⊃",
+ "⊂(◉‿◉)つ",
+ "⊂(゚Д゚,,⊂⌒`つ",
+ "⊙ω⊙",
+ "⊙▂⊙",
+ "⊙▃⊙",
+ "⊙△⊙",
+ "⊙︿⊙",
+ "⊙﹏⊙",
+ "⊙0⊙",
+ "⊛ठ̯⊛",
+ "⋋ō_ō`",
+ "━━━ヽ(ヽ(゚ヽ(゚∀ヽ(゚∀゚ヽ(゚∀゚)ノ゚∀゚)ノ∀゚)ノ゚)ノ)ノ━━━",
+ "┌∩┐(◕_◕)┌∩┐",
+ "┌( ಠ_ಠ)┘",
+ "┌( ಥ_ಥ)┘",
+ "╚(•⌂•)╝",
+ "╭╮╭╮☜{•̃̾_•̃̾}☞╭╮╭╮",
+ "╭✬⌢✬╮",
+ "╮(─▽─)╭",
+ "╯‵Д′)╯彡┻━┻",
+ "╰☆╮",
+ "□_□",
+ "►_◄",
+ "◃┆◉◡◉┆▷",
+ "◉△◉",
+ "◉︵◉",
+ "◉_◉",
+ "○_○",
+ "●¿●\\ ~",
+ "●_●",
+ "◔̯◔",
+ "◔ᴗ◔",
+ "◔ ⌣ ◔",
+ "◔_◔",
+ "◕ω◕",
+ "◕‿◕",
+ "◕◡◕",
+ "◕ ◡ ◕",
+ "◖♪_♪|◗",
+ "◖|◔◡◉|◗",
+ "◘_◘",
+ "◙‿◙",
+ "◜㍕◝",
+ "◪_◪",
+ "◮_◮",
+ "☁ ☝ˆ~ˆ☂",
+ "☆¸☆",
+ "☉‿⊙",
+ "☉_☉",
+ "☐_☐",
+ "☜ق❂Ⴢ❂ق☞",
+ "☜(⌒▽⌒)☞",
+ "☜(゚ヮ゚☜)",
+ "☜-(ΘLΘ)-☞",
+ "☝☞✌",
+ "☮▁▂▃▄☾ ♛ ◡ ♛ ☽▄▃▂▁☮",
+ "☹_☹",
+ "☻_☻",
+ "☼.☼",
+ "☾˙❀‿❀˙☽",
+ "♀ح♀ヾ",
+ "♥‿♥",
+ "♥╣[-_-]╠♥",
+ "♥╭╮♥",
+ "♥◡♥",
+ "✌♫♪˙❤‿❤˙♫♪✌",
+ "✌.ʕʘ‿ʘʔ.✌",
+ "✌.|•͡˘‿•͡˘|.✌",
+ "✖‿✖",
+ "✖_✖",
+ "❐‿❑",
+ "⨀_⨀",
+ "⨀_Ꙩ",
+ "⨂_⨂",
+ "〆(・∀・@)",
+ "《〠_〠》",
+ "【•】_【•】",
+ "〠_〠",
+ "〴⋋_⋌〵",
+ "の� �の",
+ "ニガー? ━━━━━━(゚∀゚)━━━━━━ ニガー?",
+ "ペ㍕˚\\",
+ "ヽ(´ー` )ノ",
+ "ヽ(๏∀๏ )ノ",
+ "ヽ(`Д´)ノ",
+ "ヽ(o`皿′o)ノ",
+ "ヽ(`Д´)ノ",
+ "ㅎ_ㅎ",
+ "乂◜◬◝乂",
+ "凸ಠ益ಠ)凸",
+ "句_句",
+ "Ꙩ⌵Ꙩ",
+ "Ꙩ_Ꙩ",
+ "ꙩ_ꙩ",
+ "Ꙫ_Ꙫ",
+ "ꙫ_ꙫ",
+ "ꙮ_ꙮ",
+ "흫_흫",
+ "句_句",
+ "﴾͡๏̯͡๏﴿ O'RLY?",
+ "¯\\(ºдಠ)/¯",
+ "(·×·)",
+ "(⌒Д⌒)",
+ "(╹ェ╹)",
+ "(♯・∀・)⊃",
+ "( ´∀`)☆",
+ "( ´∀`)",
+ "(゜Д゜)",
+ "(・∀・)",
+ "(・A・)",
+ "(゚∀゚)",
+ "( ̄へ ̄)",
+ "( ´☣///_ゝ///☣`)",
+ "( つ Д `)",
+ "_☆( ´_⊃`)☆_",
+ "。◕‿‿◕。",
+ "。◕ ‿ ◕。",
+ "!⑈ˆ~ˆ!⑈",
+ "!(`・ω・。)",
+ "(¬‿¬)",
+ "(¬▂¬)",
+ "(¬_¬)",
+ "(°ℇ °)",
+ "(°∀°)",
+ "(´ω`)",
+ "(´◉◞౪◟◉)",
+ "(´ヘ`;)",
+ "(´・ω・`)",
+ "(´ー`)",
+ "(ʘ‿ʘ)",
+ "(ʘ_ʘ)",
+ "(˚இ˚)",
+ "(͡๏̯͡๏)",
+ "(ΘεΘ;)",
+ "(ι´Д`)ノ",
+ "(Ծ‸ Ծ)",
+ "(॓_॔)",
+ "(० ्०)",
+ "(ு८ு_ .:)",
+ "(ಠ‾ಠ)",
+ "(ಠ‿ʘ)",
+ "(ಠ‿ಠ)",
+ "(ಠ⌣ಠ)",
+ "(ಠ益ಠ ╬)",
+ "(ಠ益ಠ)",
+ "(ಠ_ృ)",
+ "(ಠ_ಠ)",
+ "(ಥ﹏ಥ)",
+ "(ಥ_ಥ)",
+ "(๏̯͡๏ )",
+ "(ღ˘⌣˘ღ) ♫・*:.。. .。.:*・",
+ "(ღ˘⌣˘ღ)",
+ "(ᵔᴥᵔ)",
+ "(•ω•)",
+ "(•‿•)",
+ "(•⊙ω⊙•)",
+ "(• ε •)",
+ "(∩▂∩)",
+ "(∩︵∩)",
+ "(∪ ◡ ∪)",
+ "(≧ω≦)",
+ "(≧◡≦)",
+ "(≧ロ≦)",
+ "(⊙ヮ⊙)",
+ "(⊙_◎)",
+ "(⋋▂⋌)",
+ "(⌐■_■)",
+ "(─‿‿─)",
+ "(┛◉Д◉)┛┻━┻",
+ "(╥_╥)",
+ "(╬ಠ益ಠ)",
+ "(╬◣д◢)",
+ "(╬ ಠ益ಠ)",
+ "(╯°□°)╯︵ ┻━┻",
+ "(╯ಊ╰)",
+ "(╯◕_◕)╯",
+ "(╯︵╰,)",
+ "(╯3╰)",
+ "(╯_╰)",
+ "(╹◡╹)凸",
+ "(▰˘◡˘▰)",
+ "(●´ω`●)",
+ "(●´∀`●)",
+ "(◑‿◐)",
+ "(◑◡◑)",
+ "(◕‿◕✿)",
+ "(◕‿◕)",
+ "(◕‿-)",
+ "(◕︵◕)",
+ "(◕ ^ ◕)",
+ "(◕_◕)",
+ "(◜௰◝)",
+ "(◡‿◡✿)",
+ "(◣_◢)",
+ "(☞゚∀゚)☞",
+ "(☞゚ヮ゚)☞",
+ "(☞゚ ∀゚ )☞",
+ "(☼◡☼)",
+ "(☼_☼)",
+ "(✌゚∀゚)☞",
+ "(✖╭╮✖)",
+ "(✪㉨✪)",
+ "(✿◠‿◠)",
+ "(✿ ♥‿♥)",
+ "( ・∀・)",
+ "( ・ัω・ั)?",
+ "( ゚∀゚)o彡゜えーりんえーりん!!",
+ "(。・_・。)",
+ "(つд`)",
+ "(づ。◕‿‿◕。)づ",
+ "(ノಠ益ಠ)ノ彡┻━┻",
+ "(ノ ◑‿◑)ノ",
+ "(ノ_・。)",
+ "(・∀・ )",
+ "(屮゚Д゚)屮",
+ "(︶ω︶)",
+ "(︶︹︺)",
+ "(ﺧ益ﺨ)",
+ "(;一_一)",
+ "(`・ω・´)”",
+ "(。◕‿‿◕。)",
+ "(。◕‿◕。)",
+ "(。◕ ‿ ◕。)",
+ "(。♥‿♥。)",
+ "(。・ω..・)っ",
+ "(・ェ-)",
+ "(ノ◕ヮ◕)ノ*:・゚✧",
+ "(゚Д゚)",
+ "(゚Д゚)y─┛~~",
+ "(゚∀゚)",
+ "(゚ヮ゚)",
+ "( ̄□ ̄)",
+ "( ̄。 ̄)",
+ "( ̄ー ̄)",
+ "( ̄(エ) ̄)",
+ "( °٢° )",
+ "( ´_ゝ`)",
+ "( ͡° ͜ʖ ͡°)",
+ "( ͡~ ͜ʖ ͡°)",
+ "( ಠ◡ಠ )",
+ "( •_•)>⌐■-■",
+ "( ゚,_ゝ゚)",
+ "( ・ิз・ิ)",
+ "( ゚д゚)、",
+ "( ^▽^)σ)~O~)",
+ "((((゜д゜;))))",
+ "(*´д`*)",
+ "(*..Д`)",
+ "(*..д`*)",
+ "(*~▽~)",
+ "(-’๏_๏’-)",
+ "(-_- )ノ",
+ "(/◔ ◡ ◔)/",
+ "(///_ಥ)",
+ "(;´Д`)",
+ "(=ω=;)",
+ "(=゜ω゜)",
+ "(>'o')>♥<('o'<)",
+ "(n˘v˘•)¬",
+ "(o´ω`o)",
+ "(V)(°,,°)(V)",
+ "(\/) (°,,°) (\/) WOOPwoopwowopwoopwoopwoop!",
+ "(^▽^)",
+ "(`・ω・´)",
+ "(~ ̄▽ ̄)~",
+ "/╲/\\╭ºoꍘoº╮/\\╱\\",
+ "<【☯】‿【☯】>",
+ "= (゚д゚)ウ",
+ "@_@",
+ "d(*⌒▽⌒*)b",
+ "o(≧∀≦)o",
+ "o(≧o≦)o",
+ "q(❂‿❂)p",
+ "y=ー( ゚д゚)・∵.",
+ "\\˚ㄥ˚\\",
+ "\\ᇂ_ᇂ\\",
+ "\\(ಠ ὡ ಠ )/",
+ "\\(◕ ◡ ◕\\)",
+ "^̮^",
+ "^ㅂ^",
+ "_(͡๏̯͡๏)_",
+ "{´◕ ◡ ◕`}",
+ "{ಠ_ಠ}__,,|,",
+ "{◕ ◡ ◕}"
+]
\ No newline at end of file
diff --git a/faces/info.json b/faces/info.json
new file mode 100644
index 0000000..fac35d5
--- /dev/null
+++ b/faces/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Japanese faces courtesy of the CIA",
+ "install_msg":"Find what your face is like!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Faces",
+ "permissions":[],
+ "requirements":[],
+ "short":"General commands",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/fun/__init__.py b/fun/__init__.py
new file mode 100644
index 0000000..63320a9
--- /dev/null
+++ b/fun/__init__.py
@@ -0,0 +1,5 @@
+from .fun import Fun
+
+
+def setup(bot):
+ bot.add_cog(Fun(bot))
\ No newline at end of file
diff --git a/fun/fun.py b/fun/fun.py
new file mode 100644
index 0000000..19c4412
--- /dev/null
+++ b/fun/fun.py
@@ -0,0 +1,316 @@
+import random
+import re
+import json
+from redbot.core import commands
+import discord
+
+'''Module for fun/meme commands commands
+ Fun commands from Appu's selfbot
+'''
+
+
+class Fun(getattr(commands, "Cog", object)):
+ """
+ RedBot V3 conversion of Appu's Fun cog
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.regionals = {'a': '\N{REGIONAL INDICATOR SYMBOL LETTER A}', 'b': '\N{REGIONAL INDICATOR SYMBOL LETTER B}',
+ 'c': '\N{REGIONAL INDICATOR SYMBOL LETTER C}',
+ 'd': '\N{REGIONAL INDICATOR SYMBOL LETTER D}', 'e': '\N{REGIONAL INDICATOR SYMBOL LETTER E}',
+ 'f': '\N{REGIONAL INDICATOR SYMBOL LETTER F}',
+ 'g': '\N{REGIONAL INDICATOR SYMBOL LETTER G}', 'h': '\N{REGIONAL INDICATOR SYMBOL LETTER H}',
+ 'i': '\N{REGIONAL INDICATOR SYMBOL LETTER I}',
+ 'j': '\N{REGIONAL INDICATOR SYMBOL LETTER J}', 'k': '\N{REGIONAL INDICATOR SYMBOL LETTER K}',
+ 'l': '\N{REGIONAL INDICATOR SYMBOL LETTER L}',
+ 'm': '\N{REGIONAL INDICATOR SYMBOL LETTER M}', 'n': '\N{REGIONAL INDICATOR SYMBOL LETTER N}',
+ 'o': '\N{REGIONAL INDICATOR SYMBOL LETTER O}',
+ 'p': '\N{REGIONAL INDICATOR SYMBOL LETTER P}', 'q': '\N{REGIONAL INDICATOR SYMBOL LETTER Q}',
+ 'r': '\N{REGIONAL INDICATOR SYMBOL LETTER R}',
+ 's': '\N{REGIONAL INDICATOR SYMBOL LETTER S}', 't': '\N{REGIONAL INDICATOR SYMBOL LETTER T}',
+ 'u': '\N{REGIONAL INDICATOR SYMBOL LETTER U}',
+ 'v': '\N{REGIONAL INDICATOR SYMBOL LETTER V}', 'w': '\N{REGIONAL INDICATOR SYMBOL LETTER W}',
+ 'x': '\N{REGIONAL INDICATOR SYMBOL LETTER X}',
+ 'y': '\N{REGIONAL INDICATOR SYMBOL LETTER Y}', 'z': '\N{REGIONAL INDICATOR SYMBOL LETTER Z}',
+ '0': '0⃣', '1': '1⃣', '2': '2⃣', '3': '3⃣',
+ '4': '4⃣', '5': '5⃣', '6': '6⃣', '7': '7⃣', '8': '8⃣', '9': '9⃣', '!': '\u2757',
+ '?': '\u2753'}
+ self.emoji_reg = re.compile(r'<:.+?:([0-9]{15,21})>')
+ self.ball = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it',
+ 'As I see it, yes', 'Most likely', 'Outlook good', 'Yes', 'Signs point to yes',
+ 'Reply hazy try again',
+ 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again',
+ 'Don\'t count on it', 'My reply is no', 'My sources say no', 'Outlook not so good',
+ 'Very doubtful']
+
+ emoji_dict = {
+ # these arrays are in order of "most desirable". Put emojis that most convincingly correspond to their letter near the front of each array.
+ 'a': ['🇦', '🅰', '🍙', '🔼', '4⃣'],
+ 'b': ['🇧', '🅱', '8⃣'],
+ 'c': ['🇨', '©', '🗜'],
+ 'd': ['🇩', '↩'],
+ 'e': ['🇪', '3⃣', '📧', '💶'],
+ 'f': ['🇫', '🎏'],
+ 'g': ['🇬', '🗜', '6⃣', '9⃣', '⛽'],
+ 'h': ['🇭', '♓'],
+ 'i': ['🇮', 'ℹ', '🚹', '1⃣'],
+ 'j': ['🇯', '🗾'],
+ 'k': ['🇰', '🎋'],
+ 'l': ['🇱', '1⃣', '🇮', '👢', '💷'],
+ 'm': ['🇲', 'Ⓜ', '📉'],
+ 'n': ['🇳', '♑', '🎵'],
+ 'o': ['🇴', '🅾', '0⃣', '⭕', '🔘', '⏺', '⚪', '⚫', '🔵', '🔴', '💫'],
+ 'p': ['🇵', '🅿'],
+ 'q': ['🇶', '♌'],
+ 'r': ['🇷', '®'],
+ 's': ['🇸', '💲', '5⃣', '⚡', '💰', '💵'],
+ 't': ['🇹', '✝', '➕', '🎚', '🌴', '7⃣'],
+ 'u': ['🇺', '⛎', '🐉'],
+ 'v': ['🇻', '♈', '☑'],
+ 'w': ['🇼', '〰', '📈'],
+ 'x': ['🇽', '❎', '✖', '❌', '⚒'],
+ 'y': ['🇾', '✌', '💴'],
+ 'z': ['🇿', '2⃣'],
+ '0': ['0⃣', '🅾', '0⃣', '⭕', '🔘', '⏺', '⚪', '⚫', '🔵', '🔴', '💫'],
+ '1': ['1⃣', '🇮'],
+ '2': ['2⃣', '🇿'],
+ '3': ['3⃣'],
+ '4': ['4⃣'],
+ '5': ['5⃣', '🇸', '💲', '⚡'],
+ '6': ['6⃣'],
+ '7': ['7⃣'],
+ '8': ['8⃣', '🎱', '🇧', '🅱'],
+ '9': ['9⃣'],
+ '?': ['❓'],
+ '!': ['❗', '❕', '⚠', '❣'],
+
+ # emojis that contain more than one letter can also help us react
+ # letters that we are trying to replace go in front, emoji to use second
+ #
+ # if there is any overlap between characters that could be replaced,
+ # e.g. 💯 vs 🔟, both could replace "10",
+ # the longest ones & most desirable ones should go at the top
+ # else you'll have "100" -> "🔟0" instead of "100" -> "💯".
+ 'combination': [['cool', '🆒'],
+ ['back', '🔙'],
+ ['soon', '🔜'],
+ ['free', '🆓'],
+ ['end', '🔚'],
+ ['top', '🔝'],
+ ['abc', '🔤'],
+ ['atm', '🏧'],
+ ['new', '🆕'],
+ ['sos', '🆘'],
+ ['100', '💯'],
+ ['loo', '💯'],
+ ['zzz', '💤'],
+ ['...', '💬'],
+ ['ng', '🆖'],
+ ['id', '🆔'],
+ ['vs', '🆚'],
+ ['wc', '🚾'],
+ ['ab', '🆎'],
+ ['cl', '🆑'],
+ ['ok', '🆗'],
+ ['up', '🆙'],
+ ['10', '🔟'],
+ ['11', '⏸'],
+ ['ll', '⏸'],
+ ['ii', '⏸'],
+ ['tm', '™'],
+ ['on', '🔛'],
+ ['oo', '🈁'],
+ ['!?', '⁉'],
+ ['!!', '‼'],
+ ['21', '📅'],
+ ]
+ }
+
+ # used in textflip
+ text_flip = {}
+ char_list = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}"
+ alt_char_list = "{|}zʎxʍʌnʇsɹbdouɯlʞɾᴉɥƃɟǝpɔqɐ,‾^[\]Z⅄XMΛ∩┴SɹQԀONW˥ʞſIHפℲƎpƆq∀@¿<=>;:68ㄥ9ϛㄣƐᄅƖ0/˙-'+*(),⅋%$#¡"[::-1]
+ for idx, char in enumerate(char_list):
+ text_flip[char] = alt_char_list[idx]
+ text_flip[alt_char_list[idx]] = char
+
+ # used in [p]react, checks if it's possible to react with the duper string or not
+ def has_dupe(duper):
+ collect_my_duper = list(filter(lambda x: x != '⃣',
+ duper)) # ⃣ appears twice in the number unicode thing, so that must be stripped
+ return len(set(collect_my_duper)) != len(collect_my_duper)
+
+ # used in [p]react, replaces e.g. 'ng' with '🆖'
+ def replace_combos(react_me):
+ for combo in Fun.emoji_dict['combination']:
+ if combo[0] in react_me:
+ react_me = react_me.replace(combo[0], combo[1], 1)
+ return react_me
+
+ # used in [p]react, replaces e.g. 'aaaa' with '🇦🅰🍙🔼'
+ def replace_letters(react_me):
+ for char in "abcdefghijklmnopqrstuvwxyz0123456789!?":
+ char_count = react_me.count(char)
+ if char_count > 1: # there's a duplicate of this letter:
+ if len(Fun.emoji_dict[
+ char]) >= char_count: # if we have enough different ways to say the letter to complete the emoji chain
+ i = 0
+ while i < char_count: # moving goal post necessitates while loop instead of for
+ if Fun.emoji_dict[char][i] not in react_me:
+ react_me = react_me.replace(char, Fun.emoji_dict[char][i], 1)
+ else:
+ char_count += 1 # skip this one because it's already been used by another replacement (e.g. circle emoji used to replace O already, then want to replace 0)
+ i += 1
+ else:
+ if char_count == 1:
+ react_me = react_me.replace(char, Fun.emoji_dict[char][0])
+ return react_me
+
+ @commands.command(pass_context=True)
+ async def vowelreplace(self, ctx, replace, *, msg):
+ """Replaces all vowels in a word with a letter"""
+ result = ""
+ for letter in msg:
+ if letter.lower() in "aeiou":
+ result += replace
+ else:
+ result += letter
+
+ await ctx.send(result)
+
+ @commands.command(pass_context=True)
+ async def textflip(self, ctx, *, msg):
+ """Flip given text."""
+ result = ""
+ for char in msg:
+ if char in self.text_flip:
+ result += self.text_flip[char]
+ else:
+ result += char
+ await ctx.send(result[::-1]) # slice reverses the string
+
+ @commands.command(pass_context=True)
+ async def regional(self, ctx, *, msg):
+ """Replace letters with regional indicator emojis"""
+
+ msg = list(msg)
+ regional_list = [self.regionals[x.lower()] if x.isalnum() or x in ["!", "?"] else x for x in msg]
+ regional_output = '\u200b'.join(regional_list)
+ await ctx.send(regional_output)
+
+ @commands.command(pass_context=True)
+ async def space(self, ctx, *, msg):
+ """Add n spaces between each letter. Ex: [p]space 2 thicc"""
+
+ if msg.split(' ', 1)[0].isdigit():
+ spaces = int(msg.split(' ', 1)[0]) * ' '
+ msg = msg.split(' ', 1)[1].strip()
+ else:
+ spaces = ' '
+ spaced_message = spaces.join(list(msg))
+ await ctx.send(spaced_message)
+
+ @commands.command()
+ async def oof(self, ctx, msg_id:int=None, channel:discord.TextChannel=None):
+ """
+ react 🅾🇴🇫 to a message
+
+ `msg_id` must be the message ID for desited message within the channel
+ `channel` must be the channel where the desired message is defaults to current channel
+ if the bot has manage messages permission it will attempt to delete the command
+ """
+ emojis = ["🅾", "🇴", "🇫"]
+ if channel is None:
+ channel = ctx.message.channel
+ if msg_id is None:
+ async for message in channel.history(limit=2):
+ msg = message
+ else:
+ msg = await channel.get_message(msg_id)
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await ctx.message.delete()
+ if channel.permissions_for(ctx.me).add_reactions:
+ for emoji in emojis:
+ await msg.add_reaction(emoji)
+
+
+ # given String react_me, return a list of emojis that can construct the string with no duplicates (for the purpose of reacting)
+ # TODO make it consider reactions already applied to the message
+ @commands.command(pass_context=True, aliases=['r'])
+ async def react(self, ctx, msg: str, msg_id:int=None, channel:discord.TextChannel=None):
+ """
+ Add letter(s) as reaction to previous message.
+
+ `msg` is the word you would like to react, no spaces
+ `msg_id` must be the message ID for desited message within the channel
+ `channel` must be the channel where the desired message is defaults to current channel
+ """
+
+ msg = msg.lower()
+
+ if channel is None:
+ channel = ctx.channel
+ if not channel.permissions_for(ctx.me).add_reactions:
+ return
+ if msg_id is None:
+ async for message in channel.history(limit=2):
+ msg_id = message
+ else:
+ try:
+ msg_id = await channel.get_message(msg_id)
+ except:
+ await ctx.send("Message ID {} not found in {}".format(msg_id, channel.mention))
+ return
+
+
+ limit = 25 if msg_id else 2
+
+ reactions = []
+ non_unicode_emoji_list = []
+ react_me = "" # this is the string that will hold all our unicode converted characters from msg
+
+ # replace all custom server emoji <:emoji:123456789> with "<" and add emoji ids to non_unicode_emoji_list
+ char_index = 0
+ emotes = re.findall(r"", msg)
+ react_me = re.sub(r"", "", msg)
+
+ for emote in emotes:
+ reactions.append(discord.utils.get(self.bot.emojis, id=int(emote.split(":")[-1][:-1])))
+ non_unicode_emoji_list.append(emote)
+
+
+ if Fun.has_dupe(non_unicode_emoji_list):
+ return await ctx.send(
+ "You requested that I react with at least two of the exact same specific emoji. I'll try to find alternatives for alphanumeric text, but if you specify a specific emoji must be used, I can't help.")
+
+ react_me_original = react_me # we'll go back to this version of react_me if prefer_combine is false but we can't make the reaction happen unless we combine anyway.
+
+ if Fun.has_dupe(react_me): # there's a duplicate letter somewhere, so let's go ahead try to fix it.
+ react_me = Fun.replace_combos(react_me)
+ react_me = Fun.replace_letters(react_me)
+ # print(react_me)
+ if Fun.has_dupe(react_me): # check if we were able to solve the dupe
+ react_me = react_me_original
+ react_me = Fun.replace_combos(react_me)
+ react_me = Fun.replace_letters(react_me)
+ if Fun.has_dupe(react_me): # this failed too, so there's really nothing we can do anymore.
+ return await ctx.send("Failed to fix all duplicates. Cannot react with this string.")
+
+ lt_count = 0
+ for char in react_me:
+ if char not in "0123456789": # these unicode characters are weird and actually more than one character.
+ if char != '⃣': # 3
+ reactions.append(char)
+ else:
+ reactions.append(self.emoji_dict[char][0])
+ else: # probably doesn't matter, but by treating the case without dupes seperately, we can save some time
+ lt_count = 0
+ for char in react_me:
+ if char in "abcdefghijklmnopqrstuvwxyz0123456789!?":
+ reactions.append(self.emoji_dict[char][0])
+ else:
+ reactions.append(char)
+
+ for i in reactions:
+ await msg_id.add_reaction(i)
diff --git a/fun/info.json b/fun/info.json
new file mode 100644
index 0000000..e5ba85e
--- /dev/null
+++ b/fun/info.json
@@ -0,0 +1,23 @@
+{
+ "author":[
+ "Appu",
+ "TrustyJAID"
+ ],
+ "description":"All sorts of commands that users may find fun or useful",
+ "install_msg":"Type `[p]help` to see all the commands.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Fun",
+ "permissions":[
+ "add_reactions"
+ ],
+ "requirements":[],
+ "short":"Various fun commands like react, textflip, and regional",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/gabai/__init__.py b/gabai/__init__.py
new file mode 100644
index 0000000..985271d
--- /dev/null
+++ b/gabai/__init__.py
@@ -0,0 +1,5 @@
+from .gabai import Gabai
+
+def setup(bot):
+ n = Gabai(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/gabai/gabai.py b/gabai/gabai.py
new file mode 100644
index 0000000..2c1a750
--- /dev/null
+++ b/gabai/gabai.py
@@ -0,0 +1,257 @@
+import discord
+from redbot.core import commands, checks, Config
+import asyncio
+import aiohttp
+from datetime import datetime
+from .gabuser import GabUser
+
+
+__version__ = "2.0.1"
+__author__ = "TrustyJAID"
+
+BASE_URL = "https://api.gab.com/v1.0/"
+
+
+
+class GabaiError(Exception):
+ pass
+
+class NotFoundError(GabaiError):
+ pass
+
+class Gabai(getattr(commands, "Cog", object)):
+ """
+ Get information from gab.ai and display on discord
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 17864784635)
+ default_global = {"api_token":{"client_id":"", "client_secret":"", "token":{}, "refresh_time":0}}
+ self.config.register_global(**default_global)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.rate_limit_remaining = 60
+ self.rate_limit_time = 0
+
+ @commands.group(pass_context=True)
+ async def gab(self, ctx):
+ """
+ Add your gab tag to receive the role Anonymous
+ """
+ pass
+
+ async def refresh_token(self):
+ api_token = await self.config.api_toke()
+ params = {
+ "grant_type": "refresh_token",
+ "refresh_token": api_token["token"]["refresh_token"],
+ "client_id": api_token["client_id"],
+ "client_secret": api_token["client_secret"],
+ "scope": "read engage-user engage-post write-post notifications"
+ }
+ async with self.session.post("https://api.gab.com/oauth/token", json=params) as resp:
+ token = await resp.json()
+ await self.config.api_token.token.set(token)
+ await self.config.api_token.refresh_time.set(token["expires_in"]+datetime.now().timestamp())
+
+
+ async def get_header(self):
+ access_token = await self.config.api_token.token.access_token()
+ return {"Authorization":"Bearer {}".format(access_token)}
+
+ async def check_rate_limit(self):
+ """Current rate limit is 60 calls per minute"""
+ time_now = int(datetime.now().timestamp())
+ if self.rate_limit_remaining == 60:
+ self.rate_limit_time = int(datetime.now().timestamp())
+ self.rate_limit_remaining -= 1
+ return
+ if self.rate_limit_remaining != 0:
+ self.rate_limit_remaining -= 1
+ return
+ else:
+ if time_now > (self.rate_limit_time+60):
+ self.rate_limit_remaining = 59
+ self.rate_limit_time = time_now
+ else:
+ await asyncio.sleep(self.rate_limit_time+60-time_now)
+
+
+ async def get_gab_response(self, url, params=None):
+ await self.check_rate_limit()
+ header = await self.get_header()
+ async with self.session.get(BASE_URL+url, params=params, headers=header) as resp:
+ response = await resp.json()
+ if "status" in response:
+ raise NotFoundError(response["message"])
+ else:
+ return response
+
+ async def make_user_embed(self, user:GabUser):
+
+ url = "https://gab.ai/{}".format(user.username)
+ em = discord.Embed(description=user.bio[:1990], title=user.name, colour=int("4bd079", 16))
+ em.set_author(name=user.username, url=url, icon_url=user.picture_url_full)
+ em.set_thumbnail(url=user.picture_url_full)
+ em.add_field(name="Followers", value=user.follower_count)
+ em.add_field(name="Following", value=user.following_count)
+ em.add_field(name="Score", value=user.score)
+ acknowledgements = ""
+ if user.is_pro:
+ acknowledgements += "Pro, "
+ if user.verified:
+ acknowledgements += "Verified, "
+ if user.is_donor:
+ acknowledgements += "Donor, "
+ if user.is_investor:
+ acknowledgements += "Investor, "
+ if acknowledgements != "":
+ em.add_field(name="Acknowledgements", value=acknowledgements[:-2])
+ # em.set_image(url=user.cover_url)
+ return em
+
+ async def make_post_embed(self, post:dict):
+ username = post["actuser"]["username"]
+ post_id = post["post"]["id"]
+ url = "https://gab.ai/{}/posts/{}".format(username, post_id)
+ timestamp = datetime.strptime(post["post"]["created_at"], "%Y-%m-%dT%H:%M:%S+00:00")
+ attachment = post["post"]["attachment"]["type"]
+ colour = int("4bd079", 16)
+ likes = post["post"]["like_count"]
+ replies = post["post"]["reply_count"]
+ em = discord.Embed(description= post["post"]["body"], timestamp=timestamp, colour=colour)
+ if attachment is not None:
+ if attachment != "media":
+ em.set_image(url=post["post"]["attachment"]["value"])
+ else:
+ em.set_image(url=post["post"]["attachment"]["value"][0]["url_full"])
+ em.set_author(name=post["actuser"]["username"], url=url, icon_url=post["actuser"]["picture_url"])
+ em.set_footer(text="{} Likes | {} Replies | Created at".format(likes, replies))
+ return em
+
+
+ async def gab_menu(self, ctx:commands.Context, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ post = post_list[page]
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = await self.make_post_embed(post)
+ else:
+ await ctx.send("I need embed_links permission to use this command.")
+ return
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await ctx.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ if react.emoji == "➡":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await self.gab_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react.emoji == "⬅":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await self.gab_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @gab.command()
+ async def feed(self, ctx, username:str, before_date:str=None):
+ """
+ Gets a users feed from gab.ai before a specified date
+
+ before_date must be in format DD-MM-YYYY
+ """
+ await ctx.trigger_typing()
+ if before_date is None:
+ before_date = datetime.now().strftime("%Y-%m-%dT%H:%M%S%z")
+ else:
+ before_date = datetime.strptime(before_date, "%d-%m-%Y").strftime("%Y-%m-%dT%H:%M:%S+00:00")
+ try:
+ feed_info = await self.get_gab_response(f"users/{username}/feed/", {"before":before_date})
+ except NotFoundError as e:
+ await ctx.send("{} {}".format(username, e))
+ return
+ await self.gab_menu(ctx, feed_info["data"])
+
+ @gab.command()
+ async def user(self, ctx, username:str):
+ """
+ Get user information from gab.ai
+ """
+ await ctx.trigger_typing()
+ try:
+ user_info = await self.get_gab_response(f"users/{username}")
+ except NotFoundError as e:
+ await ctx.send("{} {}".format(username, e))
+ return
+ user = GabUser.from_json(user_info)
+ em = await self.make_user_embed(user)
+ await ctx.send(embed=em)
+
+
+ @gab.command()
+ @checks.is_owner()
+ async def token(self, ctx, client_id:str, client_secret:str):
+ """
+ Provide your client_id and client_secret
+
+ 1. go to https://gab.ai/settings/clients then Developer Apps
+ 2. Select Create app
+ 3. Fillout the form and set the redirect url to https://localhost
+ 4. Provide the client_id and client_secret
+ 5. The bot will provide a link and ask for the code
+ 6. post everything after `?code=` in discord
+ """
+ await self.config.api_token.client_id.set(client_id)
+ await self.config.api_token.client_secret.set(client_secret)
+ url = f"https://api.gab.com/oauth/authorize?response_type=code&client_id={client_id}&redirect_uri=https://localhost&scope=%20read%20engage-user%20engage-post%20write-post%20notifications"
+ await ctx.send("Please go to the following url and provide the code supplied: {}".format(url))
+ check = lambda m: m.author.id == ctx.message.author.id
+ code = await self.bot.wait_for("message", check=check)
+ params = {
+ "grant_type": "authorization_code",
+ "code": code.content,
+ "client_id": client_id,
+ "client_secret": client_secret,
+ "redirect_uri": "https://localhost"
+ }
+ async with self.session.post("https://api.gab.com/oauth/token", json=params) as resp:
+ token = await resp.json()
+ if "error" in token:
+ await ctx.send(token["message"]+ "\n\nMaybe try again/")
+ return
+ await self.config.api_token.token.set(token)
+ await self.config.api_token.refresh_time.set(token["expires_in"]+datetime.now().timestamp())
+ await ctx.send("API Tokens set!")
+
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/gabai/gabuser.py b/gabai/gabuser.py
new file mode 100644
index 0000000..00b0e65
--- /dev/null
+++ b/gabai/gabuser.py
@@ -0,0 +1,70 @@
+
+
+class GabUser:
+
+ def __init__(self, user_id:int, created_at_month_label:str, name:str, username:str, follower_count:int,
+ following_count:int, post_count:int, picture_url:str, picture_url_full:str,
+ following:bool, followed:bool, verified:bool, is_pro:bool, is_donor:bool,
+ is_investor:bool, is_premium:bool, is_tippable:bool, is_private:bool,
+ is_accessible:bool, follow_pending:bool, bio:str, cover_url:str, score:int,
+ video_count:int, is_favorited:bool, subscribing:bool, is_muted:bool, distribution:list):
+
+ self.user_id = user_id
+ self.created_at_month_label = created_at_month_label
+ self.name = name
+ self.username = username
+ self.follower_count = follower_count
+ self.following_count = following_count
+ self.post_count = post_count
+ self.picture_url = picture_url
+ self.picture_url_full = picture_url_full
+ self.following = following
+ self.followed = followed
+ self.verified = verified
+ self.is_pro = is_pro
+ self.is_donor = is_donor
+ self.is_investor = is_investor
+ self.is_premium = is_premium
+ self.is_tippable = is_tippable
+ self.is_private = is_private
+ self.is_accessible = is_accessible
+ self.follow_pending = follow_pending
+ self.bio = bio
+ self.cover_url = cover_url
+ self.score = score
+ self.video_count = video_count
+ self.is_favorited = is_favorited
+ self.subscribing = subscribing
+ self.is_muted = is_muted
+ self.distribution = distribution
+
+ @classmethod
+ def from_json(cls, data:dict):
+ return cls(data["id"],
+ data["created_at_month_label"],
+ data["name"],
+ data["username"],
+ data["follower_count"],
+ data["following_count"],
+ data["post_count"],
+ data["picture_url"],
+ data["picture_url_full"],
+ data["following"],
+ data["followed"],
+ data["verified"],
+ data["is_pro"],
+ data["is_donor"],
+ data["is_investor"],
+ data["is_premium"],
+ data["is_tippable"],
+ data["is_private"],
+ data["is_accessible"],
+ data["follow_pending"],
+ data["bio"],
+ data["cover_url"],
+ data["score"],
+ data["video_count"],
+ data["is_favorited"],
+ data["subscribing"],
+ data["is_muted"],
+ data["distribution"])
\ No newline at end of file
diff --git a/gabai/info.json b/gabai/info.json
new file mode 100644
index 0000000..5a11d32
--- /dev/null
+++ b/gabai/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Get information from gab.ai's API and display in discord.",
+ "install_msg":"Thanks for installing, remember to set your gab API credentials with `[p]gab token` and follow the instructions.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Gabai",
+ "permissions":[],
+ "requirements":[],
+ "short":"Gab.ai information",
+ "tags":[
+ "general",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/halo/__init__.py b/halo/__init__.py
new file mode 100644
index 0000000..c1fbc69
--- /dev/null
+++ b/halo/__init__.py
@@ -0,0 +1,4 @@
+from .halo import Halo
+
+def setup(bot):
+ bot.add_cog(Halo(bot))
diff --git a/halo/halo.py b/halo/halo.py
new file mode 100644
index 0000000..32a88da
--- /dev/null
+++ b/halo/halo.py
@@ -0,0 +1,220 @@
+import discord
+import aiohttp
+from redbot.core import commands
+from redbot.core import Config
+from redbot.core import checks
+from random import choice as randchoice
+
+numbs = {
+ "next": "➡",
+ "back": "⬅",
+ "exit": "❌"
+}
+
+class Halo(getattr(commands, "Cog", object)):
+ """
+ Display Halo 5 and Halo Wars 2 stats and information
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ default_global = {"api_token":{"token": "",
+ "language": "en"}}
+ self.config = Config.get_conf(self, 35689771456)
+ self.config.register_global(**default_global)
+
+ async def request_url(self, url, params=None):
+ header_data = await self.config.api_token()
+ header = {"Ocp-Apim-Subscription-Key": header_data["token"], "Accept-Language":header_data["language"]}
+ async with self.session.get(url, params=params, headers=header) as resp:
+ return await resp.json()
+
+ @commands.group(pass_context=True, name='halo5')
+ @checks.admin_or_permissions(manage_server=True)
+ async def _halo5(self, ctx):
+ """Get information from Halo 5"""
+ pass
+
+ @commands.group(pass_context=True, name='halowars')
+ @checks.admin_or_permissions(manage_server=True)
+ async def _halowars(self, ctx):
+ """Get information from Halo Wars 2"""
+ pass
+
+ def random_colour(self):
+ return int(''.join([randchoice('0123456789ABCDEF')for x in range(6)]), 16)
+
+ async def halo5_playlist_menu(self, ctx, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ s = post_list[page]
+ created_at = ctx.message.created_at
+ desc = "Created at: {}".format(created_at)
+ em = discord.Embed(title=s["name"],
+ description=s["description"],
+ colour=discord.Colour(value=self.random_colour()),
+ timestamp=created_at)
+ em.add_field(name="Gamemode", value=s["gameMode"])
+ em.add_field(name="Ranked", value=str(s["isRanked"]))
+ if s["imageUrl"] is not None:
+ em.set_image(url=s["imageUrl"])
+ if not message:
+ message =\
+ await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"]
+ try:
+ react, user = await self.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", self.bot.user)
+ await message.remove_reaction("❌", self.bot.user)
+ await message.remove_reaction("➡", self.bot.user)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ return await self.halo5_playlist_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ return await self.halo5_playlist_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @_halo5.command(pass_context=True, name="playlist")
+ async def halo5_playlist(self, ctx, active=True):
+ """Gathers data about active Halo 5 playlists"""
+ data = await self.request_url("https://www.haloapi.com/metadata/h5/metadata/playlists")
+ list_active = []
+ for playlist in data:
+ if playlist["isActive"]:
+ list_active.append(playlist)
+ await self.halo5_playlist_menu(ctx, list_active)
+
+ async def halowars_playlist_menu(self, ctx, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ s = post_list[page]
+ created_at = ctx.message.created_at
+ desc = "Created at: {}".format(created_at)
+ em = discord.Embed(title=s["View"]["Title"],
+ # description=s["description"],
+ colour=discord.Colour(value=self.random_colour()),
+ timestamp=created_at)
+ # em.add_field(name="Gamemode", value=s["gameMode"])
+ # em.add_field(name="Ranked", value=str(s["isRanked"]))
+ # if s["HW2Playlist"][] is not None:
+ em.set_image(url=s["View"]["HW2Playlist"]["Image"]["View"]["Media"]["MediaUrl"])
+ if not message:
+ message =\
+ await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"]
+ try:
+ react, user = await self.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", self.bot.user)
+ await message.remove_reaction("❌", self.bot.user)
+ await message.remove_reaction("➡", self.bot.user)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ return await self.halowars_playlist_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ return await self.halowars_playlist_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ async def get_halo5_rank_data(self, designation_id, tier_id):
+ rank_data = await self.request_url("https://www.haloapi.com/metadata/h5/metadata/csr-designations")
+ designation = [x for x in rank_data if x["id"] == str(designation_id)]
+ image_url = [x["iconImageUrl"] for x in designation[0]["tiers"] if x["id"] == str(tier_id)]
+ return designation[0]["name"], image_url
+
+ @_halo5.command(pass_context=True, name="rank")
+ async def Halo5_rank(self, ctx, *, gamertag):
+ """Gather playter rank information from Halo 5"""
+ colours = {"Unranked": "7f7f7f", "Bronze": "c27c0e", "Silver": "cccccc", "Gold": "xf1c40f",
+ "Platinum": "e5e5e5", "Diamond": "ffffff", "Onyx": "000000", "Champion": "71368a"}
+ player_data = await self.request_url("https://www.haloapi.com/stats/h5/servicerecords/arena?", {"players":gamertag})
+ tier = player_data["Results"][0]["Result"]["ArenaStats"]["HighestCsrAttained"]["Tier"]
+ designation = player_data["Results"][0]["Result"]["ArenaStats"]["HighestCsrAttained"]["DesignationId"]
+ designation_name, image_url = await self.get_halo5_rank_data(designation, tier)
+ embed = discord.Embed(title=gamertag,
+ description=designation_name,
+ colour=discord.Colour(value=int(colours[designation_name], 16)),
+ timestamp=ctx.message.created_at)
+ embed.add_field(name="Designation", value=str(designation), inline=True)
+ embed.add_field(name="Tier", value=str(tier), inline=True)
+ embed.set_thumbnail(url=image_url[0])
+ await ctx.send(embed=embed)
+
+
+
+ @_halowars.command(pass_context=True, name="playlist")
+ async def halowars_playlist(self, ctx, active=True):
+ """Gathers data about active Halo 5 playlists"""
+ data = await self.request_url("https://www.haloapi.com/metadata/hw2/playlists")
+ list_active = []
+ for playlist in data["ContentItems"]:
+ # print(playlist)
+ if not playlist["View"]["HW2Playlist"]["Hide"]:
+ list_active.append(playlist)
+ await self.halowars_playlist_menu(ctx, list_active)
+
+ @commands.group(pass_context=True, name='haloset')
+ @checks.admin_or_permissions(manage_server=True)
+ async def _haloset(self, ctx):
+ """Command for setting required access information for the API.
+ To get this info, visit https://developer.haloapi.com and create a new application."""
+ pass
+
+ @_haloset.command(pass_context=True)
+ async def tokens(self, ctx, subscription_key, language="en"):
+ """Set the tokens and language for requests from the API"""
+ await self.config.api_token.token.set(subscription_key)
+ await self.config.api_token.language.set(language)
+ await ctx.send("Halo API credentials set!")
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/halo/info.json b/halo/info.json
new file mode 100644
index 0000000..ae0a29a
--- /dev/null
+++ b/halo/info.json
@@ -0,0 +1,19 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Gathers information from the Halo API and posts it on discord.",
+ "install_msg":"Set your API key from https://developer.haloapi.com and access different stats from Halo 5 and Halo Wars 2.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Halo",
+ "permissions":[],
+ "requirements":[],
+ "short":"halo",
+ "tags":[
+ "general"
+ ]
+}
\ No newline at end of file
diff --git a/hockey/__init__.py b/hockey/__init__.py
new file mode 100644
index 0000000..d36b041
--- /dev/null
+++ b/hockey/__init__.py
@@ -0,0 +1,4 @@
+from .hockey import Hockey
+
+def setup(bot):
+ bot.add_cog(Hockey(bot))
\ No newline at end of file
diff --git a/hockey/constants.py b/hockey/constants.py
new file mode 100644
index 0000000..0ac6b67
--- /dev/null
+++ b/hockey/constants.py
@@ -0,0 +1,425 @@
+BASE_URL = "https://statsapi.web.nhl.com"
+HEADSHOT_URL = "https://nhl.bamcontent.com/images/headshots/current/168x168/{}.jpg"
+CONFIG_ID = 13457745779
+TEAMS = {
+ "Anaheim Ducks" : {
+ "away" : "#F95602",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "AnaheimDucks:381568940108939265",
+ "home" : "#B5985A",
+ "id" : 24,
+ "invite" : "https://discord.gg/Pqf9W6M",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281720124/256x256/cut.png",
+ "team_url" : "http://www.anaheimducks.com",
+ "timezone" : "US/Pacific"
+ },
+ "Arizona Coyotes" : {
+ "away" : "#E2D6B5",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "ArizonaCoyotes:381568940083511297",
+ "home" : "#8C2633",
+ "id" : 53,
+ "invite" : "https://discord.gg/dguBmGm",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281720888/256x256/cut.png",
+ "team_url" : "http://www.arizonacoyotes.com",
+ "timezone" : "US/Arizona"
+ },
+ "Boston Bruins" : {
+ "away" : "#111111",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "BostonBruins:381568939857149954",
+ "home" : "#FCB514",
+ "id" : 6,
+ "invite" : "https://discord.gg/BbPN25d",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281719378/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=1RCjTRXRk1Y",
+ "timezone" : "US/Eastern"
+ },
+ "Buffalo Sabres" : {
+ "away" : "#FCB514",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "BuffaloSabres:381568940658130944",
+ "home" : "#002654",
+ "id" : 7,
+ "invite" : "https://discord.gg/zbDhqmt",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723274/256x256/cut.png",
+ "team_url" : "http://www.sabres.com",
+ "timezone" : "US/Eastern"
+ },
+ "Calgary Flames" : {
+ "away" : "#F1BE48",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "CalgaryFlames:381568940314460171",
+ "home" : "#B72B35",
+ "id" : 20,
+ "invite" : "https://discord.gg/PAZsyWE",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281720898/256x256/cut.png",
+ "team_url" : "http://www.calgaryflames.com",
+ "timezone" : "US/Mountain"
+ },
+ "Carolina Hurricanes" : {
+ "away" : "#A4A9AD",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "CarolinaHurricanes:381568942436646914",
+ "home" : "#B72B35",
+ "id" : 12,
+ "invite" : "https://discord.gg/mqGDdrr",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726500/256x256/cut.png",
+ "team_url" : "http://www.carolinahurricanes.com",
+ "timezone" : "US/Eastern"
+ },
+ "Chicago Blackhawks" : {
+ "away" : "#000000",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "ChicagoBlackhawks:381568943279702036",
+ "home" : "#CF0A2C",
+ "id" : 16,
+ "invite" : "https://discord.gg/DkuRmj7",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726514/256x256/cut.png",
+ "team_url" : "http://www.chicagoblackhawks.com",
+ "timezone" : "US/Central"
+ },
+ "Colorado Avalanche" : {
+ "away" : "#236192",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "ColoradoAvalanche:381568943170519040",
+ "home" : "#6F263D",
+ "id" : 21,
+ "invite" : "https://discord.gg/tamwt88",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721016/256x256/cut.png",
+ "team_url" : "http://www.coloradoavalanche.com",
+ "timezone" : "US/Mountain"
+ },
+ "Columbus Blue Jackets" : {
+ "away" : "#CE1126",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "ColumbusBlueJackets:381568942839300107",
+ "home" : "#041E42",
+ "id" : 29,
+ "invite" : "https://discord.gg/wJKdYtG",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726518/256x256/cut.png",
+ "team_url" : "http://www.bluejackets.com",
+ "timezone" : "US/Eastern"
+ },
+ "Dallas Stars" : {
+ "away" : "#8F8F8C",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "DallasStars:381568942520664065",
+ "home" : "#006847",
+ "id" : 25,
+ "invite" : "https://discord.gg/KzxfCH4",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726660/256x256/cut.png",
+ "team_url" : "http://www.dallasstars.com",
+ "timezone" : "US/Central"
+ },
+ "Detroit Red Wings" : {
+ "away" : "#FFFFFF",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "DetroitRedWings:381568943162130442",
+ "home" : "#C8102E",
+ "id" : 17,
+ "invite" : "https://discord.gg/zp9WjV9",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723286/256x256/cut.png",
+ "team_url" : "http://www.detroitredwings.com",
+ "timezone" : "US/Eastern"
+ },
+ "Edmonton Oilers" : {
+ "away" : "#041E41",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "EdmontonOilers:381568942721728513",
+ "home" : "#FF4C00",
+ "id" : 22,
+ "invite" : "https://discord.gg/6XKZyxy",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721030/256x256/cut.png",
+ "team_url" : "https://youtu.be/xXwkD8N8TjY?t=1m3s",
+ "timezone" : "US/Mountain"
+ },
+ "Florida Panthers" : {
+ "away" : "#041E42",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "FloridaPanthers:381568943137095680",
+ "home" : "#C8102E",
+ "id" : 13,
+ "invite" : "https://discord.gg/cedDpzj",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723310/256x256/cut.png",
+ "team_url" : "http://www.floridapanthers.com",
+ "timezone" : "US/Eastern"
+ },
+ "Los Angeles Kings" : {
+ "away" : "#B2B7BB",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "LosAngelesKings:381568942105296898",
+ "home" : "#111111",
+ "id" : 26,
+ "invite" : "https://discord.gg/H6EH73h",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721042/256x256/cut.png",
+ "team_url" : "http://www.lakings.com",
+ "timezone" : "US/Mountain"
+ },
+ "Minnesota Wild" : {
+ "away" : "#C51230",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "MinnesotaWild:381568942596030475",
+ "home" : "#004F30",
+ "id" : 30,
+ "invite" : "https://discord.gg/CT2HUUV",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721058/256x256/cut.png",
+ "team_url" : "http://www.wild.com",
+ "timezone" : "US/Central"
+ },
+ "Montr\u00e9al Canadiens" : {
+ "away" : "#192168",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "MontrealCanadiens:381568942486847491",
+ "home" : "#AF1E2D",
+ "id" : 8,
+ "invite" : "https://discord.gg/rhabs",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723300/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=9YFtlvDOVVE",
+ "timezone" : "US/Eastern"
+ },
+ "Nashville Predators" : {
+ "away" : "#041E42",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "NashvillePredators:381568942944157706",
+ "home" : "#FFB81C",
+ "id" : 18,
+ "invite" : "https://discord.gg/Z7DF8zE",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721070/256x256/cut.png",
+ "team_url" : "http://www.nashvillepredators.com",
+ "timezone" : "US/Central"
+ },
+ "New Jersey Devils" : {
+ "away" : "#000000",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "NewJerseyDevils:381568942537179138",
+ "home" : "#E03A3E",
+ "id" : 1,
+ "invite" : "https://discord.gg/4TtS8m4",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726626/256x256/cut.png",
+ "team_url" : "http://www.truesince82.com",
+ "timezone" : "US/Eastern"
+ },
+ "New York Islanders" : {
+ "away" : "#F47920",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "NewYorkIslanders:381568942948352011",
+ "home" : "#00529B",
+ "id" : 2,
+ "invite" : "https://discord.gg/MSHNyqB",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726632/256x256/cut.png",
+ "team_url" : "http://www.newyorkislanders.com",
+ "timezone" : "US/Eastern"
+ },
+ "New York Rangers" : {
+ "away" : "#C8102E",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "NewYorkRangers:381568942898151435",
+ "home" : "#0038A8",
+ "id" : 3,
+ "invite" : "https://discord.gg/zDWnpHM",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281718864/256x256/cut.png",
+ "team_url" : "http://www.newyorkrangers.com",
+ "timezone" : "US/Eastern"
+ },
+ "Ottawa Senators" : {
+ "away" : "#CBA044",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "OttawaSenators:381568942776254475",
+ "home" : "#E31837",
+ "id" : 9,
+ "invite" : "https://discord.gg/VQzYRKP",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723314/256x256/cut.png",
+ "team_url" : "http://www.ottawasenators.com",
+ "timezone" : "US/Eastern"
+ },
+ "Philadelphia Flyers" : {
+ "away" : "#000000",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "PhiladelphiaFlyers:381568942004764673",
+ "home" : "#F74902",
+ "id" : 4,
+ "invite" : "https://discord.gg/U5PdQaA",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726640/256x256/cut.png",
+ "team_url" : "http://www.philadelphiaflyers.com",
+ "timezone" : "US/Eastern"
+ },
+ "Pittsburgh Penguins" : {
+ "away" : "#CFC493",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "PittsburghPenguins:381568942587510796",
+ "home" : "#FCB514",
+ "id" : 5,
+ "invite" : "https://discord.gg/nZ2vuWj",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726648/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=lDw7GqD_xro",
+ "timezone" : "US/Eastern"
+ },
+ "San Jose Sharks" : {
+ "away" : "#EA7200",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "SanJoseSharks:381568942864334848",
+ "home" : "#006D75",
+ "id" : 28,
+ "invite" : "https://discord.gg/X9Xr8Zn",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721090/256x256/cut.png",
+ "team_url" : "http://www.sjsharks.com",
+ "timezone" : "US/Pacific"
+ },
+ "St. Louis Blues" : {
+ "away" : "#FCB514",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "StLouisBlues:381568942474526724",
+ "home" : "#002F87",
+ "id" : 19,
+ "invite" : "https://discord.gg/013pcvc9v5MCl64Ic",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281752302/256x256/cut.png",
+ "team_url" : "http://www.stlouisblues.com",
+ "timezone" : "US/Central"
+ },
+ "Tampa Bay Lightning" : {
+ "away" : "#FFFFFF",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "TampaBayLightning:381568942054834196",
+ "home" : "#002868",
+ "id" : 14,
+ "invite" : "https://discord.gg/PZ3bDJA",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723320/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=UjbdFKsHD_M",
+ "timezone" : "US/Eastern"
+ },
+ "Team Atlantic" : {
+ "away" : "#fef5aa",
+ "conference" : "",
+ "division" : "",
+ "emoji" : "Atlantic:406575132895739924",
+ "home" : "#032c88",
+ "id" : 87,
+ "invite" : "",
+ "logo" : "https://i.imgur.com/I1NWsss.png",
+ "team_url" : "http://nhl.coms.com",
+ "timezone" : "US/Eastern"
+ },
+ "Team Central" : {
+ "away" : "#111111",
+ "conference" : "",
+ "division" : "",
+ "emoji" : "Central:406575132656533516",
+ "home" : "#ff6668",
+ "id" : 89,
+ "invite" : "",
+ "logo" : "https://i.imgur.com/Adrh7aD.png",
+ "team_url" : "http://nhl.coms.com",
+ "timezone" : "US/Central"
+ },
+ "Team Metropolitan" : {
+ "away" : "#d1cad2",
+ "conference" : "",
+ "division" : "",
+ "emoji" : "Metropolitan:406575133113712640",
+ "home" : "#f6e98b",
+ "id" : 88,
+ "invite" : "",
+ "logo" : "https://i.imgur.com/l4nxmZx.png",
+ "team_url" : "http://nhl.coms.com",
+ "timezone" : "US/Mountain"
+ },
+ "Team Pacific" : {
+ "away" : "#FFFFFF",
+ "conference" : "",
+ "division" : "",
+ "emoji" : "Pacific:406575133096935437",
+ "home" : "#ff2734",
+ "id" : 90,
+ "invite" : "",
+ "logo" : "https://i.imgur.com/e5a4y36.png",
+ "team_url" : "http://nhl.coms.com",
+ "timezone" : "US/Pacific"
+ },
+ "Toronto Maple Leafs" : {
+ "away" : "#FFFFFF",
+ "conference" : "Eastern",
+ "division" : "Atlantic",
+ "emoji" : "TorontoMapleLeafs:381568943011135488",
+ "home" : "#003E7E",
+ "id" : 10,
+ "invite" : "https://discord.gg/VwDTAhk",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723324/256x256/cut.png",
+ "team_url" : "http://www.mapleleafs.com",
+ "timezone" : "US/Eastern"
+ },
+ "Vancouver Canucks" : {
+ "away" : "#008852",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "VancouverCanucks:381568942914928641",
+ "home" : "#001F5C",
+ "id" : 23,
+ "invite" : "https://discord.gg/UTZ5Vrb",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281721212/256x256/cut.png",
+ "team_url" : "http://www.canucks.com",
+ "timezone" : "US/Pacific"
+ },
+ "Vegas Golden Knights" : {
+ "away" : "#333F42",
+ "conference" : "Western",
+ "division" : "Pacific",
+ "emoji" : "VegasGoldenKnights:381568942465875970",
+ "home" : "#B4975A",
+ "id" : 54,
+ "invite" : "https://discord.gg/dMKq7RH",
+ "logo" : "https://nhl.bamcontent.com/images/photos/284409696/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=QrctmCqhq6o",
+ "timezone" : "US/Pacific"
+ },
+ "Washington Capitals" : {
+ "away" : "#CF0A2C",
+ "conference" : "Eastern",
+ "division" : "Metropolitan",
+ "emoji" : "WashingtonCapitals:381568942541373440",
+ "home" : "#041E41",
+ "id" : 15,
+ "invite" : "https://discord.gg/CbjPuTM",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281726654/256x256/cut.png",
+ "team_url" : "http://www.washingtoncapitals.com",
+ "timezone" : "US/Eastern"
+ },
+ "Winnipeg Jets" : {
+ "away" : "#AC162C",
+ "conference" : "Western",
+ "division" : "Central",
+ "emoji" : "WinnipegJets:381568942700888065",
+ "home" : "#041E41",
+ "id" : 52,
+ "invite" : "https://discord.gg/tbyU5KF",
+ "logo" : "https://nhl.bamcontent.com/images/photos/281723512/256x256/cut.png",
+ "team_url" : "https://www.youtube.com/watch?v=jJnj0-aX_es",
+ "timezone" : "US/Central"
+ }
+}
\ No newline at end of file
diff --git a/hockey/embeds.py b/hockey/embeds.py
new file mode 100644
index 0000000..d7e072b
--- /dev/null
+++ b/hockey/embeds.py
@@ -0,0 +1,83 @@
+import discord
+import aiohttp
+from datetime import datetime
+from .constants import BASE_URL, TEAMS, HEADSHOT_URL
+from .helper import *
+from .standings import Standings
+from redbot.core.i18n import Translator
+
+_ = Translator("Hockey", __file__)
+
+
+async def make_rules_embed(guild, team, rules):
+ """
+ Builds the rule embed for the server
+ """
+ warning = _("***Any violation of the [Discord TOS](https://discordapp.com/terms) "
+ "or [Community Guidelines](https://discordapp.com/guidelines) will "
+ "result in immediate banning and possibly reported to discord.***")
+ em = discord.Embed(colour=int(TEAMS[team]["home"].replace("#", ""), 16))
+ em.description = rules
+ em.title = _("__RULES__")
+ em.add_field(name=_("__**WARNING**__"), value=warning)
+ em.set_thumbnail(url=guild.icon_url)
+ em.set_author(name=guild.name, icon_url=guild.icon_url)
+ return em
+
+async def make_leaderboard_embed(guild, post_list, page=0):
+ """
+ Makes the leaderboard embed
+ """
+ leaderboard = post_list["lists"][page]
+ style = post_list["type"]
+ em = discord.Embed(timestamp=datetime.utcnow())
+ description = ""
+ for msg in leaderboard:
+ description += msg
+ em.description = description
+ em.set_author(name=guild.name + _(" Pickems ") + style + _(" Leaderboard"), icon_url=guild.icon_url)
+ em.set_thumbnail(url=guild.icon_url)
+ em.set_footer(text=_("Page") + " {}/{}".format(page+1, len(post_list["lists"])))
+ return em
+
+
+async def roster_embed(post_list, page):
+ """
+ Builds the embed for players by stats in the current season
+ """
+ player_list = post_list[page]
+ url = BASE_URL + player_list["person"]["link"] + "?expand=person.stats&stats=yearByYear"
+ async with aiohttp.ClientSession() as session:
+ async with session.get(url) as resp:
+ player_data = await resp.json()
+ player = player_data["people"][0]
+ year_stats = [league for league in player["stats"][0]["splits"] if league["league"]["name"] == "National Hockey League"][-1]
+ name = player["fullName"]
+ number = player["primaryNumber"]
+ position = player["primaryPosition"]["name"]
+ headshot = HEADSHOT_URL.format(player["id"])
+ team = player["currentTeam"]["name"]
+ em = discord.Embed(colour=int(TEAMS[team]["home"].replace("#", ""), 16))
+ em.set_author(name="{} #{}".format(name, number), url=TEAMS[team]["team_url"], icon_url=TEAMS[team]["logo"])
+ em.add_field(name="Position", value=position)
+ em.set_thumbnail(url=headshot)
+ if position != "Goalie":
+ post_data = {_("Shots") : year_stats["stat"]["shots"],
+ _("Goals") : year_stats["stat"]["goals"],
+ _("Assists") : year_stats["stat"]["assists"],
+ _("Hits") : year_stats["stat"]["hits"],
+ _("Face Off Percent") : year_stats["stat"]["faceOffPct"],
+ "+/-" : year_stats["stat"]["plusMinus"],
+ _("Blocked Shots") : year_stats["stat"]["blocked"],
+ _("PIM") : year_stats["stat"]["pim"]}
+ for key, value in post_data.items():
+ if value != 0.0:
+ em.add_field(name=key, value=value)
+ else:
+ saves = year_stats["stat"]["saves"]
+ save_percentage = year_stats["stat"]["savePercentage"]
+ goals_against_average = year_stats["stat"]["goalAgainstAverage"]
+ em.add_field(name=_("Saves"), value=saves)
+ em.add_field(name=_("Save Percentage"), value=save_percentage)
+ em.add_field(name=_("Goals Against Average"), value=goals_against_average)
+ return em
diff --git a/hockey/emoji.yaml b/hockey/emoji.yaml
new file mode 100644
index 0000000..afee032
--- /dev/null
+++ b/hockey/emoji.yaml
@@ -0,0 +1,72 @@
+Anaheim Ducks:
+- AnaheimDucks:381568940108939265
+Arizona Coyotes:
+- ArizonaCoyotes:381568940083511297
+Boston Bruins:
+- BostonBruins:381568939857149954
+Buffalo Sabres:
+- BuffaloSabres:381568940658130944
+Calgary Flames:
+- CalgaryFlames:381568940314460171
+Carolina Hurricanes:
+- CarolinaHurricanes:381568942436646914
+Chicago Blackhawks:
+- ChicagoBlackhawks:381568943279702036
+Colorado Avalanche:
+- ColoradoAvalanche:381568943170519040
+Columbus Blue Jackets:
+- ColumbusBlueJackets:381568942839300107
+Dallas Stars:
+- DallasStars:381568942520664065
+Detroit Red Wings:
+- DetroitRedWings:381568943162130442
+Edmonton Oilers:
+- EdmontonOilers:381568942721728513
+Florida Panthers:
+- FloridaPanthers:381568943137095680
+Los Angeles Kings:
+- LosAngelesKings:381568942105296898
+Minnesota Wild:
+- MinnesotaWild:381568942596030475
+Montréal Canadiens:
+- MontrealCanadiens:381568942486847491
+Nashville Predators:
+- NashvillePredators:381568942944157706
+New Jersey Devils:
+- NewJerseyDevils:381568942537179138
+New York Islanders:
+- NewYorkIslanders:381568942948352011
+New York Rangers:
+- NewYorkRangers:381568942898151435
+Ottawa Senators:
+- OttawaSenators:381568942776254475
+Philadelphia Flyers:
+- PhiladelphiaFlyers:381568942004764673
+Pittsburgh Penguins:
+- PittsburghPenguins:381568942587510796
+San Jose Sharks:
+- SanJoseSharks:381568942864334848
+St. Louis Blues:
+- StLouisBlues:381568942474526724
+Tampa Bay Lightning:
+- TampaBayLightning:381568942054834196
+Team Atlantic:
+- Atlantic:406575132895739924
+Team Central:
+- Central:406575132656533516
+Team Metropolitan:
+- Metropolitan:406575133113712640
+Team Pacific:
+- Pacific:406575133096935437
+Toronto Maple Leafs:
+- TorontoMapleLeafs:381568943011135488
+Vancouver Canucks:
+- VancouverCanucks:381568942914928641
+Vegas Golden Knights:
+- VegasGoldenKnights:381568942465875970
+Washington Capitals:
+- WashingtonCapitals:381568942541373440
+Winnipeg Jets:
+- WinnipegJets:381568942700888065
+Other:
+- nhl:496510372828807178
diff --git a/hockey/errors.py b/hockey/errors.py
new file mode 100644
index 0000000..a9d1221
--- /dev/null
+++ b/hockey/errors.py
@@ -0,0 +1,14 @@
+class HockeyError(Exception):
+ pass
+
+class UserHasVotedError(HockeyError):
+ pass
+
+class VotingHasEndedError(HockeyError):
+ pass
+
+class NotAValidTeamError(HockeyError):
+ pass
+
+class InvalidFileError(HockeyError):
+ pass
\ No newline at end of file
diff --git a/hockey/game.py b/hockey/game.py
new file mode 100644
index 0000000..31e0243
--- /dev/null
+++ b/hockey/game.py
@@ -0,0 +1,567 @@
+import aiohttp
+from datetime import datetime
+from redbot.core import Config
+from .embeds import *
+from .pickems import Pickems
+from .constants import BASE_URL, TEAMS
+from .goal import Goal
+from .helper import *
+from .standings import Standings
+import discord
+from redbot.core.i18n import Translator
+
+
+_ = Translator("Hockey", __file__)
+
+class Game:
+ """
+ This is the object that handles game information
+ game state updates and goal posts
+ """
+ def __init__(self, game_state:str, home_team: str, away_team:str, period:int,
+ home_shots:int, away_shots:int, home_score:int, away_score:int, game_start:str, goals:list,
+ home_goals:list, away_goals:list, home_abr:str, away_abr:str, period_ord:str,
+ period_time_left:str, plays:list, first_star:str, second_star:str, third_star:str):
+ super().__init__()
+ self.game_state = game_state
+ self.home_team = home_team
+ self.away_team = away_team
+ self.home_shots = home_shots
+ self.away_shots = away_shots
+ self.home_score = home_score
+ self.away_score = away_score
+ self.goals = goals
+ self.home_goals = home_goals
+ self.away_goals = away_goals
+ self.home_abr = home_abr
+ self.away_abr = away_abr
+ self.period = period
+ self.period_ord = period_ord
+ self.period_time_left = period_time_left
+ self.plays = plays
+ self.game_start = datetime.strptime(game_start, "%Y-%m-%dT%H:%M:%SZ")
+ self.home_logo = TEAMS[home_team]["logo"] if home_team in TEAMS else "https://www-league.nhlstatic.com/images/logos/league-light/133.svg"
+ self.away_logo = TEAMS[away_team]["logo"] if away_team in TEAMS else "https://www-league.nhlstatic.com/images/logos/league-light/133.svg"
+ self.home_emoji = "<:{}>".format(TEAMS[home_team]["emoji"]) if home_team in TEAMS else "<:nhl:496510372828807178>"
+ self.away_emoji = "<:{}>".format(TEAMS[away_team]["emoji"]) if away_team in TEAMS else "<:nhl:496510372828807178>"
+ self.first_star = first_star
+ self.second_star = second_star
+ self.third_star = third_star
+ self.config = hockey_config()
+
+ def to_json(self) -> dict:
+ return {
+ "game_state" : self.game_state,
+ "home_team" : self.home_team,
+ "away_team" : self.away_team,
+ "home_shots" : self.home_shots,
+ "away_shots" : self.away_shots,
+ "home_score" : self.home_score,
+ "away_score" : self.away_score,
+ "goals" : [goal.to_json() for goal in self.goals],
+ "home_goals" : self.home_goals,
+ "away_goals" : self.away_goals,
+ "home_abr" : self.home_abr,
+ "away_abr" : self.away_abr,
+ "period" : self.period,
+ "period_ord" : self.period_ord,
+ "period_time_left" : self.period_time_left,
+ "plays" : self.plays,
+ "game_start" : self.game_start.strftime("%Y-%m-%dT%H:%M:%SZ"),
+ "home_logo" : self.home_logo,
+ "away_logo" : self.away_logo,
+ "home_emoji" : self.home_emoji,
+ "away_emoji" : self.away_emoji,
+ "first_star" : self.first_star,
+ "second_star" : self.second_star,
+ "third_star" : self.third_star
+ }
+
+
+ @staticmethod
+ async def get_games(team=None, start_date:datetime=None, end_date:datetime=None):
+ """
+ Get a specified days games, defaults to the current day
+ requires a datetime object
+ returns a list of game objects
+ if a start date and an end date are not provided to the url
+ it returns only todays games
+
+ returns a list of game objects
+ """
+ games_list = await Game.get_games_list(team, start_date, end_date)
+ return_games_list = []
+ if games_list != []:
+ for games in games_list:
+ try:
+ async with aiohttp.ClientSession() as session:
+ async with session.get(BASE_URL + games["link"]) as resp:
+ data = await resp.json()
+ return_games_list.append(await Game.from_json(data))
+ except Exception as e:
+ print(_("Error grabbing game data: ")+"{}".format(e))
+ continue
+ return return_games_list
+
+
+ @staticmethod
+ async def get_games_list(team=None, start_date:datetime=None, end_date:datetime=None):
+ """
+ Get a specified days games, defaults to the current day
+ requires a datetime object
+ returns a list of game objects
+ if a start date and an end date are not provided to the url
+ it returns only todays games
+
+ returns a list of games
+ """
+ start_date_str = start_date.strftime("%Y-%m-%d") if start_date is not None else None
+ end_date_str = end_date.strftime("%Y-%m-%d") if end_date is not None else None
+ if start_date is None and end_date is None:
+ # if no dates are provided get todays current schedule
+ url = BASE_URL + "/api/v1/schedule"
+ elif start_date is None and end_date is not None:
+ # if no start date is provided start with today
+ start_date_str = datetime.now().strftime("%Y-%m-%d")
+ url = f"{BASE_URL}/api/v1/schedule?startDate={start_date_str}&endDate={end_date_str}"
+ elif start_date is not None and end_date is None:
+ # if no end date is provided carry through to the following year
+ end_date_str = str(start_date.year + 1) + datetime.now().strftime("-%m-%d")
+ url = f"{BASE_URL}/api/v1/schedule?startDate={start_date_str}&endDate={end_date_str}"
+ else:
+ url = f"{BASE_URL}/api/v1/schedule?startDate={start_date_str}&endDate={end_date_str}"
+ if team not in ["all", None]:
+ # if a team is provided get just that TEAMS data
+ url += "&teamId={}".format(TEAMS[team]["id"])
+ async with aiohttp.ClientSession() as session:
+ async with session.get(url) as resp:
+ data = await resp.json()
+ game_list = [game for date in data["dates"] for game in date["games"]]
+ return game_list
+
+ @staticmethod
+ async def get_game_embed(post_list, page):
+ """
+ Makes the game object from provided URL
+ """
+ game = post_list[page]
+
+ if type(game) is dict:
+ async with aiohttp.ClientSession() as session:
+ async with session.get(BASE_URL + game["link"]) as resp:
+ game_json = await resp.json()
+ data = await Game.from_json(game_json)
+ print(BASE_URL + game["link"])
+ else:
+ data = game
+
+ return await data.make_game_embed()
+
+
+ async def make_game_embed(self):
+ """
+ Builds the game embed when the command is called
+ provides as much data as possible
+ """
+ team_url = TEAMS[self.home_team]["team_url"] if self.home_team in TEAMS else "https://nhl.com"
+ # timestamp = datetime.strptime(self.game_start, "%Y-%m-%dT%H:%M:%SZ")
+ title = "{away} @ {home} {state}".format(away=self.away_team, home=self.home_team, state=self.game_state)
+ colour = int(TEAMS[self.home_team]["home"].replace("#", ""), 16) if self.home_team in TEAMS else None
+
+ em = discord.Embed(timestamp=self.game_start)
+ if colour is not None:
+ em.colour = colour
+ em.set_author(name=title, url=team_url, icon_url=self.home_logo)
+ em.set_thumbnail(url=self.home_logo)
+ em.set_footer(text=_("Game start "), icon_url=self.away_logo)
+ if self.game_state == "Preview":
+ home_str, away_str = await self.get_stats_msg()
+ em.add_field(name=f"{self.home_emoji} {self.home_team} {self.home_emoji}", value=home_str)
+ em.add_field(name=f"{self.away_emoji} {self.away_team} {self.away_emoji}", value=away_str)
+ if self.game_state != "Preview":
+ home_msg = _("Goals: **") + str(self.home_score) + _("** \nShots: **") + str(self.home_shots) + "**"
+ away_msg = _("Goals: **") + str(self.away_score) + _("** \nShots: **") + str(self.away_shots) + "**"
+ em.add_field(name=f"{self.home_emoji} {self.home_team} {self.home_emoji}", value=home_msg)
+ em.add_field(name=f"{self.away_emoji} {self.away_team} {self.away_emoji}", value=away_msg)
+ if self.goals != []:
+ goal_msg = ""
+ first_goals = [goal for goal in self.goals if goal.period_ord == "1st"]
+ second_goals = [goal for goal in self.goals if goal.period_ord == "2nd"]
+ third_goals = [goal for goal in self.goals if goal.period_ord == "3rd"]
+ ot_goals = [goal for goal in self.goals if goal.period_ord == "OT"]
+ so_goals = [goal for goal in self.goals if goal.period_ord == "SO"]
+ list_goals = {"1st":first_goals, "2nd":second_goals, "3rd":third_goals, "OT":ot_goals}
+ for goals in list_goals:
+ ordinal = goals
+ goal_msg = ""
+ for goal in list_goals[ordinal]:
+ emoji = TEAMS[goal.team_name]["emoji"]
+ goal_msg += f"<:{emoji}> {goal.team_name} Goal By {goal.description}\n\n"
+ if goal_msg != "":
+ em.add_field(name=str(ordinal) + _(" Period Goals"), value=goal_msg)
+ if len(so_goals) != 0:
+ home_msg = ""
+ away_msg = ""
+ score = "☑\n"
+ miss = "❌\n"
+ for goal in so_goals:
+ if goal.event in ["Shot", "Missed Shot"] and goal.period_ord == "SO":
+ if goal.team_name == self.home_team:
+ home_msg += miss
+ else:
+ away_msg += miss
+ if goal.event in ["Goal"] and goal.period_ord == "SO":
+ if goal.team_name == self.home_team:
+ home_msg += score
+ else:
+ away_msg += score
+ em.add_field(name=f"{self.home_team}"+_(" Shootout"), value=home_msg)
+ em.add_field(name=f"{self.away_team}"+_(" Shootout"), value=away_msg)
+ if self.first_star is not None:
+ stars = f"⭐ {self.first_star}\n⭐⭐ {self.second_star}\n⭐⭐⭐ {self.third_star}"
+ em.add_field(name=_("Stars of the game"), value=stars)
+ if self.game_state == "Live":
+ period = self.period_ord
+ if self.period_time_left[0].isdigit():
+ msg = str(self.period_time_left) + _(" Left in the ") + str(period) + _(" period")
+ else:
+ msg = str(self.period_time_left) + _(" Left in the ") + str(period) + _(" period")
+ em.add_field(name="Period", value=msg)
+ return em
+
+ async def game_state_embed(self):
+ """
+ Makes the game state embed based on the game self provided
+ """
+ post_state = ["all", self.home_team, self.away_team]
+ # timestamp = datetime.strptime(self.game_start, "%Y-%m-%dT%H:%M:%SZ")
+ title = f"{self.away_team} @ {self.home_team} {self.game_state}"
+ em = discord.Embed(timestamp=self.game_start)
+ home_field = "{0} {1} {0}".format(self.home_emoji, self.home_team)
+ away_field = "{0} {1} {0}".format(self.away_emoji, self.away_team)
+ if self.game_state != "Preview":
+ home_str = _("Goals: **") + str(self.home_score) + _("** \nShots: **") + str(self.home_shots) + "**"
+ away_str = _("Goals: **") + str(self.away_score) + _("** \nShots: **") + str(self.away_shots) + "**"
+ else:
+ home_str, away_str = await self.get_stats_msg()
+ em.add_field(name=home_field, value=home_str, inline=True)
+ em.add_field(name=away_field, value=away_str, inline=True)
+ colour = int(TEAMS[self.home_team]["home"].replace("#", ""), 16) if self.home_team in TEAMS else None
+ if colour is not None:
+ em.colour = colour
+ home_url = TEAMS[self.home_team]["team_url"] if self.home_team in TEAMS else "https://nhl.com"
+ if self.first_star is not None:
+ stars = f"⭐ {self.first_star}\n⭐⭐ {self.second_star}\n⭐⭐⭐ {self.third_star}"
+ em.add_field(name=_("Stars of the game"), value=stars)
+ em.set_author(name=title, url=home_url, icon_url=self.home_logo)
+ em.set_thumbnail(url=self.home_logo)
+ em.set_footer(text=_("Game start "), icon_url=self.away_logo)
+ return em
+
+ async def game_state_text(self):
+ post_state = ["all", self.home_team, self.away_team]
+ # timestamp = datetime.strptime(self.game_start, "%Y-%m-%dT%H:%M:%SZ")
+ time_string = utc_to_local(self.game_start).strftime("%I:%M %p %Z")
+ em = (f"{self.away_emoji}{self.away_team} @ {self.home_emoji}{self.home_team} "
+ f"{self.game_state}\n({time_string})")
+ if self.game_state != "Preview":
+ em = (_("**__Current Score__**\n") + f"{self.home_emoji} {self.home_team}: {self.home_score}\n"+
+ f"{self.away_emoji} {self.away_team}: {self.away_score}")
+ return em
+
+ async def get_stats_msg(self):
+ """
+ returns team stats on the season from standings object
+ """
+ msg = "GP:**{gp}** W:**{wins}** L:**{losses}\n**OT:**{ot}** PTS:**{pts}** S:**{streak}**\n"
+ streak_types = {"wins":"W", "losses":"L", "ot":"OT"}
+ home_str = "GP:**0** W:**0** L:**0\n**OT:**0** PTS:**0** S:**0**\n"
+ away_str = "GP:**0** W:**0** L:**0\n**OT:**0** PTS:**0** S:**0**\n"
+ try:
+ stats, home_i = await Standings.get_team_standings(self.home_team)
+ for team in stats:
+ if team.name == self.away_team:
+ streak = "{} {}".format(team.streak, streak_types[team.streak_type])
+ away_str = msg.format(wins=team.wins, losses=team.losses,\
+ ot=team.ot, pts=team.pts, gp=team.gp, streak=streak)
+ if team.name == self.home_team:
+ streak = "{} {}".format(team.streak, streak_types[team.streak_type])
+ home_str = msg.format(wins=team.wins, losses=team.losses,\
+ ot=team.ot, pts=team.pts, gp=team.gp, streak=streak)
+ except:
+ pass
+ return home_str, away_str
+
+ async def check_game_state(self, bot):
+ post_state = ["all", self.home_team, self.away_team]
+ home = await get_team(self.home_team)
+ away = await get_team(self.away_team)
+ team_list = await self.config.teams()
+ # Home team checking
+ if self.game_state == "Preview":
+ """Checks if the the game state has changes from Final to Preview
+ Could be unnecessary since after Game Final it will check for next game
+ """
+ time_now = datetime.utcnow()
+ # game_time = datetime.strptime(data.game_start, "%Y-%m-%dT%H:%M:%SZ")
+ game_start = (self.game_start - time_now).total_seconds()/60
+ if "Preview" not in home["game_state"]:
+ await self.post_game_state(bot)
+ await self.save_game_state()
+ if game_start < 60 and game_start > 30 and home["game_state"] != "Preview60":
+ # Post 60 minutes until game start
+ await self.post_time_to_game_start(bot, "60")
+ await self.save_game_state("60")
+ if game_start < 30 and game_start >10 and home["game_state"] != "Preview30":
+ # Post 30 minutes until game start
+ await self.post_time_to_game_start(bot, "30")
+ await self.save_game_state("30")
+ if game_start < 10 and game_start > 0 and home["game_state"] != "Preview10":
+ # Post 10 minutes until game start
+ await self.post_time_to_game_start(bot, "10")
+ await self.save_game_state("10")
+
+ # Create channel and look for game day thread
+
+ if self.game_state == "Live":
+ """Checks what the period is and posts the game is starting in the appropriate channel"""
+ if home["period"] != self.period:
+ if await self.config.print():
+ msg = "**{} Period starting {} at {}**"
+ print(msg.format(self.period_ord, self.away_team, self.home_team))
+ await self.post_game_state(bot)
+ await self.save_game_state()
+
+ if (self.home_score + self.away_score) != 0:
+ # Check if there's goals only if there are goals
+ await self.check_team_goals(bot)
+
+ if self.game_state == "Final" and self.first_star is not None:
+ """Final game state checks"""
+ if (self.home_score + self.away_score) != 0:
+ """ Check for goal before posting game final, happens with OT games"""
+ await self.check_team_goals(bot)
+ if home["game_state"] != self.game_state and home["game_state"] != "Null":
+ # Post game final data and check for next game
+ if await self.config.print():
+ msg = "Game Final {} @ {}"
+ print(msg.format(self.home_team, self.away_team))
+ await self.post_game_state(bot)
+ await self.save_game_state()
+
+
+
+ async def post_game_state(self, bot):
+ """
+ When a game state has changed this is called to create the embed
+ and post in all channels
+ """
+ post_state = ["all", self.home_team, self.away_team]
+ state_embed = await self.game_state_embed()
+ state_text = await self.game_state_text()
+ for channels in await self.config.all_channels():
+ channel = bot.get_channel(id=channels)
+ if channel is None:
+ continue
+ guild = channel.guild
+ should_post = await check_to_post(channel, post_state)
+ if should_post:
+ game_day_channels = await self.config.guild(guild).gdc()
+ can_embed = channel.permissions_for(guild.me).embed_links
+ can_manage_webhooks = False # channel.permissions_for(guild.me).manage_webhooks
+
+ if self.game_state == "Live":
+ home_role, away_role = await get_team_role(guild, self.home_team, self.away_team)
+ if game_day_channels is not None:
+ # We don't want to ping people in the game day channels twice
+ if channel.id in game_day_channels:
+ home_role, away_role = self.home_team, self.away_team
+ msg = "**" + str(self.period_ord) + _(" Period starting ") + away_role + _(" at ") + home_role +"**"
+ try:
+ if not can_embed:
+ await channel.send(msg+"\n{}".format(state_text))
+ else:
+ await channel.send(msg, embed=state_embed)
+ except Exception as e:
+ print(_("Could not post goal in ") + str(channels) + str(e))
+
+ else:
+ if self.game_state == "Preview":
+ if game_day_channels is not None:
+ # Don't post the preview message twice in the channel
+ if channel.id in game_day_channels:
+ continue
+ try:
+ if not can_embed:
+ preview_msg = await channel.send(state_text)
+ else:
+ preview_msg = await channel.send(embed=state_embed)
+
+ # Create new pickems object for the game
+ if self.game_state == "Preview":
+ await Pickems.create_pickem_object(guild, preview_msg, channel, self)
+ if channel.permissions_for(guild.me).add_reactions:
+ try:
+ await preview_msg.add_reaction(self.away_emoji[2:-1])
+ await preview_msg.add_reaction(self.home_emoji[2:-1])
+ except Exception as e:
+ print(e)
+ except Exception as e:
+ print(_("Could not post goal in ") + str(channels) + str(e))
+
+
+ async def check_team_goals(self, bot):
+ """
+ Checks to see if a goal needs to be posted
+ """
+ home_team_data = await get_team(self.home_team)
+ away_team_data = await get_team(self.away_team)
+ all_data = await get_team("all")
+ team_list = await self.config.teams()
+ post_state = ["all", self.home_team, self.away_team]
+
+ home_goal_ids = [goal.goal_id for goal in self.home_goals]
+ away_goal_ids = [goal.goal_id for goal in self.away_goals]
+
+ home_goal_list = list(home_team_data["goal_id"])
+ away_goal_list = list(away_team_data["goal_id"])
+
+ for goal in self.goals:
+ # goal_id = str(goal["result"]["eventCode"])
+ # team = goal["team"]["name"]
+ team_data = await get_team(goal.team_name)
+ if goal.goal_id not in team_data["goal_id"]:
+ # attempts to post the goal if there is a new goal
+ msg_list = await goal.post_team_goal(bot, self)
+ team_list.remove(team_data)
+ team_data["goal_id"][goal.goal_id] = {"goal":goal.to_json(),"messages":msg_list}
+ team_list.append(team_data)
+ await self.config.teams.set(team_list)
+ continue
+ if goal.goal_id in team_data["goal_id"]:
+ # attempts to edit the goal if the scorers have changed
+ old_goal = Goal(**team_data["goal_id"][goal.goal_id]["goal"])
+ if goal.description != old_goal.description:
+ old_msgs = team_data["goal_id"][goal.goal_id]["messages"]
+ team_list.remove(team_data)
+ team_data["goal_id"][goal.goal_id]["goal"] = goal.to_json()
+ team_list.append(team_data)
+ await self.config.teams.set(team_list)
+ await goal.edit_team_goal(bot, self, old_msgs)
+ # attempts to delete the goal if it was called back
+ for goal_str in home_goal_list:
+ await Goal.remove_goal_post(bot, goal_str, self.home_team, self)
+ for goal_str in away_goal_list:
+ await Goal.remove_goal_post(bot, goal_str, self.away_team, self)
+
+ async def save_game_state(self, time_to_game_start:str="0"):
+ """
+ Saves the data do the config to compare against new data
+ """
+ home = await get_team(self.home_team)
+ away = await get_team(self.away_team)
+ team_list = await self.config.teams()
+ team_list.remove(home)
+ team_list.remove(away)
+ if self.game_state != "Final":
+ if self.game_state == "Preview" and time_to_game_start != "0":
+ home["game_state"] = self.game_state+time_to_game_start
+ away["game_state"] = self.game_state+time_to_game_start
+ else:
+ home["game_state"] = self.game_state
+ away["game_state"] = self.game_state
+ home["period"] = self.period
+ away["period"] = self.period
+ home["game_start"] = self.game_start.strftime("%Y-%m-%dT%H:%M:%SZ")
+ away["game_start"] = self.game_start.strftime("%Y-%m-%dT%H:%M:%SZ")
+ else:
+ home["game_state"] = "Null"
+ away["game_state"] = "Null"
+ home["period"] = 0
+ away["period"] = 0
+ home["goal_id"] = {}
+ away["goal_id"] = {}
+ home["game_start"] = ""
+ away["game_start"] = ""
+ team_list.append(home)
+ team_list.append(away)
+ await self.config.teams.set(team_list)
+
+
+ async def post_time_to_game_start(self, bot, time_left):
+ """
+ Post when there is 60, 30, and 10 minutes until the game starts in all channels
+ """
+ post_state = ["all", self.home_team, self.away_team]
+ for channels in await self.config.all_channels():
+ channel = bot.get_channel(id=channels)
+ if channel is None:
+ continue
+
+ should_post = await check_to_post(channel, post_state)
+ team_to_post = await self.config.channel(channel).team()
+ if should_post and "all" not in team_to_post:
+ guild = channel.guild
+ msg = (str(time_left) + _(" minutes until ") + f"{self.away_emoji} {self.away_team}"+
+ f" @ {self.home_emoji} {self.home_team}" + _(" starts"))
+ try:
+ await channel.send(msg)
+ except Exception as e:
+ print(_("Could not post goal in ") + str(channels) + str(e))
+
+ @staticmethod
+ async def from_url(url:str):
+ try:
+ async with aiohttp.ClientSession() as session:
+ async with session.get(BASE_URL + url) as resp:
+ data = await resp.json()
+ return await Game.from_json(data)
+ except Exception as e:
+ print(_("Error grabbing game data: ")+"{}".format(e))
+ return
+
+
+ @classmethod
+ async def from_json(cls, data: dict):
+ event = data["liveData"]["plays"]["allPlays"]
+ home_team = data["gameData"]["teams"]["home"]["name"]
+ away_team = data["gameData"]["teams"]["away"]["name"]
+ players = data["liveData"]["boxscore"]["teams"]["away"]["players"]
+ players.update(data["liveData"]["boxscore"]["teams"]["home"]["players"])
+ goals = [await Goal.from_json(goal, players) for goal in event if goal["result"]["eventTypeId"] == "GOAL"\
+ or (goal["result"]["eventTypeId"] in ["SHOT", "MISSED_SHOT"] and goal["about"]["ordinalNum"] == "SO")]
+
+ if "currentPeriodOrdinal" in data["liveData"]["linescore"]:
+ period_ord = data["liveData"]["linescore"]["currentPeriodOrdinal"]
+ period_time_left = data["liveData"]["linescore"]["currentPeriodTimeRemaining"]
+ events = data["liveData"]["plays"]["allPlays"]
+ else:
+ period_ord = "0"
+ period_time_left = "0"
+ events = ["."]
+ decisions = data["liveData"]["decisions"]
+ first_star = decisions["firstStar"]["fullName"] if "firstStar" in decisions else None
+ second_star = decisions["secondStar"]["fullName"] if "secondStar" in decisions else None
+ third_star = decisions["thirdStar"]["fullName"] if "thirdStar" in decisions else None
+
+ return cls(data["gameData"]["status"]["abstractGameState"],
+ data["gameData"]["teams"]["home"]["name"],
+ data["gameData"]["teams"]["away"]["name"],
+ data["liveData"]["linescore"]["currentPeriod"],
+ data["liveData"]["linescore"]["teams"]["home"]["shotsOnGoal"],
+ data["liveData"]["linescore"]["teams"]["away"]["shotsOnGoal"],
+ data["liveData"]["linescore"]["teams"]["home"]["goals"],
+ data["liveData"]["linescore"]["teams"]["away"]["goals"],
+ data["gameData"]["datetime"]["dateTime"],
+ goals,
+ [goal for goal in goals if home_team in goal.team_name],
+ [goal for goal in goals if away_team in goal.team_name],
+ data["gameData"]["teams"]["home"]["abbreviation"],
+ data["gameData"]["teams"]["away"]["abbreviation"],
+ period_ord,
+ period_time_left,
+ events,
+ first_star,
+ second_star,
+ third_star
+ )
\ No newline at end of file
diff --git a/hockey/gamedaychannels.py b/hockey/gamedaychannels.py
new file mode 100644
index 0000000..edc2dd6
--- /dev/null
+++ b/hockey/gamedaychannels.py
@@ -0,0 +1,159 @@
+from datetime import datetime
+from redbot.core import Config
+from .game import Game
+from .constants import BASE_URL, CONFIG_ID, TEAMS
+from .pickems import Pickems
+from .helper import *
+
+
+class GameDayChannels:
+ """
+ This is where the functions to handle creation and deletion
+ of game day channels is stored
+ """
+ def __init__(self):
+ pass
+
+ @staticmethod
+ async def get_chn_name(game):
+ """
+ Creates game day channel name
+ """
+ timestamp = utc_to_local(game.game_start)
+ chn_name = "{}-vs-{}-{}-{}-{}".format(game.home_abr, game.away_abr,\
+ timestamp.year, timestamp.month, timestamp.day)
+ return chn_name.lower()
+
+ @staticmethod
+ async def check_new_gdc(bot):
+ config = Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+ game_list = await Game.get_games() # Do this once so we don't spam the api
+ for guilds in await config.all_guilds():
+ guild = bot.get_guild(guilds)
+ if guild is None:
+ continue
+ if not await config.guild(guild).create_channels():
+ continue
+ team = await config.guild(guild).gdc_team()
+ if team != "all":
+ next_games = await Game.get_games_list(team, datetime.now())
+ # print(next_game)
+ if next_games != []:
+ next_game = await Game.from_url(next_games[0]["link"])
+ if next_game is None:
+ continue
+ chn_name = await GameDayChannels.get_chn_name(next_game)
+ try:
+ cur_channels = await config.guild(guild).gdc()
+ cur_channel = bot.get_channel(cur_channels[0])
+ except Exception as e:
+ print(e)
+ cur_channel = None
+ if cur_channel is None:
+ await GameDayChannels.create_gdc(bot, guild)
+ elif cur_channel.name != chn_name.lower():
+ await GameDayChannels.delete_gdc(bot, guild)
+ await GameDayChannels.create_gdc(bot, guild)
+
+ else:
+ await GameDayChannels.delete_gdc(bot, guild)
+ for game in game_list:
+ await GameDayChannels.create_gdc(bot, guild, game)
+
+ @staticmethod
+ async def create_gdc(bot, guild, game_data=None):
+ """
+ Creates a game day channel for the given game object
+ if no game object is passed it looks for the set team for the guild
+ returns None if not setup
+ """
+ config = Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+ category = bot.get_channel(await config.guild(guild).category())
+ if category is None:
+ # Return none if there's no category to create the channel
+ return
+ if game_data is None:
+ team = await config.guild(guild).gdc_team()
+
+ next_games = await Game.get_games_list(team, datetime.now())
+ if next_games != []:
+ next_game = await Game.from_url(next_games[0]["link"])
+ if next_game is None:
+ return
+ else:
+ # Return if no more games are playing for this team
+ return
+ else:
+ team = game_data.home_team
+ next_game = game_data
+
+ chn_name = await GameDayChannels.get_chn_name(next_game)
+ try:
+ new_chn = await guild.create_text_channel(chn_name, category=category)
+ except Exception as e:
+ print("Error creating channels in {}: {}".format(guild.name, e))
+ return
+ cur_channels = await config.guild(guild).gdc()
+ if cur_channels is None:
+ cur_channels = []
+ cur_channels.append(new_chn.id)
+ await config.guild(guild).gdc.set(cur_channels)
+ await config.guild(guild).create_channels.set(True)
+ await config.channel(new_chn).team.set([team])
+ delete_gdc = await config.guild(guild).delete_gdc()
+ await config.channel(new_chn).to_delete.set(delete_gdc)
+
+ # Gets the timezone to use for game day channel topic
+ # timestamp = datetime.strptime(next_game.game_start, "%Y-%m-%dT%H:%M:%SZ")
+ guild_team = await config.guild(guild).gdc_team()
+ channel_team = guild_team if guild_team != "all" else next_game.home_team
+ timezone = TEAMS[channel_team]["timezone"] if channel_team in TEAMS else TEAMS[next_game.away_team]["timezone"]
+ time_string = utc_to_local(next_game.game_start, timezone).strftime("%A %B %d, %Y at %I:%M %p %Z")
+
+ game_msg = (f"{next_game.away_team} {next_game.away_emoji} @ "
+ f"{next_game.home_team} {next_game.home_emoji} {time_string}")
+
+ await new_chn.edit(topic=game_msg)
+ if new_chn.permissions_for(guild.me).embed_links:
+ em = await next_game.game_state_embed()
+ preview_msg = await new_chn.send(embed=em)
+ else:
+ preview_msg = await new_chn.send(await next_game.game_state_text())
+
+ # Create new pickems object for the game
+ await Pickems.create_pickem_object(guild, preview_msg, new_chn, next_game)
+
+ if new_chn.permissions_for(guild.me).manage_messages:
+ await preview_msg.pin()
+ if new_chn.permissions_for(guild.me).add_reactions:
+ try:
+ await preview_msg.add_reaction(next_game.away_emoji[2:-1])
+ await preview_msg.add_reaction(next_game.home_emoji[2:-1])
+ except Exception as e:
+ print(e)
+
+ @staticmethod
+ async def delete_gdc(bot, guild):
+ """
+ Deletes all game day channels in a given guild
+ """
+ config = Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+ channels = await config.guild(guild).gdc()
+
+ for channel in channels:
+ chn = bot.get_channel(channel)
+ if chn is None:
+ try:
+ await config._clear_scope(Config.CHANNEL, str(chn))
+ except:
+ pass
+ continue
+ if not await config.channel(chn).to_delete():
+ continue
+ try:
+ await config.channel(chn).clear()
+ await chn.delete()
+ except Exception as e:
+ print(e)
+ await config.guild(guild).gdc.set([])
+
\ No newline at end of file
diff --git a/hockey/goal.py b/hockey/goal.py
new file mode 100644
index 0000000..ba98c3c
--- /dev/null
+++ b/hockey/goal.py
@@ -0,0 +1,294 @@
+from .constants import HEADSHOT_URL
+from datetime import datetime
+import discord
+from .helper import *
+from redbot.core.i18n import Translator
+try:
+ from .oilers import Oilers
+except:
+ pass
+
+
+_ = Translator("Hockey", __file__)
+
+class Goal:
+ def __init__(self, goal_id:str, team_name:str, scorer_id:int, jersey_no:str, description:str,
+ period:int, period_ord:str, time_remaining:str, time:str, home_score:int,
+ away_score:int, strength:str, empty_net:bool, event:str):
+ super().__init__()
+ self.goal_id = goal_id
+ self.team_name = team_name
+ self.scorer_id = scorer_id
+ self.headshot = HEADSHOT_URL.format(scorer_id)
+ self.jersey_no = jersey_no
+ self.description = description
+ self.period = period
+ self.period_ord = period_ord
+ self.time_remaining = time_remaining
+ self.time = datetime.strptime(time, "%Y-%m-%dT%H:%M:%SZ")
+ self.home_score = home_score
+ self.away_score = away_score
+ self.strength = strength
+ self.empty_net = empty_net
+ self.event = event
+ self.config = hockey_config()
+
+ def to_json(self) -> dict:
+ return {
+ "goal_id" : self.goal_id,
+ "team_name" : self.team_name,
+ "scorer_id" : self.scorer_id,
+ "jersey_no": self.jersey_no,
+ "description" : self.description,
+ "period" : self.period,
+ "period_ord" : self.period_ord,
+ "time_remaining" : self.time_remaining,
+ "time" : self.time.strftime("%Y-%m-%dT%H:%M:%SZ"),
+ "home_score" : self.home_score,
+ "away_score" : self.away_score,
+ "strength" : self.strength,
+ "empty_net" : self.empty_net,
+ "event" : self.event
+ }
+
+
+ @classmethod
+ async def from_json(cls, data: dict, players: dict):
+ scorer_id = [p["player"]["id"] for p in data["players"] if p["playerType"] in ["Scorer", "Shooter"]]
+ if "strength" in data["result"]:
+ str_dat = data["result"]["strength"]["name"]
+ strength = "Even Strength" if str_dat == "Even" else str_dat
+ if data["about"]["ordinalNum"] == "SO":
+ strength = "Shoot Out"
+ else:
+ strength = " "
+ empty_net = data["result"]["emptyNet"] if "emptyNet" in data["result"] else False
+ jersey_no = players["ID"+str(scorer_id[0])]["jerseyNumber"]
+ scorer = scorer_id[0]
+ return cls(data["result"]["eventCode"],
+ data["team"]["name"],
+ scorer_id[0],
+ jersey_no,
+ data["result"]["description"],
+ data["about"]["period"],
+ data["about"]["ordinalNum"],
+ data["about"]["periodTimeRemaining"],
+ data["about"]["dateTime"],
+ data["about"]["goals"]["home"],
+ data["about"]["goals"]["away"],
+ strength,
+ empty_net,
+ data["result"]["event"]
+ )
+
+ async def post_team_goal(self, bot, game_data):
+ """
+ Creates embed and sends message if a team has scored a goal
+ """
+ # scorer = self.headshots.format(goal["players"][0]["player"]["id"])
+ post_state = ["all", game_data.home_team, game_data.away_team]
+ msg_list = {}
+ if "Edmonton Oilers" in self.team_name and "missed" not in self.event.lower():
+ try:
+ hue = Oilers(bot)
+ await hue.goal_lights()
+ except:
+ pass
+ goal_embed = await self.goal_post_embed(game_data)
+ goal_text = await self.goal_post_text(game_data)
+ for channels in await self.config.all_channels():
+ role = None
+ channel = bot.get_channel(id=channels)
+ if channel is None:
+ continue
+ should_post = await check_to_post(channel, post_state)
+ if should_post:
+ try:
+ guild = channel.guild
+ game_day_channels = await self.config.guild(guild).gdc()
+ # Don't want to ping people in the game day channels
+ can_embed = channel.permissions_for(guild.me).embed_links
+ can_manage_webhooks = False # channel.permissions_for(guild.me).manage_webhooks
+
+
+ for roles in guild.roles:
+ if roles.name == self.team_name + " GOAL":
+ role = roles
+ if game_day_channels is not None:
+ # We don't want to ping people in the game day channels twice
+ if channel.id in game_day_channels:
+ role = None
+
+ if not can_embed and can_manage_webhooks:
+ # try to create a webhook with the teams info to bypass embed permissions
+ # Waiting for d.py to return messages from webhook responses
+ # After testing it doesn't look as nice as I would like
+ # Will leave it off until at some point I can make it look better
+ webhook = None
+ for hook in await channel.webhooks():
+ if hook.name == guild.me.name:
+ webhook = hook
+ if webhook is None:
+ webhook = await channel.create_webhook(name=guild.me.name)
+ url = TEAMS[self.team_name]["logo"]
+ await webhook.send(username=self.team_name, avatar_url=url, embed=goal_embed)
+ continue
+
+
+ if not can_embed and not can_manage_webhooks:
+ # Create text only message if embed_links permission is not set
+ if role is not None:
+ msg = await channel.send("{}\n{}".format(role, goal_text))
+ else:
+ msg = await channel.send("{}".format(goal_text))
+ msg_list[str(channel.id)] = msg.id
+ continue
+
+ if role is None or "missed" in self.event.lower():
+ msg = await channel.send(embed=goal_embed)
+ msg_list[str(channel.id)] = msg.id
+ else:
+ msg = await channel.send(role.mention, embed=goal_embed)
+ msg_list[str(channel.id)] = msg.id
+ except Exception as e:
+ print(_("Could not post goal in ") + str(channels) + str(e))
+ pass
+ return msg_list
+
+ @staticmethod
+ async def remove_goal_post(bot, goal, team, data):
+ """
+ Attempt to delete a goal if it was pulled back
+ """
+ config = hockey_config()
+ team_list = await config.teams()
+ team_data = await get_team(team)
+ if goal not in [goal.goal_id for goal in data.goals]:
+ try:
+ old_msgs = team_data["goal_id"][goal]["messages"].items()
+ except Exception as e:
+ print(e)
+ return
+ for channel_id, message_id in old_msgs:
+ channel = bot.get_channel(id=int(channel_id))
+ try:
+ message = await channel.get_message(message_id)
+ if message is not None:
+ await message.delete()
+ except Exception as e:
+ print(_("Cannot find message ") + team + " " + goal + " " + str(e))
+ pass
+ try:
+ team_list.remove(team_data)
+ del team_data["goal_id"][goal]
+ team_list.append(team_data)
+ await config.teams.set(team_list)
+ except Exception as e:
+ print(e)
+ return
+ return
+
+ async def edit_team_goal(self, bot, game_data, og_msg):
+ """
+ When a goal scorer has changed we want to edit the original post
+ """
+ # scorer = self.headshots.format(goal["players"][0]["player"]["id"])
+ post_state = ["all", game_data.home_team, game_data.away_team]
+ em = await self.goal_post_embed(game_data)
+ for channel_id, message_id in og_msg.items():
+ try:
+ role = None
+ channel = bot.get_channel(id=int(channel_id))
+ if channel is None:
+ continue
+ if not channel.permissions_for(channel.guild.me).embed_links:
+ continue
+ message = await channel.get_message(message_id)
+ guild = message.guild
+ game_day_channels = await self.config.guild(guild).gdc()
+ for roles in guild.roles:
+ if roles.name == self.team_name + " GOAL":
+ role = roles
+ if game_day_channels is not None:
+ # We don't want to ping people in the game day channels twice
+ if channel.id in game_day_channels:
+ role = None
+ if role is None or "missed" in self.event.lower():
+ await message.edit(embed=em)
+ else:
+ await message.edit(content=role.mention, embed=em)
+ except:
+ print(_("Could not edit goal in") + str(channel_id))
+ return
+
+ async def get_shootout_display(self, game_goals):
+ """
+ Gets a string for the shootout display
+ """
+ msg = ""
+ score = "☑\n"
+ miss = "❌\n"
+ for goal in game_goals:
+ if goal.event in ["Shot", "Missed Shot"] and goal.period_ord == "SO":
+ msg += miss
+ if goal.event in ["Goal"] and goal.period_ord == "SO":
+ msg += score
+ return msg
+
+ async def goal_post_embed(self, game):
+ """
+ Gets the embed for goal posts
+ """
+ h_emoji = game.home_emoji
+ a_emoji = game.away_emoji
+ shootout = False
+ if game.period_ord == "SO":
+ shootout = True
+ colour = int(TEAMS[self.team_name]["home"].replace("#", ""), 16) if self.team_name in TEAMS else None
+ title = "🚨 {} #{} {} {} 🚨".format(self.team_name, self.jersey_no, self.strength, self.event)
+ url = TEAMS[self.team_name]["team_url"] if self.team_name in TEAMS else "https://nhl.com"
+ logo = TEAMS[self.team_name]["logo"] if self.team_name in TEAMS else "https://nhl.com"
+ if not shootout:
+
+ em = discord.Embed(description=self.description)
+ if colour is not None:
+ em.colour = colour
+ em.set_author(name=title, url=url, icon_url=logo)
+ home_str = _("Goals: **") + str(self.home_score) + _("** \nShots: **") + str(game.home_shots) + "**"
+ away_str = _("Goals: **") + str(self.away_score) + _("** \nShots: **") + str(game.away_shots) + "**"
+ home_field = f"{game.home_emoji} {game.home_team} {game.home_emoji}"
+ away_field = f"{game.away_emoji} {game.away_team} {game.away_emoji}"
+ em.add_field(name=home_field, value=home_str, inline=True)
+ em.add_field(name=away_field, value=away_str, inline=True)
+ em.set_footer(text=str(self.time_remaining) + _(" left in the ") + str(self.period_ord) + _(" period"), icon_url=logo)
+ em.timestamp = self.time
+ else:
+ if "missed" in self.event.lower():
+ em = discord.Embed(description=self.description, colour=colour)
+ em.set_author(name=title.replace("🚨", ""), url=url, icon_url=logo)
+ else:
+ em = discord.Embed(description=self.description, colour=colour)
+ em.set_author(name=title, url=url, icon_url=logo)
+ home_msg = await self.get_shootout_display(game.home_goals)
+ away_msg = await self.get_shootout_display(game.away_goals)
+ em.add_field(name=game.home_team, value=home_msg)
+ em.add_field(name=game.away_team, value=away_msg)
+ em.set_footer(text=str(game.period_time_left) + _(" left in the ") + str(game.period_ord) + _(" period"), icon_url=logo)
+ em.timestamp = self.time
+ return em
+
+ async def goal_post_text(self, game):
+ """
+ Gets the text to send for goal posts
+ """
+ if game.period_ord != "SO":
+ text = (f"{game.home_emoji} {game.home_team}: {game.home_score}\n"
+ f"{game.away_emoji} {game.away_team}: {game.away_score}\n "
+ f"({self.time_remaining}" + _(" left in the ") + f"{game.period_ord}" + _(" period") + ")")
+ else:
+ home_msg = await self.get_shootout_display(game.home_goals)
+ away_msg = await self.get_shootout_display(game.away_goals)
+ text = (f"{game.home_emoji} {game.home_team}: {home_msg}\n"
+ f"{game.away_emoji} {game.away_team}: {away_msg}\n "
+ f"({self.time_remaining}" + _(" left in the ") + f"{game.period_ord}" + _(" period") + ")")
+ return text
diff --git a/hockey/helper.py b/hockey/helper.py
new file mode 100644
index 0000000..d495b61
--- /dev/null
+++ b/hockey/helper.py
@@ -0,0 +1,154 @@
+from redbot.core import commands
+import asyncio
+from datetime import datetime, timezone
+from redbot.core import Config
+from .constants import TEAMS, CONFIG_ID
+from .teamentry import TeamEntry
+from redbot.core.i18n import Translator
+import pytz
+
+_ = Translator("Hockey", __file__)
+
+def get_season():
+ now = datetime.now()
+ if (now.month, now.day) < (7, 1):
+ return (now.year - 1, now.year)
+ if (now.month, now.day) >= (7, 1):
+ return (now.year, now.year + 1)
+
+def hockey_config():
+ return Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+
+def utc_to_local(utc_dt, new_timezone='US/Eastern'):
+ eastern = pytz.timezone(new_timezone)
+ return utc_dt.replace(tzinfo=timezone.utc).astimezone(tz=eastern)
+
+async def pick_team(ctx, team_list):
+ """
+ helper to determine the team when two teams share a name when requested
+ TODO: impliment everywhere teams are a choice
+ """
+ msg = _("There's multiple teams with that name, pick one of these:\n")
+ if ctx.channel.permissions_for(ctx.guild.me).add_reactions:
+ new_msg = await ctx.send(msg)
+ team_emojis = [TEAMS[team]["emoji"] for team in team_list]
+ def reaction_check(r, u):
+ return u == ctx.message.author and str(r.emoji).replace("<:", "").replace(">", "") in team_emojis
+ for emoji in team_emojis:
+ await new_msg.add_reaction(emoji)
+ try:
+ reaction, user = await ctx.bot.wait_for("reaction_add", check=reaction_check, timeout=15)
+ except asyncio.TimeoutError:
+ await new_msg.edit(content=_("I guess not."))
+ return
+ else:
+ return team_list[team_emojis.index(str(reaction.emoji).replace("<:", "").replace(">", ""))]
+
+ else:
+ for i, team_name in enumerate(team_list):
+ msg += "{}: {}\n".format(i+1, team_name)
+ def msg_check(m):
+ return m.author == ctx.message.author
+
+ try:
+ msg = await ctx.bot.wait_for("message", check=msg_check, timeout=15)
+ except asyncio.TimeoutError:
+ await new_msg.edit(content=_("I guess not."))
+ return
+
+ if msg.content.isdigit():
+ msg = int(msg.content)-1
+ try:
+ return team_list[msg]
+ except (IndexError, ValueError, AttributeError):
+ pass
+ else:
+ return_team = None
+ for team in team_list:
+ if msg.content.lower() in team.lower():
+ return_team = team
+ return return_team
+
+async def check_to_post(channel, post_state):
+ config = Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+ channel_teams = await config.channel(channel).team()
+ should_post = False
+ for team in channel_teams:
+ if team in post_state:
+ should_post = True
+ return should_post
+
+async def get_team_role(guild, home_team, away_team):
+ home_role = None
+ away_role = None
+
+ for role in guild.roles:
+ if "Montréal Canadiens" in home_team and "Montreal Canadiens" in role.name:
+ home_role = role.mention
+ elif role.name == home_team:
+ home_role = role.mention
+ if "Montréal Canadiens" in away_team and "Montreal Canadiens" in role.name:
+ away_role = role.mention
+ elif role.name == away_team:
+ away_role = role.mention
+ if home_role is None:
+ home_role = home_team
+ if away_role is None:
+ away_role = away_team
+ return home_role, away_role
+
+async def get_team(team):
+ config = Config.get_conf(None, CONFIG_ID, cog_name="Hockey")
+ return_team = None
+ team_list = await config.teams()
+ for teams in team_list:
+ if team == teams["team_name"]:
+ return_team = team
+ return teams
+ if return_team is None:
+ # Add unknown teams to the config to track stats
+ return_team = TeamEntry("Null", team, 0, [], {}, [], "")
+ team_list.append(return_team.to_json())
+ await config.teams.set(team_list)
+ return await get_team(team)
+
+async def check_valid_team(team_name, standings=False):
+ """
+ Checks if this is a valid team name or all teams
+ useful for game day channel creation should impliment elsewhere
+ """
+ is_team = []
+ conference = ["eastern", "western", "conference"]
+ division = ["metropolitan", "atlantic", "pacific", "central", "division"]
+ if team_name.lower() == "all":
+ return ["all"]
+ if team_name in conference and standings:
+ return [team_name]
+ if team_name.lower() in division and standings:
+ return [team_name]
+ for team in TEAMS:
+ if team_name.lower() in team.lower():
+ is_team.append(team)
+ if is_team == []:
+ if team_name.lower() in ["montreal canadiens", "habs", "montreal"]:
+ is_team.append("Montréal Canadiens")
+ if team_name.lower() == "avs":
+ is_team.append("Colorado Avalanche")
+ if team_name.lower() == "preds":
+ is_team.append("Nashville Predators")
+ if team_name.lower() == "bolts":
+ is_team.append("Tampa Bay Lightning")
+ if team_name.lower() in ["jackets", "bjs"]:
+ is_team.append("Columbus Blue Jackets")
+ if team_name.lower() == "isles":
+ is_team.append("New York Islanders")
+ if team_name.lower() == "sens":
+ is_team.append("Ottawa Senators")
+ if team_name.lower() == "pens":
+ is_team.append("Pittsburgh Penguins")
+ if team_name.lower() == "caps":
+ is_team.append("Washington Capitals")
+ return is_team
+
+
+
diff --git a/hockey/hockey.py b/hockey/hockey.py
new file mode 100644
index 0000000..3858bb9
--- /dev/null
+++ b/hockey/hockey.py
@@ -0,0 +1,1288 @@
+import discord
+import aiohttp
+import asyncio
+import json
+import yaml
+from datetime import datetime
+from io import BytesIO
+from redbot.core import commands, checks, Config
+from redbot.core.data_manager import cog_data_path
+from redbot.core.i18n import Translator, cog_i18n
+from .teamentry import TeamEntry
+from .menu import hockey_menu
+from .embeds import *
+from .helper import *
+from .errors import *
+from .game import Game
+from .pickems import Pickems
+from .standings import Standings
+from .gamedaychannels import GameDayChannels
+from .constants import *
+try:
+ from .oilers import Oilers
+ LIGHTS_SET = True
+except:
+ LIGHTS_SET = False
+ pass
+
+_ = Translator("Hockey", __file__)
+
+__version__ = "2.3.0"
+__author__ = "TrustyJAID"
+
+
+@cog_i18n(_)
+class Hockey(getattr(commands, "Cog", object)):
+ """
+ Gather information and post goal updates for NHL hockey teams
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ default_global = {"teams":[], "created_gdc":False, "print":False}
+ for team in TEAMS:
+ team_entry = TeamEntry("Null", team, 0, [], {}, [], "")
+ default_global["teams"].append(team_entry.to_json())
+ default_global["teams"].append(team_entry.to_json())
+ default_guild = {"standings_channel":None,
+ "standings_type":None,
+ "post_standings":False,
+ "standings_msg":None,
+ "create_channels":False,
+ "category":None,
+ "gdc_team":None,
+ "gdc":[],
+ "delete_gdc":True,
+ "rules":"",
+ "team_rules":"",
+ "pickems": [],
+ "leaderboard":{}
+ }
+ default_channel = {"team":[], "to_delete":False}
+
+ self.config = Config.get_conf(self, CONFIG_ID)
+ self.config.register_global(**default_global, force_registration=True)
+ self.config.register_guild(**default_guild)
+ self.config.register_channel(**default_channel)
+ self.loop = bot.loop.create_task(self.game_check_loop())
+ self.TEST_LOOP = False # used to test a continuous loop of a single game data
+
+
+ ##############################################################################
+ # Here is all the logic for gathering game data and updating information
+
+ async def game_check_loop(self):
+ """
+ This loop grabs the current games for the day
+ then passes off to other functions as necessary
+ """
+ await self.bot.wait_until_ready()
+ while self is self.bot.get_cog("Hockey"):
+ # await self.refactor_data()
+ async with self.session.get(BASE_URL + "/api/v1/schedule") as resp:
+ data = await resp.json()
+ if data["dates"] != []:
+ games = [game["link"] for game in data["dates"][0]["games"] if game["status"]["abstractGameState"] != "Final"]
+ else:
+ games = []
+ # Only try to create game day channels if there's no games for the day
+ # Otherwise make the game day channels once we see
+ # the first preview message to delete old ones
+ await self.check_new_day()
+ games_playing = False
+ if self.TEST_LOOP:
+ games = [1]
+ while games != []:
+ to_remove = []
+ games_playing = True
+ for link in games:
+ if not self.TEST_LOOP:
+ try:
+ async with self.session.get(BASE_URL + link) as resp:
+ data = await resp.json()
+ except Exception as e:
+ print(_("Error grabbing game data: ")+ str(e))
+ continue
+ else:
+ games_playing = False
+ with open(str(__file__)[:-9] + "testgame.json", "r") as infile:
+ data = json.loads(infile.read())
+ game = await Game.from_json(data)
+ try:
+ await self.check_new_day()
+ await game.check_game_state(self.bot)
+ except Exception as e:
+ print("Error checking game state: " + str(e))
+
+ if await self.config.print():
+ print((f"{game.away_team} @ {game.home_team} "
+ f"{game.game_state} {game.away_score} - {game.home_score}"))
+
+ if game.game_state == "Final" and game.first_star is not None:
+ try:
+ await Pickems.set_guild_pickem_winner(self.bot, game)
+ except Exception as e:
+ print(_("Pickems Set Winner error: ") +str(e))
+ to_remove.append(link)
+
+ for link in to_remove:
+ games.remove(link)
+ await asyncio.sleep(60)
+ if await self.config.print():
+ print(_("Games Done Playing"))
+ try:
+ await Pickems.tally_leaderboard(self.bot)
+ except Exception as e:
+ print(_("Error tallying leaderboard:") + str(e))
+ pass
+ if games_playing:
+ await self.config.created_gdc.set(False)
+
+ # Final cleanup of config incase something went wrong
+ # Should be mostly unnecessary at this point
+ all_teams = await self.config.teams()
+ for team in await self.config.teams():
+ all_teams.remove(team)
+ team["goal_id"] = {}
+ team["game_state"] = "Null"
+ team["game_start"] = ""
+ team["period"] = 0
+ all_teams.append(team)
+
+ await self.config.teams.set(all_teams)
+ await asyncio.sleep(300)
+
+
+ async def check_new_day(self):
+ if not await self.config.created_gdc():
+ if datetime.now().weekday() == 6:
+ try:
+ await Pickems.reset_weekly(self.bot)
+ except Exception as e:
+ print(_("Error reseting the weekly leaderboard: ") + str(e))
+ try:
+ await Standings.post_automatic_standings(self.bot)
+ except Exception as e:
+ print(e)
+ if await self.config.print():
+ print(_("Checking GDC"))
+
+ await GameDayChannels.check_new_gdc(self.bot)
+ await self.config.created_gdc.set(True)
+
+ async def on_raw_reaction_add(self, payload):
+ channel = self.bot.get_channel(id=payload.channel_id)
+ try:
+ guild = channel.guild
+ except:
+ return
+ pickems_list = await self.config.guild(guild).pickems()
+
+ if pickems_list is None:
+ return
+ pickems = [Pickems.from_json(p) for p in pickems_list]
+ if len(pickems) == 0:
+ return
+ try:
+ msg = await channel.get_message(id=payload.message_id)
+ except:
+ return
+ user = guild.get_member(payload.user_id)
+ # print(payload.user_id)
+ if user.bot:
+ return
+ is_pickems_vote = False
+ for pickem in pickems:
+ if msg.id in pickem.message:
+ is_pickems_vote = True
+ reply_message = ""
+ try:
+ #print(payload.emoji)
+ pickem.add_vote(user.id, payload.emoji)
+ except UserHasVotedError as team:
+ if msg.channel.permissions_for(msg.guild.me).manage_messages:
+ emoji = pickem.home_emoji if str(payload.emoji.id) in pickem.away_emoji else pickem.away_emoji
+ await msg.remove_reaction(emoji, user)
+ reply_message = _("You have already voted! Changing vote to) ") + str(team)
+ except VotingHasEndedError as error_msg:
+ if msg.channel.permissions_for(msg.guild.me).manage_messages:
+ await msg.remove_reaction(payload.emoji, user)
+ reply_message = _("Voting has ended!") + str(error_msg)
+ except NotAValidTeamError:
+ if msg.channel.permissions_for(msg.guild.me).manage_messages:
+ await msg.remove_reaction(payload.emoji, user)
+ reply_message = _("Don't clutter the voting message with emojis!")
+ if reply_message != "":
+ try:
+ await user.send(reply_message)
+ except:
+ pass
+ if is_pickems_vote:
+ pickems_list = [p.to_json() for p in pickems]
+ await self.config.guild(guild).pickems.set(pickems_list)
+
+ async def change_custom_emojis(self, attachments):
+ """
+ This overwrites the emojis in constants.py
+ with values in a properly formatted .yaml file
+ """
+ try:
+ async with self.session.get(attachments[0].url) as infile:
+ data = yaml.load(await infile.read())
+ except yaml.error.YAMLError as exc:
+ raise InvalidFileError("Error Parsing the YAML") from exc
+ new_dict = {}
+ for team in TEAMS:
+ TEAMS[team]["emoji"] = data[team][0] if data[team][0] is not None else data["Other"][0]
+ team_data = json.dumps(TEAMS, indent=4, sort_keys=True, separators=(',',' : '))
+ constants_string = (f"BASE_URL = \"{BASE_URL}\"\n"
+ f"HEADSHOT_URL = \"{HEADSHOT_URL}\"\n"
+ f"CONFIG_ID = {CONFIG_ID}\n"
+ f"TEAMS = {team_data}")
+ with open(__file__[:-9] + "constants.py", "w") as outfile:
+ outfile.write(constants_string)
+
+ async def wait_for_file(self, ctx):
+ """
+ Waits for the author to upload a file
+ """
+ msg = None
+ while msg is None:
+ check = lambda m: m.author == ctx.message.author and m.attachments != []
+ try:
+ msg = await self.bot.wait_for("message", check=check, timeout=60)
+ except asyncio.TimeoutError:
+ await ctx.send(_("Emoji changing cancelled"))
+ break
+ if msg.content.lower().strip() == "exit":
+ await ctx.send(_("Emoji changing cancelled"))
+ break
+ return msg
+
+
+
+ ##############################################################################
+ # Here are all the bot commands
+
+
+ @commands.group(name="hockey", aliases=["nhl"])
+ async def hockey_commands(self, ctx):
+ """
+ Get information from NHL.com
+ """
+ pass
+
+ @commands.group(name="hockeyset", aliases=["nhlset"])
+ @commands.guild_only()
+ async def hockeyset_commands(self, ctx):
+ """
+ Setup commands for the server
+ """
+ if ctx.invoked_subcommand is None:
+ guild = ctx.message.guild
+ standings_channel = guild.get_channel(await self.config.guild(guild).standings_channel())
+ post_standings = _("On") if await self.config.guild(guild).post_standings() else _("Off")
+ gdc_channels = await self.config.guild(guild).gdc()
+ if standings_channel is not None:
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ standings_chn = standings_channel.mention
+ else:
+ standings_chn = standings_channel.name
+ try:
+ standings_msg = await standings_channel.get_message(await self.config.guild(guild).standings_msg())
+ except discord.errors.NotFound:
+ standings_msg = None
+ pass
+ if standings_msg is not None:
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ standings_msg = _("[Standings") + f" {post_standings}]({standings_msg.jump_url})"
+ else:
+ standings_msg = _("Standings") + f" {post_standings}```{standings_msg.jump_url}"
+ else:
+ standings_chn = "None"
+ standings_msg = "None"
+ channels = ""
+ for channel in await self.config.all_channels():
+ chn = guild.get_channel(channel)
+ if chn is not None:
+ teams = ", ".join(t for t in await self.config.channel(chn).team())
+ is_gdc = "(GDC)" if chn.id in gdc_channels else ""
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ channels += f"{chn.mention}{is_gdc}: {teams}\n"
+ else:
+ channels += f"#{chn.name}{is_gdc}: {teams}\n"
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ em = discord.Embed(title=guild.name + _(" Hockey Settings"))
+ em.colour = await self.bot.db.color()
+ em.description = channels
+ em.add_field(name=_("Standings Settings"), value=f"{standings_chn}: {standings_msg}")
+ await ctx.send(embed=em)
+ else:
+ msg = (f"```\n{guild.name} " + _("Hockey Settings\n") +
+ f"{channels}\n"+_("Standings Settings")+"\n#{standings_chn}: {standings_msg}")
+ if standings_msg is not None:
+ await ctx.send(msg)
+ else:
+ await ctx.send(msg + "```")
+
+ @commands.group()
+ @checks.admin_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def gdc(self, ctx):
+ """
+ Game Day Channel setup for the server
+
+ You can setup only a single team or all teams for the server
+ Game day channels are deleted and created on the day after the game is played
+ usually around 9AM PST
+ """
+ if ctx.invoked_subcommand is None:
+ guild = ctx.message.guild
+ create_channels = await self.config.guild(guild).create_channels()
+ if create_channels is None:
+ return
+ team = await self.config.guild(guild).gdc_team()
+ if team is None:
+ team = "None"
+ channels = await self.config.guild(guild).gdc()
+ category = self.bot.get_channel(await self.config.guild(guild).category())
+ delete_gdc = await self.config.guild(guild).delete_gdc()
+ if category is not None:
+ category = category.name
+ if channels is not None:
+ created_channels = ""
+ for channel in channels:
+ chn = self.bot.get_channel(channel)
+ if chn is not None:
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ created_channels += chn.mention
+ else:
+ created_channels += ("#" + chn.name)
+ else:
+ created_channels += "<#{}>\n".format(channel)
+ if len(channels) == 0:
+ created_channels = "None"
+ else:
+ created_channels = "None"
+ if not ctx.channel.permissions_for(guild.me).embed_links:
+ msg = (_("```GDC settings for") + guild.name + "\n"+
+ _("Create Game Day Channels:") + create_channels + "\n"+
+ _("Delete Game Day Channels: ") + delete_gdc + "\n"+
+ _("Team:") + team + "\n" + _("Current Channels:") +created_channels + "```")
+ await ctx.send(msg)
+ if ctx.channel.permissions_for(guild.me).embed_links:
+ em = discord.Embed(title=_("GDC settings for ") + guild.name)
+ em.colour = await self.bot.db.color()
+ em.add_field(name=_("Create Game Day Channels"), value=str(create_channels))
+ em.add_field(name=_("Delete Game Day Channels"), value=str(delete_gdc))
+ em.add_field(name=_("Team"), value=str(team))
+ em.add_field(name=_("Current Channels"), value=created_channels)
+ await ctx.send(embed=em)
+
+ #######################################################################
+ # All Game Day Channel Commands
+
+ @gdc.command(name="delete")
+ async def gdc_delete(self, ctx):
+ """
+ Delete all current game day channels for the server
+ """
+ if await self.config.guild(ctx.guild).create_channels():
+ await GameDayChannels.delete_gdc(self.bot, ctx.guild)
+ await ctx.send(_("Game day channels deleted."))
+
+ @gdc.command(name="create")
+ async def gdc_create(self, ctx):
+ """
+ Creates the next gdc for the server
+ """
+
+ if await self.config.guild(ctx.guild).create_channels():
+ await GameDayChannels.create_gdc(self.bot, ctx.guild)
+ await ctx.send(_("Game day channels created."))
+
+ @gdc.command(name="toggle")
+ async def gdc_toggle(self, ctx):
+ """
+ Toggles the game day channel creation on this server
+ """
+ guild = ctx.message.guild
+ cur_setting = not await self.config.guild(guild).create_channels()
+ verb = _("will") if cur_setting else _("won't")
+ msg = _("Game day channels ") + verb + _(" be created on this server.")
+ await self.config.guild(guild).create_channels.set(cur_setting)
+ await ctx.send(msg)
+
+ @gdc.command(name="category")
+ async def gdc_category(self, ctx, category:discord.CategoryChannel):
+ """
+ Change the category for channel creation. Channel is case sensitive.
+ """
+ guild = ctx.message.guild
+
+ cur_setting = await self.config.guild(guild).category()
+
+ msg = _("Game day channels will be created in ")
+ await self.config.guild(guild).category.set(category.id)
+ await ctx.send(msg + category.name)
+
+ @gdc.command(name="autodelete")
+ async def gdc_autodelete(self, ctx):
+ """
+ Toggle's auto deletion of game day channels.
+ """
+ guild = ctx.message.guild
+
+ cur_setting = await self.config.guild(guild).delete_gdc()
+ verb = _("won't") if cur_setting else _("will")
+ msg = (_("Game day channels ") + verb + _(" be deleted on this server.\n") +
+ _("Note, this may not happen until the next set of games."))
+ await self.config.guild(guild).delete_gdc.set(not cur_setting)
+ await ctx.send(msg)
+
+ @gdc.command(name="setup")
+ async def gdc_setup(self, ctx, team, category:discord.CategoryChannel=None, delete_gdc:bool=True):
+ """
+ Setup game day channels for a single team or all teams
+
+ Required parameters:
+ `team` must use quotes if a space is in the name will search for partial team name
+ Optional Parameters:
+ `category` must use quotes if a space is in the name will default to current category
+ `delete_gdc` will tell the bot whether or not to delete game day channels automatically
+ must be either `True` or `False` and a category must be provided
+ """
+ guild = ctx.message.guild
+ if guild is None:
+ await ctx.send("This needs to be done in a server.")
+ return
+ if category is None:
+ category = guild.get_channel(ctx.message.channel.category_id)
+ if not category.permissions_for(guild.me).manage_channels:
+ await ctx.send(_("I don't have manage channels permission!"))
+ return
+ team_list = await check_valid_team(team)
+ if team_list == [] and team.lower() != "all":
+ await ctx.send(team + _(" is not a valid team!"))
+ return
+ if len(team_list) > 1:
+ team = await pick_team(ctx, team_list)
+ else:
+ team = team_list[0]
+
+ await self.config.guild(guild).category.set(category.id)
+ await self.config.guild(guild).gdc_team.set(team)
+ await self.config.guild(guild).delete_gdc.set(delete_gdc)
+ if team.lower() != "all":
+ await GameDayChannels.create_gdc(self.bot, guild)
+ else:
+ game_list = await Game.get_games()
+ for game in game_list:
+ await GameDayChannels.create_gdc(self.bot, guild, game)
+ await ctx.send(_("Game Day Channels for ") + team + _("setup in ") + category.name)
+
+ #######################################################################
+ # All Hockey setup commands
+
+ @hockeyset_commands.command()
+ @checks.admin_or_permissions(manage_messages=True)
+ async def reset(self, ctx):
+ """
+ Restarts the hockey loop incase there are issues with the posts
+ """
+ msg = await ctx.send(_("Restarting..."))
+ self.loop.cancel()
+ await msg.edit(content=msg.content + _("loop closed..."))
+ self.loop = self.bot.loop.create_task(self.game_check_loop())
+ await msg.edit(content=msg.content + _("restarted"))
+ # await ctx.send("Done.")
+
+ @hockeyset_commands.command(hidden=True)
+ @checks.admin_or_permissions(manage_messages=True)
+ async def leaderboardset(self, ctx, user:discord.Member, season:int, weekly:int=None, total:int=None):
+ """
+ Allows moderators to set a users points on the leaderboard
+ """
+ if weekly is None:
+ weekly = season
+ if total is None:
+ total = season
+ leaderboard = await self.config.guild(ctx.guild).leaderboard()
+ if leaderboard == {} or leaderboard is None:
+ await ctx.send(_("There is no current leaderboard for this server!"))
+ return
+ if str(user.id) not in leaderboard:
+ leaderboard[str(user.id)] = {"season":season, "weekly":weekly, "total":total}
+ else:
+ del leaderboard[str(user.id)]
+ leaderboard[str(user.id)] = {"season":season, "weekly":weekly, "total":total}
+ await self.config.guild(ctx.guild).leaderboard.set(leaderboard)
+ msg = (user.display_name + _(" now has ") + season +
+ _(" points on the season, ") + weekly + _(" points for the week,") +
+ _(" and ") + total + _(" votes overall."))
+ await ctx.send(msg)
+
+ @hockeyset_commands.command(name="poststandings", aliases=["poststanding"])
+ async def post_standings(self, ctx, standings_type:str, channel:discord.TextChannel=None):
+ """
+ Posts automatic standings when all games for the day are done
+
+ `standings_type` can be a division, conference, team, or all
+ `channel` will default to the current channel or be specified
+ """
+ guild = ctx.message.guild
+ if channel is None:
+ channel = ctx.message.channel
+ standings_list = ["metropolitan", "atlantic", "pacific", "central", "eastern", "western", "all"]
+ division = ["metropolitan", "atlantic", "pacific", "central"]
+
+ if standings_type.lower() not in standings_list:
+ await ctx.send(_("You must choose from ")+"{}".format(", ".join(s for s in standings_list)))
+ return
+
+ standings, page = await Standings.get_team_standings(standings_type.lower())
+ if standings_type.lower() != "all":
+ em = await Standings.build_standing_embed(standings, page)
+ else:
+ em = await Standings.all_standing_embed(standings, page)
+ await self.config.guild(guild).standings_type.set(standings_type)
+ await self.config.guild(guild).standings_channel.set(channel.id)
+ await ctx.send(_("Sending standings to") + channel.mention)
+ message = await channel.send(embed=em)
+ await self.config.guild(guild).standings_msg.set(message.id)
+ await ctx.send(standings_type + _(" standings will now be automatically updated in ") + channel.mention)
+ await self.config.guild(guild).post_standings.set(True)
+
+
+ @hockeyset_commands.command()
+ async def togglestandings(self, ctx):
+ """
+ Toggles automatic standings updates
+
+ This updates at the same time as the game day channels (usually 9AM PST)
+ """
+ guild = ctx.message.guild
+ cur_state = not await self.config.guild(guild).post_standings()
+ verb = _("will") if cur_state else _("won't")
+ msg = _("Okay, standings ") + verb + _("be updated automatically.")
+ await self.config.guild(guild).post_standings.set(cur_state)
+ await ctx.send(msg)
+
+ @hockeyset_commands.command(name="add", aliases=["add_goals"])
+ @checks.admin_or_permissions(manage_channels=True)
+ async def add_goals(self, ctx, team, channel:discord.TextChannel=None):
+ """
+ Adds a hockey team goal updates to a channel do 'all' for all teams
+
+ `team` needs to be all or part of an NHL team if more than one team
+ match it will ask for the correct team.
+ `channel` defaults to the current channel
+ """
+ guild = ctx.message.guild
+ team_name = await check_valid_team(team)
+ if team_name == []:
+ await ctx.send(team + _(" is not an available team!"))
+ return
+ if len(team_name) > 1:
+ team_name = await pick_team(ctx, team_name)
+ else:
+ team_name = team_name[0]
+ # team_data = await self.get_team(team)
+ if channel is None:
+ channel = ctx.message.channel
+ if not channel.permissions_for(guild.me).embed_links:
+ await ctx.send(_("I don't have embed links permission!"))
+ return
+ cur_teams = await self.config.channel(channel).team()
+ cur_teams = [] if cur_teams is None else cur_teams
+ if team_name in cur_teams:
+ await self.config.channel(channel).team.set([team_name])
+ else:
+ cur_teams.append(team_name)
+ await self.config.channel(channel).team.set(cur_teams)
+ await ctx.send(team_name + _(" goals will be posted in ") + channel.mention)
+
+
+ @hockeyset_commands.command(name="del", aliases=["remove", "rem"])
+ @checks.admin_or_permissions(manage_channels=True)
+ async def remove_goals(self, ctx, team=None, channel:discord.TextChannel=None):
+ """
+ Removes a teams goal updates from a channel
+ defaults to the current channel
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ cur_teams = await self.config.channel(channel).team()
+ if cur_teams is None:
+ await ctx.send(_("no teams are currently being posted in ") + channel.mention)
+ return
+ if team is None:
+ await self.config.channel(channel).clear()
+ await ctx.send(_("All goal updates will not be posted in ") + channel.mention)
+ return
+ if team is not None:
+ guild = ctx.message.guild
+ team_name = await check_valid_team(team)
+ if team_name == []:
+ await ctx.send(team + _(" is not an available team!"))
+ return
+ if len(team_name) > 1:
+ team_name = await pick_team(ctx, team_name)
+ else:
+ team_name = team_name[0]
+ if team_name in cur_teams:
+ cur_teams.remove(team_name)
+ if cur_teams == []:
+ await self.config.channel(channel).clear()
+ await ctx.send(_("All goal updates will not be posted in ") + channel.mention)
+ else:
+ await self.config.channel(channel).team.set(cur_teams)
+ await ctx.send(team_name + _(" goal updates removed from ") + channel.mention)
+
+ #######################################################################
+ # All Basic Hockey Commands
+
+ @hockey_commands.command()
+ async def version(self, ctx):
+ """
+ Display the current version
+ """
+ await ctx.send(_("Hockey version ") + __version__)
+
+ @hockey_commands.command(pass_context=True, name="role")
+ async def team_role(self, ctx, *, team):
+ """Set your role to a team role"""
+ guild = ctx.message.guild
+ if not guild.me.guild_permissions.manage_roles:
+ return
+ team_search = await check_valid_team(team)
+ if team_search == []:
+ await ctx.message.channel.send(team + _(" Does not appear to be an NHL team!"))
+ return
+ if len(team_search) > 1:
+ team = await pick_team(ctx, team_search)
+ else:
+ team = team_search[0]
+ try:
+ role = [role for role in guild.roles if (team.lower() in role.name.lower() and "GOAL" not in role.name)]
+ await ctx.message.author.add_roles(role[0])
+ await ctx.message.channel.send(role[0].name + _("role applied."))
+ except Exception as e:
+ print(e)
+ await ctx.message.channel.send(team + _(" is not an available role!"))
+
+ @hockey_commands.command(name="goals")
+ async def team_goals(self, ctx, *, team=None):
+ """Subscribe to goal notifications"""
+ guild = ctx.message.guild
+ member = ctx.message.author
+ if not guild.me.guild_permissions.manage_roles:
+ return
+ if team is None:
+ team_roles = []
+ for role in guild.roles:
+ if role.name in [r.name + " GOAL" for r in member.roles]:
+ team_roles.append(role)
+ if team_roles != []:
+ for role in team_roles:
+ await ctx.message.author.add_roles(role)
+ role_list = ", ".join(r.name for r in team_roles)
+ await ctx.message.channel.send(f"{role_list} role applied.")
+ return
+ else:
+ return
+ else:
+ team_search = await check_valid_team(team)
+ if team_search == []:
+ await ctx.message.channel.send(team + _(" Does not appear to be an NHL team!"))
+ return
+ if len(team_search) > 1:
+ team = await pick_team(ctx, team_search)
+ else:
+ team = team_search[0]
+ try:
+ role = [role for role in guild.roles if (team.lower() in role.name.lower() and role.name.endswith("GOAL"))]
+ await ctx.message.author.add_roles(role[0])
+ await ctx.message.channel.send(role[0].name+ _(" role applied."))
+ except Exception as e:
+ print(e)
+ await ctx.message.channel.send(team + _(" is not an available role!"))
+
+ @hockey_commands.command()
+ async def standings(self, ctx, *, search=None):
+ """
+ Displays current standings
+
+ If a search is provided you can see a teams complete stats
+ by searching for team or get all standings at once
+ separated by division
+ """
+ if search is None:
+ standings, page = await Standings.get_team_standings("division")
+ await hockey_menu(ctx, "standings", standings)
+ return
+ search_r = await check_valid_team(search, True)
+ if search_r == []:
+ await ctx.message.channel.send(search + _(" Does not appear to be a valid standing type!"))
+ return
+ if len(search_r) > 1:
+ search_r = await pick_team(ctx, search)
+ else:
+ search_r = search_r[0]
+
+ standings, page = await Standings.get_team_standings(search_r.lower())
+ if search != "all":
+ await hockey_menu(ctx, "standings", standings, None, page)
+ else:
+ await hockey_menu(ctx, "all", standings, None, page)
+
+
+ @hockey_commands.command(aliases=["score"])
+ async def games(self, ctx, *, team=None):
+ """
+ Gets all NHL games for the current season
+
+ If team is provided it will grab that teams schedule
+ """
+ games_list = []
+ page_num = 0
+ today = datetime.now()
+ start_date = datetime.strptime(f"{get_season()[0]}-9-1", "%Y-%m-%d")
+
+ if team is not None:
+ team_search = await check_valid_team(team)
+ if team_search == []:
+ await ctx.message.channel.send(team + _(" Does not appear to be an NHL team!"))
+ return
+ if len(team_search) > 1:
+ team = await pick_team(ctx, team_search)
+ else:
+ team = team_search[0]
+ games_list = await Game.get_games_list(team, start_date)
+ for game in games_list:
+ game_time = datetime.strptime(game["gameDate"], "%Y-%m-%dT%H:%M:%SZ")
+ if game_time >= today:
+ page_num = games_list.index(game)
+ break
+ if games_list != []:
+ await hockey_menu(ctx, "game", games_list, None, page_num)
+ else:
+ await ctx.message.channel.send(team + _(" have no recent or upcoming games!"))
+
+ @hockey_commands.command(aliases=["player"])
+ async def players(self, ctx, *, search):
+ """
+ Search for a player or get a team roster
+ """
+ rosters = {}
+ players = []
+ teams = [team for team in TEAMS if search.lower() in team.lower()]
+ if teams != []:
+ for team in teams:
+ url = f"{BASE_URL}/api/v1/teams/{TEAMS[team]['id']}/roster"
+ async with self.session.get(url) as resp:
+ data = await resp.json()
+ for player in data["roster"]:
+ players.append(player)
+ else:
+ for team in TEAMS:
+ url = f"{BASE_URL}/api/v1/teams/{TEAMS[team]['id']}/roster"
+ async with self.session.get(url) as resp:
+ data = await resp.json()
+ try:
+ rosters[team] = data["roster"]
+ except KeyError:
+ pass
+
+ for team in rosters:
+ for player in rosters[team]:
+ if search.lower() in player["person"]["fullName"].lower():
+ players.append(player)
+
+ if players != []:
+ await hockey_menu(ctx, "roster", players)
+ else:
+ await ctx.send(search + _(" is not an NHL team or Player!"))
+
+ @hockey_commands.command(hidden=True)
+ @checks.mod_or_permissions(manage_messages=True)
+ async def rules(self, ctx):
+ """
+ Display a nice embed of server specific rules
+ """
+ if not ctx.channel.permissions_for(ctx.guild.me).embed_links:
+ return
+ rules = await self.config.guild(ctx.guild).rules()
+ team = await self.config.guild(ctx.guild).team_rules()
+ if rules == "":
+ return
+ em = await make_rules_embed(ctx.guild, team, rules)
+ if ctx.channel.permissions_for(ctx.guild.me).manage_messages:
+ await ctx.message.delete()
+ await ctx.send(embed=em)
+
+
+ @hockey_commands.command(hidden=True)
+ @checks.admin_or_permissions(manage_messages=True)
+ async def pickems_page(self, ctx, date:str=None):
+ """
+ Generates a pickems page for voting on a specified day must be "DD-MM-YYYY"
+ """
+ if date is None:
+ date = datetime.now()
+ else:
+ date = datetime.strptime(date, "%d-%m-%Y")
+ msg = _("**Welcome to our daily Pick'ems challenge! Below you will see today's games!"
+ " Vote for who you think will win! You get one point for each correct prediction."
+ " We will be tracking points over the course of the season and will be rewarding weekly,"
+ " worst and full-season winners!**\n\n"
+ "- Click the reaction for the team you think will win the day's match-up.\n"
+ "- Anyone who votes for both teams will have their vote removed and will receive no points!\n\n\n\n")
+ games_list = await Game.get_games(None, date, date)
+ await ctx.send(msg)
+ for game in games_list:
+ new_msg = await ctx.send("__**{} {}**__ @ __**{} {}**__".format(game.away_emoji, game.away_team,
+ game.home_emoji, game.home_team))
+ # Create new pickems object for the game
+ await Pickems.create_pickem_object(ctx.guild, new_msg, ctx.channel, game)
+ if ctx.channel.permissions_for(ctx.guild.me).add_reactions:
+ try:
+ await new_msg.add_reaction(game.away_emoji[2:-1])
+ await new_msg.add_reaction(game.home_emoji[2:-1])
+ except Exception as e:
+ print(e)
+
+ async def post_leaderboard(self, ctx, leaderboard_type):
+ """
+ Posts the leaderboard based on specific style
+ """
+ leaderboard = await self.config.guild(ctx.guild).leaderboard()
+ if leaderboard == {} or leaderboard is None:
+ await ctx.send(_("There is no current leaderboard for this server!"))
+ return
+ if leaderboard_type != "worst":
+ leaderboard = sorted(leaderboard.items(), key=lambda i: i[1][leaderboard_type], reverse=True)
+ else:
+ leaderboard = sorted(leaderboard.items(), key=lambda i: i[1]["total"]-i[1]["season"], reverse=True)
+ msg_list = []
+ count = 1
+ user_position = None
+ for member_id in leaderboard:
+ if str(member_id[0]) == str(ctx.author.id):
+ user_position = leaderboard.index(member_id)
+ member = ctx.guild.get_member(int(member_id[0]))
+ if member is None:
+ member_mention = _("User has left the server ") + member_id[0]
+ else:
+ member_mention = member.mention
+ if leaderboard_type == "weekly":
+ points = member_id[1]["weekly"]
+ msg_list.append("#{}. {}: {}\n".format(count, member_mention, points))
+ elif leaderboard_type == "season":
+ total = member_id[1]["total"]
+ wins = member_id[1]["season"]
+ percent = (wins/total)*100
+ msg_list.append(f"#{count}. {member_mention}: {wins}/{total} correct ({percent:.4}%)\n")
+ else:
+ total = member_id[1]["total"]
+ losses = member_id[1]["total"] - member_id[1]["season"]
+ percent = (losses/total)*100
+ msg_list.append(f"#{count}. {member_mention}: {losses}/{total} incorrect ({percent:.4}%)\n")
+ count += 1
+ leaderboard_list = [msg_list[i:i + 10] for i in range(0, len(msg_list), 10)]
+ if user_position is not None:
+ user = leaderboard[user_position][1]
+ wins = user["season"]
+ total = user["total"]
+ losses = user["total"] - user["season"]
+ position = (ctx.author.display_name + _(", you're #") + str(user_position+1) +
+ " on the " + leaderboard_type + _(" leaderboard!"))
+ if leaderboard_type == "season":
+ percent = (wins/total)*100
+ position += _(" You have ")+f"{wins}/{total} "+_("correct ")+f"({percent:.4}%)."
+ elif leaderboard_type == "worst":
+ percent = (losses/total)*100
+ position += _(" You have ")+f"{wins}/{total} "+_("correct ")+f"({percent:.4}%)."
+ await ctx.send(position)
+ await hockey_menu(ctx, leaderboard_type, leaderboard_list)
+
+ @hockey_commands.command()
+ @commands.guild_only()
+ async def leaderboard(self, ctx, leaderboard_type:str="seasonal"):
+ """
+ Shows the current server leaderboard either seasonal or weekly
+ """
+ if leaderboard_type in ["seasonal", "season"]:
+ await self.post_leaderboard(ctx, "season")
+ if leaderboard_type in ["weekly", "week"]:
+ await self.post_leaderboard(ctx, "weekly")
+ if leaderboard_type in ["worst"]:
+ await self.post_leaderboard(ctx, "worst")
+
+ @hockey_commands.command(hidden=True)
+ @checks.mod_or_permissions(manage_messages=True)
+ async def setrules(self, ctx, team, *, rules):
+ """Set the main rules page for the nhl rules command"""
+ if not ctx.channel.permissions_for(ctx.guild.me).embed_links:
+ await ctx.send(_("I don't have embed links permission!"))
+ return
+ team_search = await check_valid_team(team)
+ if team_search == []:
+ await ctx.message.channel.send(team + _(" Does not appear to be an NHL team!"))
+ return
+ if len(team_search) > 1:
+ team = await pick_team(ctx, team_search)
+ else:
+ team = team_search[0]
+ await self.config.guild(ctx.guild).rules.set(rules)
+ await self.config.guild(ctx.guild).team_rules.set(team)
+ em = await make_rules_embed(ctx.guild, team, rules)
+ await ctx.send(_("Done, here's how it will look."), embed=em)
+
+ @hockey_commands.command(aliases=["link", "invite"])
+ async def otherdiscords(self, ctx, team):
+ """
+ Get team specific discord links
+
+ choosing all will create a nicely formatted list of
+ all current NHL team discord server links
+ """
+ if team not in ["all", "page"]:
+ team_search = await check_valid_team(team)
+ if team_search == []:
+ await ctx.message.channel.send(team + _(" Does not appear to be an NHL team!"))
+ return
+ if len(team_search) > 1:
+ team = await pick_team(ctx, team_search)
+ else:
+ team = team_search[0]
+ await ctx.send(TEAMS[team]["invite"])
+ else:
+ if not ctx.channel.permissions_for(ctx.message.author).manage_messages:
+ # Don't need everyone spamming this command
+ return
+ atlantic = [team for team in TEAMS if TEAMS[team]["division"] == "Atlantic"]
+ metropolitan = [team for team in TEAMS if TEAMS[team]["division"] == "Metropolitan"]
+ central = [team for team in TEAMS if TEAMS[team]["division"] == "Central"]
+ pacific = [team for team in TEAMS if TEAMS[team]["division"] == "Pacific"]
+ team_list = {"Atlantic":atlantic, "Metropolitan":metropolitan, "Central":central, "Pacific":pacific}
+ msg1 = _("__**Hockey Discord Master List**__\n```fix\n"
+ "- Do not join other discords to troll.\n- "
+ "Respect their rules & their members (Yes even the leafs & habs unfortunately).\n- "
+ "We don't control the servers below. If you get banned we can not get you unbanned.\n- "
+ "Don't be an asshole because then we all look like assholes. They won't see it as one asshole "
+ "fan they will see it as a toxic fanbase.\n- Salt levels may vary. Your team is the best "
+ "here but don't go on another discord and preach it to an angry mob after we just won.\n- "
+ "Not following the above rules will result in appropriate punishments ranging from a warning"
+ "to a ban. ```\n\nhttps://discord.gg/reddithockey")
+ eastern_conference = "https://i.imgur.com/CtXvcCs.png"
+ western_conference = "https://i.imgur.com/UFYJTDF.png"
+ async with self.session.get(eastern_conference) as resp:
+ data = await resp.read()
+ logo = BytesIO()
+ logo.write(data)
+ logo.seek(0)
+ image = discord.File(logo, filename="eastern_logo.png")
+ await ctx.send(msg1, file=image)
+ for division in team_list:
+ if division == "Central":
+ async with self.session.get(western_conference) as resp:
+ data = await resp.read()
+ logo = BytesIO()
+ logo.write(data)
+ logo.seek(0)
+ image = discord.File(logo, filename="western_logo.png")
+ await ctx.send(file=image)
+ div_emoji = "<:" + TEAMS["Team {}".format(division)]["emoji"] + ">"
+ msg = "{0} __**{1} DIVISION**__ {0}".format(div_emoji, division.upper())
+ await ctx.send(msg)
+ for team in team_list[division]:
+ team_emoji = "<:" + TEAMS[team]["emoji"] + ">"
+ team_link = TEAMS[team]["invite"]
+ msg = "{0} {1} {0}".format(team_emoji, team_link)
+ await ctx.send(msg)
+
+ @hockey_commands.command()
+ @checks.is_owner()
+ async def getgoals(self, ctx):
+ """
+ Testing function with testgame.json
+ """
+ to_remove = []
+ games_playing = True
+ # print(link)
+ with open("/mnt/e/github/Trusty-cogs/hockey/testgame.json", "r") as infile:
+ data = json.loads(infile.read())
+ # print(data)
+ game = await Game.from_json(data)
+ await game.check_game_state(self.bot)
+ if (game.home_score + game.away_score) != 0:
+ await game.check_team_goals(self.bot)
+ all_teams = await self.config.teams()
+ for team in await self.config.teams():
+ if team["team_name"] in [game.home_team, game.away_team]:
+ all_teams.remove(team)
+ team["goal_id"] = {}
+ team["game_state"] = "Null"
+ team["game_start"] = ""
+ team["period"] = 0
+ all_teams.append(team)
+
+ await self.config.teams.set(all_teams)
+ await ctx.send("Done testing.")
+
+ @hockeyset_commands.command(hidden=True)
+ @checks.is_owner()
+ async def pickems_tally(self, ctx):
+ """
+ Manually tally the leaderboard
+ """
+ await Pickems.tally_leaderboard(self.bot)
+ await ctx.send(_("Leaderboard tallying complete."))
+
+
+ @gdc.command(hidden=True, name="test")
+ @checks.is_owner()
+ async def test_gdc(self, ctx):
+ """
+ Test checking for new game day channels
+ """
+ await GameDayChannels.check_new_gdc(self.bot)
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def teststandings(self, ctx):
+ """
+ Test the automatic standings function/manually update standings
+ """
+ try:
+ await Standings.post_automatic_standings(self.bot)
+ except Exception as e:
+ print(e)
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def cogstats(self, ctx):
+ """
+ Display current number of servers and channels
+ the cog is storing in console
+ """
+ all_channels = await self.config.all_channels()
+ all_guilds = await self.config.all_guilds()
+ guild_list = {}
+ for channels in all_channels.keys():
+ channel = self.bot.get_channel(channels)
+ if channel is None:
+ print(channels)
+ continue
+ if channel.guild.name not in guild_list:
+ guild_list[channel.guild.name] = 1
+ else:
+ guild_list[channel.guild.name] += 1
+ msg = "Servers:{}\nNumber of Channels: {}\nNumber of Servers: {}".format(
+ guild_list, len(all_channels), len(all_guilds))
+ print(msg)
+
+
+ #######################################################################
+ # Owner Only Commands Mostly for Testing
+
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def customemoji(self, ctx):
+ """
+ Set custom emojis for the bot to use
+
+ Requires you to upload a .yaml file with
+ emojis that the bot can see
+ an example may be found [here](https://github.com/TrustyJAID/Trusty-cogs/blob/V3/hockey/emoji.yaml)
+ if no emoji is provided for a team the Other
+ slot will be filled instead
+ It's recommended to have an emoji for every team
+ to utilize all features of the cog such as pickems
+ """
+ attachments = ctx.message.attachments
+ if attachments == []:
+ await ctx.send(_("Upload the .yaml file to use. Type `exit` to cancel."))
+ msg = await self.wait_for_file(ctx)
+ if msg is None:
+ return
+ try:
+ await self.change_custom_emojis(msg.attachments)
+ except InvalidFileError:
+ await ctx.send(_("That file doesn't seem to be formatted correctly."))
+ return
+ else:
+ try:
+ await self.change_custom_emojis(attachments)
+ except InvalidFileError:
+ await ctx.send(_("That file doesn't seem to be formatted correctly."))
+ return
+ new_msg = "".join(("<:" + TEAMS[e]["emoji"] + ">") for e in TEAMS)
+ await ctx.send(_("New emojis set to: ") + new_msg)
+ await ctx.send("You should reload the cog for everything to work correctly.")
+
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def resetgames(self, ctx):
+ """
+ Resets the bots game data incase something goes wrong
+ """
+ all_teams = await self.config.teams()
+ for team in await self.config.teams():
+ all_teams.remove(team)
+ team["goal_id"] = {}
+ team["game_state"] = "Null"
+ team["game_start"] = ""
+ team["period"] = 0
+ all_teams.append(team)
+
+ await self.config.teams.set(all_teams)
+ await ctx.send(_("Saved game data reset."))
+
+
+ @gdc.command()
+ @checks.is_owner()
+ async def setcreated(self, ctx, created:bool):
+ """
+ Sets whether or not the game day channels have been created
+ """
+ await self.config.created_gdc.set(created)
+ await ctx.send(_("created_gdc set to ") + str(created))
+
+ @gdc.command()
+ @checks.is_owner()
+ async def cleargdc(self, ctx):
+ """
+ Checks for manually deleted channels from the GDC channel list
+ and removes them
+ """
+ guild = ctx.message.guild
+ good_channels = []
+ for channels in await self.config.guild(guild).gdc():
+ channel = self.bot.get_channel(channels)
+ if channel is None:
+ await self.config._clear_scope(Config.CHANNEL, str(channels))
+ print(channels)
+ continue
+ else:
+ good_channels.append(channel.id)
+ await self.config.guild(guild).gdc.set(good_channels)
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def clear_broken_channels(self, ctx):
+ """
+ Removes missing channels from the config
+ """
+ for channels in await self.config.all_channels():
+ channel = self.bot.get_channel(channels)
+ if channel is None:
+ await self.config._clear_scope(Config.CHANNEL, str(channels))
+ print(channels)
+ continue
+ # if await self.config.channel(channel).to_delete():
+ # await self.config._clear_scope(Config.CHANNEL, str(channels))
+ await ctx.send(_("Broken channels removed"))
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def remove_broken_guild(self, ctx):
+ """
+ Removes a server that no longer exists on the bot
+ """
+ all_guilds = await self.config.all_guilds()
+ for guilds in await self.config.all_guilds():
+ guild = self.bot.get_guild(guilds)
+ if guild is None:
+ await self.config._clear_scope(Config.GUILD, str(guilds))
+ else:
+ if not await self.config.guild(guild).create_channels():
+ await self.config.guild(guild).gdc.set([])
+
+ await ctx.send(_("Saved servers the bot is no longer on have been removed."))
+
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def clear_weekly(self, ctx):
+ """
+ Clears the weekly tracker on the current servers pickems
+
+ May not be necessary anymore
+ """
+ leaderboard = await self.config.guild(ctx.guild).leaderboard()
+ if leaderboard is None:
+ leaderboard = {}
+ for user in leaderboard:
+ leaderboard[str(user)]["weekly"] = 0
+ await self.config.guild(ctx.guild).leaderboard.set(leaderboard)
+
+
+ @hockey_commands.command(hidden=True)
+ @checks.is_owner()
+ async def lights(self, ctx):
+ """
+ Tests the philips Hue light integration
+ This is hard coded at the moment with no plans to make work generally
+ this will be safely ignored.
+ """
+ if not LIGHTS_SET:
+ hue = Oilers(self.bot)
+ await hue.goal_lights()
+ else:
+ return
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def print(self, ctx):
+ """
+ Toggle the console print for cog functions
+ """
+ if not await self.config.print():
+ await self.config.print.set(True)
+ msg = "on"
+ else:
+ await self.config.print.set(False)
+ msg = "off"
+ await ctx.send(_("Console printing is now ") + msg)
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def testloop(self, ctx):
+ """
+ Toggle the test game loop
+ """
+ if not self.TEST_LOOP:
+ self.TEST_LOOP = True
+ else:
+ self.TEST_LOOP = False
+ await ctx.send(_("Test loop set to ") + str(self.TEST_LOOP))
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def rempickem(self, ctx):
+ """
+ Clears the servers current pickems object list
+ """
+ await self.config.guild(ctx.guild).pickems.set([])
+ await ctx.send(_("All pickems removed on this server."))
+
+ @hockeyset_commands.command()
+ @checks.is_owner()
+ async def remleaderboard(self, ctx):
+ """
+ Clears the servers pickems leaderboard
+ """
+ await self.config.guild(ctx.guild).leaderboard.set({})
+ await ctx.send(_("Server leaderboard reset."))
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
+ if getattr(self, "loop", None) is not None:
+ self.loop.cancel()
+
+ __del__ = __unload
diff --git a/hockey/info.json b/hockey/info.json
new file mode 100644
index 0000000..13e0dc7
--- /dev/null
+++ b/hockey/info.json
@@ -0,0 +1,27 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Gather hockey information from nhl.com and display in discord.",
+ "install_msg":"Use `[p]hockey`, `[p]hockeyset` and `[p]gdc` to see what commands are available. If you want the emojis to work please ask <@218773382617890828> to add your bot to his server hosting the emojis.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Hockey",
+ "permissions":[
+ "embed_links",
+ "manage_messages",
+ "manage_channels"
+ ],
+ "requirements":[
+ "pytz"
+ ],
+ "short":"Hockey commands",
+ "tags":[
+ "general",
+ "hockey",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/hockey/locales/messages.pot b/hockey/locales/messages.pot
new file mode 100644
index 0000000..a9b5aeb
--- /dev/null
+++ b/hockey/locales/messages.pot
@@ -0,0 +1,949 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR , YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2018-11-17 09:51-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: redgettext 2.1\n"
+
+
+#: hockey.py:36
+#, docstring
+msgid ""
+"\n"
+" Gather information and post goal updates for NHL hockey teams\n"
+" "
+msgstr ""
+
+#: hockey.py:105
+msgid "Error grabbing game data: "
+msgstr ""
+
+#: hockey.py:126
+msgid "Pickems Set Winner error: "
+msgstr ""
+
+#: hockey.py:133
+msgid "Games Done Playing"
+msgstr ""
+
+#: hockey.py:137
+msgid "Error tallying leaderboard:"
+msgstr ""
+
+#: hockey.py:164
+msgid "Checking GDC"
+msgstr ""
+
+#: hockey.py:202
+msgid "You have already voted! Changing vote to) "
+msgstr ""
+
+#: hockey.py:206
+msgid "Voting has ended!"
+msgstr ""
+
+#: hockey.py:210
+msgid "Don't clutter the voting message with emojis!"
+msgstr ""
+
+#: hockey.py:251 hockey.py:254
+msgid "Emoji changing cancelled"
+msgstr ""
+
+#: hockey.py:266
+#, docstring
+msgid ""
+"\n"
+" Get information from NHL.com\n"
+" "
+msgstr ""
+
+#: hockey.py:273
+#, docstring
+msgid ""
+"\n"
+" Setup commands for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:279
+msgid "On"
+msgstr ""
+
+#: hockey.py:279
+msgid "Off"
+msgstr ""
+
+#: hockey.py:293
+msgid "[Standings"
+msgstr ""
+
+#: hockey.py:295
+msgid "Standings"
+msgstr ""
+
+#: hockey.py:310
+msgid " Hockey Settings"
+msgstr ""
+
+#: hockey.py:313 hockey.py:317
+msgid "Standings Settings"
+msgstr ""
+
+#: hockey.py:316
+msgid ""
+"Hockey Settings\n"
+msgstr ""
+
+#: hockey.py:326
+#, docstring
+msgid ""
+"\n"
+" Game Day Channel setup for the server\n"
+"\n"
+" You can setup only a single team or all teams for the server\n"
+" Game day channels are deleted and created on the day after the game is played\n"
+" usually around 9AM PST\n"
+" "
+msgstr ""
+
+#: hockey.py:362
+msgid "```GDC settings for"
+msgstr ""
+
+#: hockey.py:363
+msgid "Create Game Day Channels:"
+msgstr ""
+
+#: hockey.py:364
+msgid "Delete Game Day Channels: "
+msgstr ""
+
+#: hockey.py:365
+msgid "Team:"
+msgstr ""
+
+#: hockey.py:365
+msgid "Current Channels:"
+msgstr ""
+
+#: hockey.py:368
+msgid "GDC settings for "
+msgstr ""
+
+#: hockey.py:370
+msgid "Create Game Day Channels"
+msgstr ""
+
+#: hockey.py:371
+msgid "Delete Game Day Channels"
+msgstr ""
+
+#: hockey.py:372
+msgid "Team"
+msgstr ""
+
+#: hockey.py:373
+msgid "Current Channels"
+msgstr ""
+
+#: hockey.py:381
+#, docstring
+msgid ""
+"\n"
+" Delete all current game day channels for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:386
+msgid "Game day channels deleted."
+msgstr ""
+
+#: hockey.py:390
+#, docstring
+msgid ""
+"\n"
+" Creates the next gdc for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:396
+msgid "Game day channels created."
+msgstr ""
+
+#: hockey.py:400
+#, docstring
+msgid ""
+"\n"
+" Toggles the game day channel creation on this server\n"
+" "
+msgstr ""
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "will"
+msgstr ""
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "won't"
+msgstr ""
+
+#: hockey.py:406 hockey.py:432
+msgid "Game day channels "
+msgstr ""
+
+#: hockey.py:406
+msgid " be created on this server."
+msgstr ""
+
+#: hockey.py:412
+#, docstring
+msgid ""
+"\n"
+" Change the category for channel creation. Channel is case sensitive.\n"
+" "
+msgstr ""
+
+#: hockey.py:419
+msgid "Game day channels will be created in "
+msgstr ""
+
+#: hockey.py:425
+#, docstring
+msgid ""
+"\n"
+" Toggle's auto deletion of game day channels.\n"
+" "
+msgstr ""
+
+#: hockey.py:432
+msgid ""
+" be deleted on this server.\n"
+msgstr ""
+
+#: hockey.py:433
+msgid "Note, this may not happen until the next set of games."
+msgstr ""
+
+#: hockey.py:439
+#, docstring
+msgid ""
+"\n"
+" Setup game day channels for a single team or all teams\n"
+" \n"
+" Required parameters:\n"
+" `team` must use quotes if a space is in the name will search for partial team name\n"
+" Optional Parameters:\n"
+" `category` must use quotes if a space is in the name will default to current category\n"
+" `delete_gdc` will tell the bot whether or not to delete game day channels automatically\n"
+" must be either `True` or `False` and a category must be provided\n"
+" "
+msgstr ""
+
+#: hockey.py:453
+msgid "I don't have manage channels permission!"
+msgstr ""
+
+#: hockey.py:457
+msgid " is not a valid team!"
+msgstr ""
+
+#: hockey.py:473
+msgid "Game Day Channels for "
+msgstr ""
+
+#: hockey.py:473
+msgid "setup in "
+msgstr ""
+
+#: hockey.py:481
+#, docstring
+msgid ""
+"\n"
+" Restarts the hockey loop incase there are issues with the posts\n"
+" "
+msgstr ""
+
+#: hockey.py:484
+msgid "Restarting..."
+msgstr ""
+
+#: hockey.py:486
+msgid "loop closed..."
+msgstr ""
+
+#: hockey.py:488
+msgid "restarted"
+msgstr ""
+
+#: hockey.py:494
+#, docstring
+msgid ""
+"\n"
+" Allows moderators to set a users points on the leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:503 hockey.py:852
+msgid "There is no current leaderboard for this server!"
+msgstr ""
+
+#: hockey.py:511
+msgid " now has "
+msgstr ""
+
+#: hockey.py:512
+msgid " points on the season, "
+msgstr ""
+
+#: hockey.py:512
+msgid " points for the week,"
+msgstr ""
+
+#: hockey.py:513
+msgid " and "
+msgstr ""
+
+#: hockey.py:513
+msgid " votes overall."
+msgstr ""
+
+#: hockey.py:518
+#, docstring
+msgid ""
+"\n"
+" Posts automatic standings when all games for the day are done\n"
+"\n"
+" `standings_type` can be a division, conference, team, or all\n"
+" `channel` will default to the current channel or be specified\n"
+" "
+msgstr ""
+
+#: hockey.py:531
+msgid "You must choose from "
+msgstr ""
+
+#: hockey.py:541
+msgid "Sending standings to"
+msgstr ""
+
+#: hockey.py:544
+msgid " standings will now be automatically updated in "
+msgstr ""
+
+#: hockey.py:550
+#, docstring
+msgid ""
+"\n"
+" Toggles automatic standings updates\n"
+"\n"
+" This updates at the same time as the game day channels (usually 9AM PST)\n"
+" "
+msgstr ""
+
+#: hockey.py:558
+msgid "Okay, standings "
+msgstr ""
+
+#: hockey.py:558
+msgid "be updated automatically."
+msgstr ""
+
+#: hockey.py:565
+#, docstring
+msgid ""
+"\n"
+" Adds a hockey team goal updates to a channel do 'all' for all teams\n"
+"\n"
+" `team` needs to be all or part of an NHL team if more than one team\n"
+" match it will ask for the correct team.\n"
+" `channel` defaults to the current channel\n"
+" "
+msgstr ""
+
+#: hockey.py:575 hockey.py:618
+msgid " is not an available team!"
+msgstr ""
+
+#: hockey.py:585 hockey.py:917
+msgid "I don't have embed links permission!"
+msgstr ""
+
+#: hockey.py:594
+msgid " goals will be posted in "
+msgstr ""
+
+#: hockey.py:600
+#, docstring
+msgid ""
+"\n"
+" Removes a teams goal updates from a channel\n"
+" defaults to the current channel\n"
+" "
+msgstr ""
+
+#: hockey.py:608
+msgid "no teams are currently being posted in "
+msgstr ""
+
+#: hockey.py:612 hockey.py:628
+msgid "All goal updates will not be posted in "
+msgstr ""
+
+#: hockey.py:631
+msgid " goal updates removed from "
+msgstr ""
+
+#: hockey.py:638
+#, docstring
+msgid ""
+"\n"
+" Display the current version\n"
+" "
+msgstr ""
+
+#: hockey.py:641
+msgid "Hockey version "
+msgstr ""
+
+#: hockey.py:645
+#, docstring
+msgid "Set your role to a team role"
+msgstr ""
+
+#: hockey.py:651 hockey.py:688 hockey.py:746 hockey.py:921 hockey.py:943
+msgid " Does not appear to be an NHL team!"
+msgstr ""
+
+#: hockey.py:660
+msgid "role applied."
+msgstr ""
+
+#: hockey.py:663 hockey.py:700
+msgid " is not an available role!"
+msgstr ""
+
+#: hockey.py:667
+#, docstring
+msgid "Subscribe to goal notifications"
+msgstr ""
+
+#: hockey.py:697
+msgid " role applied."
+msgstr ""
+
+#: hockey.py:704
+#, docstring
+msgid ""
+"\n"
+" Displays current standings\n"
+"\n"
+" If a search is provided you can see a teams complete stats\n"
+" by searching for team or get all standings at once \n"
+" separated by division\n"
+" "
+msgstr ""
+
+#: hockey.py:717
+msgid " Does not appear to be a valid standing type!"
+msgstr ""
+
+#: hockey.py:733
+#, docstring
+msgid ""
+"\n"
+" Gets all NHL games for the current season\n"
+"\n"
+" If team is provided it will grab that teams schedule\n"
+" "
+msgstr ""
+
+#: hockey.py:761
+msgid " have no recent or upcoming games!"
+msgstr ""
+
+#: hockey.py:765
+#, docstring
+msgid ""
+"\n"
+" Search for a player or get a team roster\n"
+" "
+msgstr ""
+
+#: hockey.py:796
+msgid "{} is not an NHL team or Player!"
+msgstr ""
+
+#: hockey.py:801
+#, docstring
+msgid ""
+"\n"
+" Display a nice embed of server specific rules\n"
+" "
+msgstr ""
+
+#: hockey.py:819
+#, docstring
+msgid ""
+"\n"
+" Generates a pickems page for voting on a specified day must be \"DD-MM-YYYY\"\n"
+" "
+msgstr ""
+
+#: hockey.py:826
+msgid ""
+"**Welcome to our daily Pick'ems challenge! Below you will see today's games! Vote for who you think will win! You get one point for each correct prediction. We will be tracking points over the course of the season and will be rewarding weekly, worst and full-season winners!**\n"
+"\n"
+"- Click the reaction for the team you think will win the day's match-up.\n"
+"- Anyone who votes for both teams will have their vote removed and will receive no points!\n"
+"\n"
+"\n"
+"\n"
+msgstr ""
+
+#: hockey.py:866
+msgid "User has left the server "
+msgstr ""
+
+#: hockey.py:889
+msgid ", you're #"
+msgstr ""
+
+#: hockey.py:890
+msgid " leaderboard!"
+msgstr ""
+
+#: hockey.py:902
+#, docstring
+msgid ""
+"\n"
+" Shows the current server leaderboard either seasonal or weekly\n"
+" "
+msgstr ""
+
+#: hockey.py:915
+#, docstring
+msgid "Set the main rules page for the nhl rules command"
+msgstr ""
+
+#: hockey.py:930
+msgid "Done, here's how it will look."
+msgstr ""
+
+#: hockey.py:934
+#, docstring
+msgid ""
+"\n"
+" Get team specific discord links\n"
+"\n"
+" choosing all will create a nicely formatted list of \n"
+" all current NHL team discord server links\n"
+" "
+msgstr ""
+
+#: hockey.py:959
+msgid ""
+"__**Hockey Discord Master List**__\n"
+"```fix\n"
+"- Do not join other discords to troll.\n"
+"- Respect their rules & their members (Yes even the leafs & habs unfortunately).\n"
+"- We don't control the servers below. If you get banned we can not get you unbanned.\n"
+"- Don't be an asshole because then we all look like assholes. They won't see it as one asshole fan they will see it as a toxic fanbase.\n"
+"- Salt levels may vary. Your team is the best here but don't go on another discord and preach it to an angry mob after we just won.\n"
+"- Not following the above rules will result in appropriate punishments ranging from a warningto a ban. ```\n"
+"\n"
+"https://discord.gg/reddithockey"
+msgstr ""
+
+#: hockey.py:998
+#, docstring
+msgid ""
+"\n"
+" Testing function with testgame.json\n"
+" "
+msgstr ""
+
+#: hockey.py:1027
+#, docstring
+msgid ""
+"\n"
+" Manually tally the leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:1031
+msgid "Leaderboard tallying complete."
+msgstr ""
+
+#: hockey.py:1037
+#, docstring
+msgid ""
+"\n"
+" Test checking for new game day channels\n"
+" "
+msgstr ""
+
+#: hockey.py:1045
+#, docstring
+msgid ""
+"\n"
+" Test the automatic standings function/manually update standings\n"
+" "
+msgstr ""
+
+#: hockey.py:1056
+#, docstring
+msgid ""
+"\n"
+" Display current number of servers and channels\n"
+" the cog is storing in console\n"
+" "
+msgstr ""
+
+#: hockey.py:1084
+#, docstring
+msgid ""
+"\n"
+" Set custom emojis for the bot to use\n"
+"\n"
+" Requires you to upload a .yaml file with \n"
+" emojis that the bot can see\n"
+" an example may be found [here](insert link after commit)\n"
+" if no emoji is provided for a team the Other\n"
+" slot will be filled instead\n"
+" It's recommended to have an emoji for every team\n"
+" to utilize all features of the cog such as pickems\n"
+" "
+msgstr ""
+
+#: hockey.py:1097
+msgid "Upload the .yaml file to use. Type `exit` to cancel."
+msgstr ""
+
+#: hockey.py:1104 hockey.py:1110
+msgid "That file doesn't seem to be formatted correctly."
+msgstr ""
+
+#: hockey.py:1113
+msgid "New emojis set to: "
+msgstr ""
+
+#: hockey.py:1120
+#, docstring
+msgid ""
+"\n"
+" Resets the bots game data incase something goes wrong\n"
+" "
+msgstr ""
+
+#: hockey.py:1133
+msgid "Saved game data reset."
+msgstr ""
+
+#: hockey.py:1139
+#, docstring
+msgid ""
+"\n"
+" Sets whether or not the game day channels have been created\n"
+" "
+msgstr ""
+
+#: hockey.py:1143
+msgid "created_gdc set to "
+msgstr ""
+
+#: hockey.py:1148
+#, docstring
+msgid ""
+"\n"
+" Checks for manually deleted channels from the GDC channel list \n"
+" and removes them\n"
+" "
+msgstr ""
+
+#: hockey.py:1167
+#, docstring
+msgid ""
+"\n"
+" Removes missing channels from the config\n"
+" "
+msgstr ""
+
+#: hockey.py:1178
+msgid "Broken channels removed"
+msgstr ""
+
+#: hockey.py:1183
+#, docstring
+msgid ""
+"\n"
+" Removes a server that no longer exists on the bot\n"
+" "
+msgstr ""
+
+#: hockey.py:1195
+msgid "Saved servers the bot is no longer on have been removed."
+msgstr ""
+
+#: hockey.py:1201
+#, docstring
+msgid ""
+"\n"
+" Clears the weekly tracker on the current servers pickems\n"
+"\n"
+" May not be necessary anymore\n"
+" "
+msgstr ""
+
+#: hockey.py:1217
+#, docstring
+msgid ""
+"\n"
+" Tests the philips Hue light integration\n"
+" This is hard coded at the moment with no plans to make work generally\n"
+" this will be safely ignored.\n"
+" "
+msgstr ""
+
+#: hockey.py:1231
+#, docstring
+msgid ""
+"\n"
+" Toggle the console print for cog functions\n"
+" "
+msgstr ""
+
+#: hockey.py:1240
+msgid "Console printing is now "
+msgstr ""
+
+#: hockey.py:1245
+#, docstring
+msgid ""
+"\n"
+" Toggle the test game loop\n"
+" "
+msgstr ""
+
+#: hockey.py:1252
+msgid "Test loop set to "
+msgstr ""
+
+#: hockey.py:1257
+#, docstring
+msgid ""
+"\n"
+" Clears the servers current pickems object list\n"
+" "
+msgstr ""
+
+#: hockey.py:1261
+msgid "All pickems removed on this server."
+msgstr ""
+
+#: hockey.py:1266
+#, docstring
+msgid ""
+"\n"
+" Clears the servers pickems leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:1270
+msgid "Server leaderboard reset."
+msgstr ""
+
+#: goal.py:149
+msgid "Could not post goal in "
+msgstr ""
+
+#: goal.py:174
+msgid "Cannot find message "
+msgstr ""
+
+#: goal.py:216
+msgid "Could not edit goal in"
+msgstr ""
+
+#: goal.py:252 goal.py:253
+msgid "Goals: **"
+msgstr ""
+
+#: goal.py:252 goal.py:253
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " left in the "
+msgstr ""
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " period"
+msgstr ""
+
+#: game.py:102
+msgid "Error grabbing game data: "
+msgstr ""
+
+#: game.py:176 game.py:258
+msgid "Game start "
+msgstr ""
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid "Goals: **"
+msgstr ""
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+
+#: game.py:201
+msgid " Period Goals"
+msgstr ""
+
+#: game.py:218 game.py:219
+msgid " Shootout"
+msgstr ""
+
+#: game.py:222 game.py:255
+msgid "Stars of the game"
+msgstr ""
+
+#: game.py:226 game.py:228
+msgid " Left in the "
+msgstr ""
+
+#: game.py:226 game.py:228
+msgid " period"
+msgstr ""
+
+#: game.py:268
+msgid ""
+"**__Current Score__**\n"
+msgstr ""
+
+#: game.py:377
+msgid " Period starting "
+msgstr ""
+
+#: game.py:377
+msgid " at "
+msgstr ""
+
+#: game.py:384 game.py:408 game.py:508
+msgid "Could not post goal in "
+msgstr ""
+
+#: game.py:503
+msgid " minutes until "
+msgstr ""
+
+#: game.py:504
+msgid " starts"
+msgstr ""
+
+#: embeds.py:16
+msgid "***Any violation of the [Discord TOS](https://discordapp.com/terms) or [Community Guidelines](https://discordapp.com/guidelines) will result in immediate banning and possibly reported to discord.***"
+msgstr ""
+
+#: embeds.py:21
+msgid "__RULES__"
+msgstr ""
+
+#: embeds.py:22
+msgid "__**WARNING**__"
+msgstr ""
+
+#: embeds.py:38
+msgid " Pickems "
+msgstr ""
+
+#: embeds.py:38
+msgid " Leaderboard"
+msgstr ""
+
+#: embeds.py:40
+msgid "Page"
+msgstr ""
+
+#: embeds.py:65
+msgid "Shots"
+msgstr ""
+
+#: embeds.py:66
+msgid "Goals"
+msgstr ""
+
+#: embeds.py:67
+msgid "Assists"
+msgstr ""
+
+#: embeds.py:68
+msgid "Hits"
+msgstr ""
+
+#: embeds.py:69
+msgid "Face Off Percent"
+msgstr ""
+
+#: embeds.py:71
+msgid "Blocked Shots"
+msgstr ""
+
+#: embeds.py:72
+msgid "PIM"
+msgstr ""
+
+#: embeds.py:80
+msgid "Saves"
+msgstr ""
+
+#: embeds.py:81
+msgid "Save Percentage"
+msgstr ""
+
+#: embeds.py:82
+msgid "Goals Against Average"
+msgstr ""
+
+#: menu.py:47
+msgid "I don't have embed links permission!"
+msgstr ""
+
+#: helper.py:31
+msgid ""
+"There's multiple teams with that name, pick one of these:\n"
+msgstr ""
+
+#: helper.py:42 helper.py:56
+msgid "I guess not."
+msgstr ""
+
+#: pickems.py:44
+msgid "You have voted for "
+msgstr ""
+
+#: pickems.py:54
+msgid "You did not vote on this game!"
+msgstr ""
+
+#: pickems.py:119
+msgid "Pickem already exists, adding channel"
+msgstr ""
+
+#: pickems.py:183
+msgid "Error tallying leaderboard in "
+msgstr ""
+
diff --git a/hockey/locales/messages.txt b/hockey/locales/messages.txt
new file mode 100644
index 0000000..a9b5aeb
--- /dev/null
+++ b/hockey/locales/messages.txt
@@ -0,0 +1,949 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR , YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2018-11-17 09:51-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: redgettext 2.1\n"
+
+
+#: hockey.py:36
+#, docstring
+msgid ""
+"\n"
+" Gather information and post goal updates for NHL hockey teams\n"
+" "
+msgstr ""
+
+#: hockey.py:105
+msgid "Error grabbing game data: "
+msgstr ""
+
+#: hockey.py:126
+msgid "Pickems Set Winner error: "
+msgstr ""
+
+#: hockey.py:133
+msgid "Games Done Playing"
+msgstr ""
+
+#: hockey.py:137
+msgid "Error tallying leaderboard:"
+msgstr ""
+
+#: hockey.py:164
+msgid "Checking GDC"
+msgstr ""
+
+#: hockey.py:202
+msgid "You have already voted! Changing vote to) "
+msgstr ""
+
+#: hockey.py:206
+msgid "Voting has ended!"
+msgstr ""
+
+#: hockey.py:210
+msgid "Don't clutter the voting message with emojis!"
+msgstr ""
+
+#: hockey.py:251 hockey.py:254
+msgid "Emoji changing cancelled"
+msgstr ""
+
+#: hockey.py:266
+#, docstring
+msgid ""
+"\n"
+" Get information from NHL.com\n"
+" "
+msgstr ""
+
+#: hockey.py:273
+#, docstring
+msgid ""
+"\n"
+" Setup commands for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:279
+msgid "On"
+msgstr ""
+
+#: hockey.py:279
+msgid "Off"
+msgstr ""
+
+#: hockey.py:293
+msgid "[Standings"
+msgstr ""
+
+#: hockey.py:295
+msgid "Standings"
+msgstr ""
+
+#: hockey.py:310
+msgid " Hockey Settings"
+msgstr ""
+
+#: hockey.py:313 hockey.py:317
+msgid "Standings Settings"
+msgstr ""
+
+#: hockey.py:316
+msgid ""
+"Hockey Settings\n"
+msgstr ""
+
+#: hockey.py:326
+#, docstring
+msgid ""
+"\n"
+" Game Day Channel setup for the server\n"
+"\n"
+" You can setup only a single team or all teams for the server\n"
+" Game day channels are deleted and created on the day after the game is played\n"
+" usually around 9AM PST\n"
+" "
+msgstr ""
+
+#: hockey.py:362
+msgid "```GDC settings for"
+msgstr ""
+
+#: hockey.py:363
+msgid "Create Game Day Channels:"
+msgstr ""
+
+#: hockey.py:364
+msgid "Delete Game Day Channels: "
+msgstr ""
+
+#: hockey.py:365
+msgid "Team:"
+msgstr ""
+
+#: hockey.py:365
+msgid "Current Channels:"
+msgstr ""
+
+#: hockey.py:368
+msgid "GDC settings for "
+msgstr ""
+
+#: hockey.py:370
+msgid "Create Game Day Channels"
+msgstr ""
+
+#: hockey.py:371
+msgid "Delete Game Day Channels"
+msgstr ""
+
+#: hockey.py:372
+msgid "Team"
+msgstr ""
+
+#: hockey.py:373
+msgid "Current Channels"
+msgstr ""
+
+#: hockey.py:381
+#, docstring
+msgid ""
+"\n"
+" Delete all current game day channels for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:386
+msgid "Game day channels deleted."
+msgstr ""
+
+#: hockey.py:390
+#, docstring
+msgid ""
+"\n"
+" Creates the next gdc for the server\n"
+" "
+msgstr ""
+
+#: hockey.py:396
+msgid "Game day channels created."
+msgstr ""
+
+#: hockey.py:400
+#, docstring
+msgid ""
+"\n"
+" Toggles the game day channel creation on this server\n"
+" "
+msgstr ""
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "will"
+msgstr ""
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "won't"
+msgstr ""
+
+#: hockey.py:406 hockey.py:432
+msgid "Game day channels "
+msgstr ""
+
+#: hockey.py:406
+msgid " be created on this server."
+msgstr ""
+
+#: hockey.py:412
+#, docstring
+msgid ""
+"\n"
+" Change the category for channel creation. Channel is case sensitive.\n"
+" "
+msgstr ""
+
+#: hockey.py:419
+msgid "Game day channels will be created in "
+msgstr ""
+
+#: hockey.py:425
+#, docstring
+msgid ""
+"\n"
+" Toggle's auto deletion of game day channels.\n"
+" "
+msgstr ""
+
+#: hockey.py:432
+msgid ""
+" be deleted on this server.\n"
+msgstr ""
+
+#: hockey.py:433
+msgid "Note, this may not happen until the next set of games."
+msgstr ""
+
+#: hockey.py:439
+#, docstring
+msgid ""
+"\n"
+" Setup game day channels for a single team or all teams\n"
+" \n"
+" Required parameters:\n"
+" `team` must use quotes if a space is in the name will search for partial team name\n"
+" Optional Parameters:\n"
+" `category` must use quotes if a space is in the name will default to current category\n"
+" `delete_gdc` will tell the bot whether or not to delete game day channels automatically\n"
+" must be either `True` or `False` and a category must be provided\n"
+" "
+msgstr ""
+
+#: hockey.py:453
+msgid "I don't have manage channels permission!"
+msgstr ""
+
+#: hockey.py:457
+msgid " is not a valid team!"
+msgstr ""
+
+#: hockey.py:473
+msgid "Game Day Channels for "
+msgstr ""
+
+#: hockey.py:473
+msgid "setup in "
+msgstr ""
+
+#: hockey.py:481
+#, docstring
+msgid ""
+"\n"
+" Restarts the hockey loop incase there are issues with the posts\n"
+" "
+msgstr ""
+
+#: hockey.py:484
+msgid "Restarting..."
+msgstr ""
+
+#: hockey.py:486
+msgid "loop closed..."
+msgstr ""
+
+#: hockey.py:488
+msgid "restarted"
+msgstr ""
+
+#: hockey.py:494
+#, docstring
+msgid ""
+"\n"
+" Allows moderators to set a users points on the leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:503 hockey.py:852
+msgid "There is no current leaderboard for this server!"
+msgstr ""
+
+#: hockey.py:511
+msgid " now has "
+msgstr ""
+
+#: hockey.py:512
+msgid " points on the season, "
+msgstr ""
+
+#: hockey.py:512
+msgid " points for the week,"
+msgstr ""
+
+#: hockey.py:513
+msgid " and "
+msgstr ""
+
+#: hockey.py:513
+msgid " votes overall."
+msgstr ""
+
+#: hockey.py:518
+#, docstring
+msgid ""
+"\n"
+" Posts automatic standings when all games for the day are done\n"
+"\n"
+" `standings_type` can be a division, conference, team, or all\n"
+" `channel` will default to the current channel or be specified\n"
+" "
+msgstr ""
+
+#: hockey.py:531
+msgid "You must choose from "
+msgstr ""
+
+#: hockey.py:541
+msgid "Sending standings to"
+msgstr ""
+
+#: hockey.py:544
+msgid " standings will now be automatically updated in "
+msgstr ""
+
+#: hockey.py:550
+#, docstring
+msgid ""
+"\n"
+" Toggles automatic standings updates\n"
+"\n"
+" This updates at the same time as the game day channels (usually 9AM PST)\n"
+" "
+msgstr ""
+
+#: hockey.py:558
+msgid "Okay, standings "
+msgstr ""
+
+#: hockey.py:558
+msgid "be updated automatically."
+msgstr ""
+
+#: hockey.py:565
+#, docstring
+msgid ""
+"\n"
+" Adds a hockey team goal updates to a channel do 'all' for all teams\n"
+"\n"
+" `team` needs to be all or part of an NHL team if more than one team\n"
+" match it will ask for the correct team.\n"
+" `channel` defaults to the current channel\n"
+" "
+msgstr ""
+
+#: hockey.py:575 hockey.py:618
+msgid " is not an available team!"
+msgstr ""
+
+#: hockey.py:585 hockey.py:917
+msgid "I don't have embed links permission!"
+msgstr ""
+
+#: hockey.py:594
+msgid " goals will be posted in "
+msgstr ""
+
+#: hockey.py:600
+#, docstring
+msgid ""
+"\n"
+" Removes a teams goal updates from a channel\n"
+" defaults to the current channel\n"
+" "
+msgstr ""
+
+#: hockey.py:608
+msgid "no teams are currently being posted in "
+msgstr ""
+
+#: hockey.py:612 hockey.py:628
+msgid "All goal updates will not be posted in "
+msgstr ""
+
+#: hockey.py:631
+msgid " goal updates removed from "
+msgstr ""
+
+#: hockey.py:638
+#, docstring
+msgid ""
+"\n"
+" Display the current version\n"
+" "
+msgstr ""
+
+#: hockey.py:641
+msgid "Hockey version "
+msgstr ""
+
+#: hockey.py:645
+#, docstring
+msgid "Set your role to a team role"
+msgstr ""
+
+#: hockey.py:651 hockey.py:688 hockey.py:746 hockey.py:921 hockey.py:943
+msgid " Does not appear to be an NHL team!"
+msgstr ""
+
+#: hockey.py:660
+msgid "role applied."
+msgstr ""
+
+#: hockey.py:663 hockey.py:700
+msgid " is not an available role!"
+msgstr ""
+
+#: hockey.py:667
+#, docstring
+msgid "Subscribe to goal notifications"
+msgstr ""
+
+#: hockey.py:697
+msgid " role applied."
+msgstr ""
+
+#: hockey.py:704
+#, docstring
+msgid ""
+"\n"
+" Displays current standings\n"
+"\n"
+" If a search is provided you can see a teams complete stats\n"
+" by searching for team or get all standings at once \n"
+" separated by division\n"
+" "
+msgstr ""
+
+#: hockey.py:717
+msgid " Does not appear to be a valid standing type!"
+msgstr ""
+
+#: hockey.py:733
+#, docstring
+msgid ""
+"\n"
+" Gets all NHL games for the current season\n"
+"\n"
+" If team is provided it will grab that teams schedule\n"
+" "
+msgstr ""
+
+#: hockey.py:761
+msgid " have no recent or upcoming games!"
+msgstr ""
+
+#: hockey.py:765
+#, docstring
+msgid ""
+"\n"
+" Search for a player or get a team roster\n"
+" "
+msgstr ""
+
+#: hockey.py:796
+msgid "{} is not an NHL team or Player!"
+msgstr ""
+
+#: hockey.py:801
+#, docstring
+msgid ""
+"\n"
+" Display a nice embed of server specific rules\n"
+" "
+msgstr ""
+
+#: hockey.py:819
+#, docstring
+msgid ""
+"\n"
+" Generates a pickems page for voting on a specified day must be \"DD-MM-YYYY\"\n"
+" "
+msgstr ""
+
+#: hockey.py:826
+msgid ""
+"**Welcome to our daily Pick'ems challenge! Below you will see today's games! Vote for who you think will win! You get one point for each correct prediction. We will be tracking points over the course of the season and will be rewarding weekly, worst and full-season winners!**\n"
+"\n"
+"- Click the reaction for the team you think will win the day's match-up.\n"
+"- Anyone who votes for both teams will have their vote removed and will receive no points!\n"
+"\n"
+"\n"
+"\n"
+msgstr ""
+
+#: hockey.py:866
+msgid "User has left the server "
+msgstr ""
+
+#: hockey.py:889
+msgid ", you're #"
+msgstr ""
+
+#: hockey.py:890
+msgid " leaderboard!"
+msgstr ""
+
+#: hockey.py:902
+#, docstring
+msgid ""
+"\n"
+" Shows the current server leaderboard either seasonal or weekly\n"
+" "
+msgstr ""
+
+#: hockey.py:915
+#, docstring
+msgid "Set the main rules page for the nhl rules command"
+msgstr ""
+
+#: hockey.py:930
+msgid "Done, here's how it will look."
+msgstr ""
+
+#: hockey.py:934
+#, docstring
+msgid ""
+"\n"
+" Get team specific discord links\n"
+"\n"
+" choosing all will create a nicely formatted list of \n"
+" all current NHL team discord server links\n"
+" "
+msgstr ""
+
+#: hockey.py:959
+msgid ""
+"__**Hockey Discord Master List**__\n"
+"```fix\n"
+"- Do not join other discords to troll.\n"
+"- Respect their rules & their members (Yes even the leafs & habs unfortunately).\n"
+"- We don't control the servers below. If you get banned we can not get you unbanned.\n"
+"- Don't be an asshole because then we all look like assholes. They won't see it as one asshole fan they will see it as a toxic fanbase.\n"
+"- Salt levels may vary. Your team is the best here but don't go on another discord and preach it to an angry mob after we just won.\n"
+"- Not following the above rules will result in appropriate punishments ranging from a warningto a ban. ```\n"
+"\n"
+"https://discord.gg/reddithockey"
+msgstr ""
+
+#: hockey.py:998
+#, docstring
+msgid ""
+"\n"
+" Testing function with testgame.json\n"
+" "
+msgstr ""
+
+#: hockey.py:1027
+#, docstring
+msgid ""
+"\n"
+" Manually tally the leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:1031
+msgid "Leaderboard tallying complete."
+msgstr ""
+
+#: hockey.py:1037
+#, docstring
+msgid ""
+"\n"
+" Test checking for new game day channels\n"
+" "
+msgstr ""
+
+#: hockey.py:1045
+#, docstring
+msgid ""
+"\n"
+" Test the automatic standings function/manually update standings\n"
+" "
+msgstr ""
+
+#: hockey.py:1056
+#, docstring
+msgid ""
+"\n"
+" Display current number of servers and channels\n"
+" the cog is storing in console\n"
+" "
+msgstr ""
+
+#: hockey.py:1084
+#, docstring
+msgid ""
+"\n"
+" Set custom emojis for the bot to use\n"
+"\n"
+" Requires you to upload a .yaml file with \n"
+" emojis that the bot can see\n"
+" an example may be found [here](insert link after commit)\n"
+" if no emoji is provided for a team the Other\n"
+" slot will be filled instead\n"
+" It's recommended to have an emoji for every team\n"
+" to utilize all features of the cog such as pickems\n"
+" "
+msgstr ""
+
+#: hockey.py:1097
+msgid "Upload the .yaml file to use. Type `exit` to cancel."
+msgstr ""
+
+#: hockey.py:1104 hockey.py:1110
+msgid "That file doesn't seem to be formatted correctly."
+msgstr ""
+
+#: hockey.py:1113
+msgid "New emojis set to: "
+msgstr ""
+
+#: hockey.py:1120
+#, docstring
+msgid ""
+"\n"
+" Resets the bots game data incase something goes wrong\n"
+" "
+msgstr ""
+
+#: hockey.py:1133
+msgid "Saved game data reset."
+msgstr ""
+
+#: hockey.py:1139
+#, docstring
+msgid ""
+"\n"
+" Sets whether or not the game day channels have been created\n"
+" "
+msgstr ""
+
+#: hockey.py:1143
+msgid "created_gdc set to "
+msgstr ""
+
+#: hockey.py:1148
+#, docstring
+msgid ""
+"\n"
+" Checks for manually deleted channels from the GDC channel list \n"
+" and removes them\n"
+" "
+msgstr ""
+
+#: hockey.py:1167
+#, docstring
+msgid ""
+"\n"
+" Removes missing channels from the config\n"
+" "
+msgstr ""
+
+#: hockey.py:1178
+msgid "Broken channels removed"
+msgstr ""
+
+#: hockey.py:1183
+#, docstring
+msgid ""
+"\n"
+" Removes a server that no longer exists on the bot\n"
+" "
+msgstr ""
+
+#: hockey.py:1195
+msgid "Saved servers the bot is no longer on have been removed."
+msgstr ""
+
+#: hockey.py:1201
+#, docstring
+msgid ""
+"\n"
+" Clears the weekly tracker on the current servers pickems\n"
+"\n"
+" May not be necessary anymore\n"
+" "
+msgstr ""
+
+#: hockey.py:1217
+#, docstring
+msgid ""
+"\n"
+" Tests the philips Hue light integration\n"
+" This is hard coded at the moment with no plans to make work generally\n"
+" this will be safely ignored.\n"
+" "
+msgstr ""
+
+#: hockey.py:1231
+#, docstring
+msgid ""
+"\n"
+" Toggle the console print for cog functions\n"
+" "
+msgstr ""
+
+#: hockey.py:1240
+msgid "Console printing is now "
+msgstr ""
+
+#: hockey.py:1245
+#, docstring
+msgid ""
+"\n"
+" Toggle the test game loop\n"
+" "
+msgstr ""
+
+#: hockey.py:1252
+msgid "Test loop set to "
+msgstr ""
+
+#: hockey.py:1257
+#, docstring
+msgid ""
+"\n"
+" Clears the servers current pickems object list\n"
+" "
+msgstr ""
+
+#: hockey.py:1261
+msgid "All pickems removed on this server."
+msgstr ""
+
+#: hockey.py:1266
+#, docstring
+msgid ""
+"\n"
+" Clears the servers pickems leaderboard\n"
+" "
+msgstr ""
+
+#: hockey.py:1270
+msgid "Server leaderboard reset."
+msgstr ""
+
+#: goal.py:149
+msgid "Could not post goal in "
+msgstr ""
+
+#: goal.py:174
+msgid "Cannot find message "
+msgstr ""
+
+#: goal.py:216
+msgid "Could not edit goal in"
+msgstr ""
+
+#: goal.py:252 goal.py:253
+msgid "Goals: **"
+msgstr ""
+
+#: goal.py:252 goal.py:253
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " left in the "
+msgstr ""
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " period"
+msgstr ""
+
+#: game.py:102
+msgid "Error grabbing game data: "
+msgstr ""
+
+#: game.py:176 game.py:258
+msgid "Game start "
+msgstr ""
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid "Goals: **"
+msgstr ""
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+
+#: game.py:201
+msgid " Period Goals"
+msgstr ""
+
+#: game.py:218 game.py:219
+msgid " Shootout"
+msgstr ""
+
+#: game.py:222 game.py:255
+msgid "Stars of the game"
+msgstr ""
+
+#: game.py:226 game.py:228
+msgid " Left in the "
+msgstr ""
+
+#: game.py:226 game.py:228
+msgid " period"
+msgstr ""
+
+#: game.py:268
+msgid ""
+"**__Current Score__**\n"
+msgstr ""
+
+#: game.py:377
+msgid " Period starting "
+msgstr ""
+
+#: game.py:377
+msgid " at "
+msgstr ""
+
+#: game.py:384 game.py:408 game.py:508
+msgid "Could not post goal in "
+msgstr ""
+
+#: game.py:503
+msgid " minutes until "
+msgstr ""
+
+#: game.py:504
+msgid " starts"
+msgstr ""
+
+#: embeds.py:16
+msgid "***Any violation of the [Discord TOS](https://discordapp.com/terms) or [Community Guidelines](https://discordapp.com/guidelines) will result in immediate banning and possibly reported to discord.***"
+msgstr ""
+
+#: embeds.py:21
+msgid "__RULES__"
+msgstr ""
+
+#: embeds.py:22
+msgid "__**WARNING**__"
+msgstr ""
+
+#: embeds.py:38
+msgid " Pickems "
+msgstr ""
+
+#: embeds.py:38
+msgid " Leaderboard"
+msgstr ""
+
+#: embeds.py:40
+msgid "Page"
+msgstr ""
+
+#: embeds.py:65
+msgid "Shots"
+msgstr ""
+
+#: embeds.py:66
+msgid "Goals"
+msgstr ""
+
+#: embeds.py:67
+msgid "Assists"
+msgstr ""
+
+#: embeds.py:68
+msgid "Hits"
+msgstr ""
+
+#: embeds.py:69
+msgid "Face Off Percent"
+msgstr ""
+
+#: embeds.py:71
+msgid "Blocked Shots"
+msgstr ""
+
+#: embeds.py:72
+msgid "PIM"
+msgstr ""
+
+#: embeds.py:80
+msgid "Saves"
+msgstr ""
+
+#: embeds.py:81
+msgid "Save Percentage"
+msgstr ""
+
+#: embeds.py:82
+msgid "Goals Against Average"
+msgstr ""
+
+#: menu.py:47
+msgid "I don't have embed links permission!"
+msgstr ""
+
+#: helper.py:31
+msgid ""
+"There's multiple teams with that name, pick one of these:\n"
+msgstr ""
+
+#: helper.py:42 helper.py:56
+msgid "I guess not."
+msgstr ""
+
+#: pickems.py:44
+msgid "You have voted for "
+msgstr ""
+
+#: pickems.py:54
+msgid "You did not vote on this game!"
+msgstr ""
+
+#: pickems.py:119
+msgid "Pickem already exists, adding channel"
+msgstr ""
+
+#: pickems.py:183
+msgid "Error tallying leaderboard in "
+msgstr ""
+
diff --git a/hockey/locales/sv-SE.po b/hockey/locales/sv-SE.po
new file mode 100644
index 0000000..300a6e1
--- /dev/null
+++ b/hockey/locales/sv-SE.po
@@ -0,0 +1,1143 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# Author: Randompunkt#7753.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2018-11-17 09:51-0700\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: redgettext 2.1\n"
+
+
+#: hockey.py:36
+#, docstring
+msgid ""
+"\n"
+" Gather information and post goal updates for NHL hockey teams\n"
+" "
+msgstr ""
+"\n"
+" Gather information and post goal updates for NHL hockey teams\n"
+" "
+
+#: hockey.py:105
+msgid "Error grabbing game data: "
+msgstr "Fel uppstod vid inhämtande av matchstatistik: "
+
+#: hockey.py:126
+msgid "Pickems Set Winner error: "
+msgstr "Fel uppstod med att sätta Pickemsvinnare"
+
+#: hockey.py:133
+msgid "Games Done Playing"
+msgstr "Matcherna är färdigspelade"
+
+#: hockey.py:137
+msgid "Error tallying leaderboard:"
+msgstr "Problem med sammanställning av tabell:"
+
+#: hockey.py:164
+msgid "Checking GDC"
+msgstr "Kollar GDC (Game Day Channel)"
+
+#: hockey.py:202
+msgid "You have already voted! Changing vote to) "
+msgstr "Du har redan röstat! Ändrar röst till) "
+
+#: hockey.py:206
+msgid "Voting has ended!"
+msgstr "Röstningen har avslutats!"
+
+#: hockey.py:210
+msgid "Don't clutter the voting message with emojis!"
+msgstr "Rör inte till röstningsmeddelandet med emojis!"
+
+#: hockey.py:251 hockey.py:254
+msgid "Emoji changing cancelled"
+msgstr "Emojibyte avbrutet"
+
+#: hockey.py:266
+#, docstring
+msgid ""
+"\n"
+" Get information from NHL.com\n"
+" "
+msgstr ""
+"\n"
+" Get information from NHL.com\n"
+" "
+
+#: hockey.py:273
+#, docstring
+msgid ""
+"\n"
+" Setup commands for the server\n"
+" "
+msgstr ""
+"\n"
+" Setup commands for the server\n"
+" "
+
+#: hockey.py:279
+msgid "On"
+msgstr "På"
+
+#: hockey.py:279
+msgid "Off"
+msgstr "Av"
+
+#: hockey.py:293
+msgid "[Standings"
+msgstr "[Ställning"
+
+#: hockey.py:295
+msgid "Standings"
+msgstr "Ställning"
+
+#: hockey.py:310
+msgid " Hockey Settings"
+msgstr "Hockeyinställingar"
+
+#: hockey.py:313 hockey.py:317
+msgid "Standings Settings"
+msgstr "Ställningsinställningar"
+
+#: hockey.py:316
+msgid ""
+"Hockey Settings\n"
+msgstr ""
+"Hockey Settings\n"
+
+#: hockey.py:326
+#, docstring
+msgid ""
+"\n"
+" Game Day Channel setup for the server\n"
+"\n"
+" You can setup only a single team or all teams for the server\n"
+" Game day channels are deleted and created on the day after the game is played\n"
+" usually around 9AM PST\n"
+" "
+msgstr ""
+"\n"
+" Game Day Channel setup for the server\n"
+"\n"
+" You can setup only a single team or all teams for the server\n"
+" Game day channels are deleted and created on the day after the game is played\n"
+" usually around 9AM PST\n"
+" "
+
+#: hockey.py:362
+msgid "```GDC settings for"
+msgstr "```GDC (Game Day Channel) inställningar för"
+
+#: hockey.py:363
+msgid "Create Game Day Channels:"
+msgstr "Skapa Game Day Channels:"
+
+#: hockey.py:364
+msgid "Delete Game Day Channels: "
+msgstr "Ta bort Game Day Channels: "
+
+#: hockey.py:365
+msgid "Team:"
+msgstr "Lag:"
+
+#: hockey.py:365
+msgid "Current Channels:"
+msgstr "Nuvarande Kanaler:"
+
+#: hockey.py:368
+msgid "GDC settings for "
+msgstr "GDC (Game Day Channels) inställningar för"
+
+#: hockey.py:370
+msgid "Create Game Day Channels"
+msgstr "Skapa Game Day Channels"
+
+#: hockey.py:371
+msgid "Delete Game Day Channels"
+msgstr "Ta bort Game Day Channels"
+
+#: hockey.py:372
+msgid "Team"
+msgstr "Lag"
+
+#: hockey.py:373
+msgid "Current Channels"
+msgstr "Nuvarande Kanaler"
+
+#: hockey.py:381
+#, docstring
+msgid ""
+"\n"
+" Delete all current game day channels for the server\n"
+" "
+msgstr ""
+"\n"
+" Delete all current game day channels for the server\n"
+" "
+
+#: hockey.py:386
+msgid "Game day channels deleted."
+msgstr "Game day channels borttagna"
+
+#: hockey.py:390
+#, docstring
+msgid ""
+"\n"
+" Creates the next gdc for the server\n"
+" "
+msgstr ""
+"\n"
+" Creates the next gdc for the server\n"
+" "
+
+#: hockey.py:396
+msgid "Game day channels created."
+msgstr "Game day channels skapade"
+
+#: hockey.py:400
+#, docstring
+msgid ""
+"\n"
+" Toggles the game day channel creation on this server\n"
+" "
+msgstr ""
+"\n"
+" Toggles the game day channel creation on this server\n"
+" "
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "will"
+msgstr "kommer"
+
+#: hockey.py:405 hockey.py:431 hockey.py:557
+msgid "won't"
+msgstr "kommer inte"
+
+#: hockey.py:406 hockey.py:432
+msgid "Game day channels "
+msgstr "Game day channels"
+
+#: hockey.py:406
+msgid " be created on this server."
+msgstr " skapas på den här servern"
+
+#: hockey.py:412
+#, docstring
+msgid ""
+"\n"
+" Change the category for channel creation. Channel is case sensitive.\n"
+" "
+msgstr ""
+"\n"
+" Change the category for channel creation. Channel is case sensitive.\n"
+" "
+
+#: hockey.py:419
+msgid "Game day channels will be created in "
+msgstr "Game day channels kommer skapas i "
+
+#: hockey.py:425
+#, docstring
+msgid ""
+"\n"
+" Toggle's auto deletion of game day channels.\n"
+" "
+msgstr ""
+"\n"
+" Toggle's auto deletion of game day channels.\n"
+" "
+
+#: hockey.py:432
+msgid ""
+" be deleted on this server.\n"
+msgstr ""
+" be deleted on this server.\n"
+
+#: hockey.py:433
+msgid "Note, this may not happen until the next set of games."
+msgstr "Notis, detta kan inte hända förrän efter nästa matchrunda"
+
+#: hockey.py:439
+#, docstring
+msgid ""
+"\n"
+" Setup game day channels for a single team or all teams\n"
+" \n"
+" Required parameters:\n"
+" `team` must use quotes if a space is in the name will search for partial team name\n"
+" Optional Parameters:\n"
+" `category` must use quotes if a space is in the name will default to current category\n"
+" `delete_gdc` will tell the bot whether or not to delete game day channels automatically\n"
+" must be either `True` or `False` and a category must be provided\n"
+" "
+msgstr ""
+"\n"
+" Setup game day channels for a single team or all teams\n"
+" \n"
+" Required parameters:\n"
+" `team` must use quotes if a space is in the name will search for partial team name\n"
+" Optional Parameters:\n"
+" `category` must use quotes if a space is in the name will default to current category\n"
+" `delete_gdc` will tell the bot whether or not to delete game day channels automatically\n"
+" must be either `True` or `False` and a category must be provided\n"
+" "
+
+
+#: hockey.py:453
+msgid "I don't have manage channels permission!"
+msgstr "Jag har inte rätten att hantera kanaler"
+
+#: hockey.py:457
+msgid " is not a valid team!"
+msgstr " är inte ett giltigt lag"
+
+#: hockey.py:473
+msgid "Game Day Channels for "
+msgstr "Game Day channels för "
+
+#: hockey.py:473
+msgid "setup in "
+msgstr "Sätt up i "
+
+#: hockey.py:481
+#, docstring
+msgid ""
+"\n"
+" Restarts the hockey loop incase there are issues with the posts\n"
+" "
+msgstr ""
+"\n"
+" Restarts the hockey loop incase there are issues with the posts\n"
+" "
+
+#: hockey.py:484
+msgid "Restarting..."
+msgstr "Startar om..."
+
+#: hockey.py:486
+msgid "loop closed..."
+msgstr "slinga stängd..."
+
+#: hockey.py:488
+msgid "restarted"
+msgstr "Omstartad"
+
+#: hockey.py:494
+#, docstring
+msgid ""
+"\n"
+" Allows moderators to set a users points on the leaderboard\n"
+" "
+msgstr ""
+"\n"
+" Allows moderators to set a users points on the leaderboard\n"
+" "
+
+#: hockey.py:503 hockey.py:852
+msgid "There is no current leaderboard for this server!"
+msgstr "Det finns ingen nuvarande tabellställning för den här servern!"
+
+#: hockey.py:511
+msgid " now has "
+msgstr " har nu "
+
+#: hockey.py:512
+msgid " points on the season, "
+msgstr " poäng på den här servern, "
+
+#: hockey.py:512
+msgid " points for the week,"
+msgstr " poäng den här veckan, "
+
+#: hockey.py:513
+msgid " and "
+msgstr " och "
+
+#: hockey.py:513
+msgid " votes overall."
+msgstr " totala röster, "
+
+#: hockey.py:518
+#, docstring
+msgid ""
+"\n"
+" Posts automatic standings when all games for the day are done\n"
+"\n"
+" `standings_type` can be a division, conference, team, or all\n"
+" `channel` will default to the current channel or be specified\n"
+" "
+msgstr ""
+"\n"
+" Posts automatic standings when all games for the day are done\n"
+"\n"
+" `standings_type` can be a division, conference, team, or all\n"
+" `channel` will default to the current channel or be specified\n"
+" "
+
+#: hockey.py:531
+msgid "You must choose from "
+msgstr "Du måste välja från "
+
+#: hockey.py:541
+msgid "Sending standings to"
+msgstr "Skickar ställning till"
+
+#: hockey.py:544
+msgid " standings will now be automatically updated in "
+msgstr " ställningen kommer nu uppdateras automatiskt i "
+
+#: hockey.py:550
+#, docstring
+msgid ""
+"\n"
+" Toggles automatic standings updates\n"
+"\n"
+" This updates at the same time as the game day channels (usually 9AM PST)\n"
+" "
+msgstr ""
+"\n"
+" Toggles automatic standings updates\n"
+"\n"
+" This updates at the same time as the game day channels (usually 9AM PST)\n"
+" "
+
+
+#: hockey.py:558
+msgid "Okay, standings "
+msgstr "Okej, ställningen "
+
+#: hockey.py:558
+msgid "be updated automatically."
+msgstr "uppdateras automatiskt"
+
+#: hockey.py:565
+#, docstring
+msgid ""
+"\n"
+" Adds a hockey team goal updates to a channel do 'all' for all teams\n"
+"\n"
+" `team` needs to be all or part of an NHL team if more than one team\n"
+" match it will ask for the correct team.\n"
+" `channel` defaults to the current channel\n"
+" "
+msgstr ""
+"\n"
+" Adds a hockey team goal updates to a channel do 'all' for all teams\n"
+"\n"
+" `team` needs to be all or part of an NHL team if more than one team\n"
+" match it will ask for the correct team.\n"
+" `channel` defaults to the current channel\n"
+" "
+
+#: hockey.py:575 hockey.py:618
+msgid " is not an available team!"
+msgstr " är inte ett tillgängligt lag!"
+
+#: hockey.py:585 hockey.py:917
+msgid "I don't have embed links permission!"
+msgstr "Jag har inte tillstånd att bädda in länkar!"
+
+#: hockey.py:594
+msgid " goals will be posted in "
+msgstr " Mål kommer att postas i "
+
+#: hockey.py:600
+#, docstring
+msgid ""
+"\n"
+" Removes a teams goal updates from a channel\n"
+" defaults to the current channel\n"
+" "
+msgstr ""
+"\n"
+" Removes a teams goal updates from a channel\n"
+" defaults to the current channel\n"
+" "
+
+#: hockey.py:608
+msgid "no teams are currently being posted in "
+msgstr "inga lag postas för tillfället i "
+
+#: hockey.py:612 hockey.py:628
+msgid "All goal updates will not be posted in "
+msgstr "Alla måluppdateringar kommer inte postas i "
+
+#: hockey.py:631
+msgid " goal updates removed from "
+msgstr " måluppdateringar borttagna från "
+
+#: hockey.py:638
+#, docstring
+msgid ""
+"\n"
+" Display the current version\n"
+" "
+msgstr ""
+"\n"
+" Display the current version\n"
+" "
+
+#: hockey.py:641
+msgid "Hockey version "
+msgstr "Hockeyversion "
+
+#: hockey.py:645
+#, docstring
+msgid "Set your role to a team role"
+msgstr "Sätt din roll som en lagroll"
+
+#: hockey.py:651 hockey.py:688 hockey.py:746 hockey.py:921 hockey.py:943
+msgid " Does not appear to be an NHL team!"
+msgstr " Verkar inte vara ett NHL-lag!"
+
+#: hockey.py:660
+msgid "role applied."
+msgstr "roll tillämpad."
+
+#: hockey.py:663 hockey.py:700
+msgid " is not an available role!"
+msgstr " är inte en tillgänglig roll!"
+
+#: hockey.py:667
+#, docstring
+msgid "Subscribe to goal notifications"
+msgstr "Prenumerera på målnotifikationer"
+
+#: hockey.py:697
+msgid " role applied."
+msgstr " roll tillämpad "
+
+#: hockey.py:704
+#, docstring
+msgid ""
+"\n"
+" Displays current standings\n"
+"\n"
+" If a search is provided you can see a teams complete stats\n"
+" by searching for team or get all standings at once \n"
+" separated by division\n"
+" "
+msgstr ""
+"\n"
+" Displays current standings\n"
+"\n"
+" If a search is provided you can see a teams complete stats\n"
+" by searching for team or get all standings at once \n"
+" separated by division\n"
+" "
+
+#: hockey.py:717
+msgid " Does not appear to be a valid standing type!"
+msgstr " Verkar inte vara en giltig ställningstyp!"
+
+#: hockey.py:733
+#, docstring
+msgid ""
+"\n"
+" Gets all NHL games for the current season\n"
+"\n"
+" If team is provided it will grab that teams schedule\n"
+" "
+msgstr ""
+"\n"
+" Gets all NHL games for the current season\n"
+"\n"
+" If team is provided it will grab that teams schedule\n"
+" "
+
+#: hockey.py:761
+msgid " have no recent or upcoming games!"
+msgstr " har inga nyliga eller kommande matcher!"
+
+#: hockey.py:765
+#, docstring
+msgid ""
+"\n"
+" Search for a player or get a team roster\n"
+" "
+msgstr ""
+"\n"
+" Search for a player or get a team roster\n"
+" "
+
+#: hockey.py:796
+msgid "{} is not an NHL team or Player!"
+msgstr "{} är inte ett NHL-lag eller en spelare!"
+
+#: hockey.py:801
+#, docstring
+msgid ""
+"\n"
+" Display a nice embed of server specific rules\n"
+" "
+msgstr ""
+"\n"
+" Display a nice embed of server specific rules\n"
+" "
+
+#: hockey.py:819
+#, docstring
+msgid ""
+"\n"
+" Generates a pickems page for voting on a specified day must be \"DD-MM-YYYY\"\n"
+" "
+msgstr ""
+"\n"
+" Generates a pickems page for voting on a specified day must be \"DD-MM-YYYY\"\n"
+" "
+
+#: hockey.py:826
+msgid ""
+"**Welcome to our daily Pick'ems challenge! Below you will see today's games! Vote for who you think will win! You get one point for each correct prediction. We will be tracking points over the course of the season and will be rewarding weekly, worst and full-season winners!**\n"
+"\n"
+"- Click the reaction for the team you think will win the day's match-up.\n"
+"- Anyone who votes for both teams will have their vote removed and will receive no points!\n"
+"\n"
+"\n"
+"\n"
+msgstr ""
+"**Welcome to our daily Pick'ems challenge! Below you will see today's games! Vote for who you think will win! You get one point for each correct prediction. We will be tracking points over the course of the season and will be rewarding weekly, worst and full-season winners!**\n"
+"\n"
+"- Click the reaction for the team you think will win the day's match-up.\n"
+"- Anyone who votes for both teams will have their vote removed and will receive no points!\n"
+"\n"
+"\n"
+"\n"
+
+#: hockey.py:866
+msgid "User has left the server "
+msgstr "Användaren har lämnat servern "
+
+#: hockey.py:889
+msgid ", you're #"
+msgstr ", du är #"
+
+#: hockey.py:890
+msgid " leaderboard!"
+msgstr " tabellställning"
+
+#: hockey.py:902
+#, docstring
+msgid ""
+"\n"
+" Shows the current server leaderboard either seasonal or weekly\n"
+" "
+msgstr ""
+"\n"
+" Shows the current server leaderboard either seasonal or weekly\n"
+" "
+
+#: hockey.py:915
+#, docstring
+msgid "Set the main rules page for the nhl rules command"
+msgstr "Sätter den huvudsakliga regelsidan för NHL-regelkommandon"
+
+#: hockey.py:930
+msgid "Done, here's how it will look."
+msgstr "Klart, här är hur det kommer se ut."
+
+#: hockey.py:934
+#, docstring
+msgid ""
+"\n"
+" Get team specific discord links\n"
+"\n"
+" choosing all will create a nicely formatted list of \n"
+" all current NHL team discord server links\n"
+" "
+msgstr ""
+"\n"
+" Get team specific discord links\n"
+"\n"
+" choosing all will create a nicely formatted list of \n"
+" all current NHL team discord server links\n"
+" "
+
+#: hockey.py:959
+msgid ""
+"__**Hockey Discord Master List**__\n"
+"```fix\n"
+"- Do not join other discords to troll.\n"
+"- Respect their rules & their members (Yes even the leafs & habs unfortunately).\n"
+"- We don't control the servers below. If you get banned we can not get you unbanned.\n"
+"- Don't be an asshole because then we all look like assholes. They won't see it as one asshole fan they will see it as a toxic fanbase.\n"
+"- Salt levels may vary. Your team is the best here but don't go on another discord and preach it to an angry mob after we just won.\n"
+"- Not following the above rules will result in appropriate punishments ranging from a warningto a ban. ```\n"
+"\n"
+"https://discord.gg/reddithockey"
+msgstr ""
+"__**Hockey Discord Master List**__\n"
+"```fix\n"
+"- Do not join other discords to troll.\n"
+"- Respect their rules & their members (Yes even the leafs & habs unfortunately).\n"
+"- We don't control the servers below. If you get banned we can not get you unbanned.\n"
+"- Don't be an asshole because then we all look like assholes. They won't see it as one asshole fan they will see it as a toxic fanbase.\n"
+"- Salt levels may vary. Your team is the best here but don't go on another discord and preach it to an angry mob after we just won.\n"
+"- Not following the above rules will result in appropriate punishments ranging from a warningto a ban. ```\n"
+"\n"
+"https://discord.gg/reddithockey"
+
+#: hockey.py:998
+#, docstring
+msgid ""
+"\n"
+" Testing function with testgame.json\n"
+" "
+msgstr ""
+"\n"
+" Testing function with testgame.json\n"
+" "
+
+#: hockey.py:1027
+#, docstring
+msgid ""
+"\n"
+" Manually tally the leaderboard\n"
+" "
+msgstr ""
+"\n"
+" Manually tally the leaderboard\n"
+" "
+
+#: hockey.py:1031
+msgid "Leaderboard tallying complete."
+msgstr "Tabellsammanställning klar."
+
+#: hockey.py:1037
+#, docstring
+msgid ""
+"\n"
+" Test checking for new game day channels\n"
+" "
+msgstr ""
+"\n"
+" Test checking for new game day channels\n"
+" "
+
+#: hockey.py:1045
+#, docstring
+msgid ""
+"\n"
+" Test the automatic standings function/manually update standings\n"
+" "
+msgstr ""
+"\n"
+" Test the automatic standings function/manually update standings\n"
+" "
+
+#: hockey.py:1056
+#, docstring
+msgid ""
+"\n"
+" Display current number of servers and channels\n"
+" the cog is storing in console\n"
+" "
+msgstr ""
+"\n"
+" Display current number of servers and channels\n"
+" the cog is storing in console\n"
+" "
+
+#: hockey.py:1084
+#, docstring
+msgid ""
+"\n"
+" Set custom emojis for the bot to use\n"
+"\n"
+" Requires you to upload a .yaml file with \n"
+" emojis that the bot can see\n"
+" an example may be found [here](insert link after commit)\n"
+" if no emoji is provided for a team the Other\n"
+" slot will be filled instead\n"
+" It's recommended to have an emoji for every team\n"
+" to utilize all features of the cog such as pickems\n"
+" "
+msgstr ""
+"\n"
+" Set custom emojis for the bot to use\n"
+"\n"
+" Requires you to upload a .yaml file with \n"
+" emojis that the bot can see\n"
+" an example may be found [here](insert link after commit)\n"
+" if no emoji is provided for a team the Other\n"
+" slot will be filled instead\n"
+" It's recommended to have an emoji for every team\n"
+" to utilize all features of the cog such as pickems\n"
+" "
+
+#: hockey.py:1097
+msgid "Upload the .yaml file to use. Type `exit` to cancel."
+msgstr "Ladda upp .yaml fil att använda. skriv `avsluta` för att avbryta"
+
+#: hockey.py:1104 hockey.py:1110
+msgid "That file doesn't seem to be formatted correctly."
+msgstr "Filen ser inte ut att vara korrekt formaterad"
+
+#: hockey.py:1113
+msgid "New emojis set to: "
+msgstr "Nya emojis satta till: "
+
+#: hockey.py:1120
+#, docstring
+msgid ""
+"\n"
+" Resets the bots game data incase something goes wrong\n"
+" "
+msgstr ""
+"\n"
+" Resets the bots game data incase something goes wrong\n"
+" "
+
+#: hockey.py:1133
+msgid "Saved game data reset."
+msgstr "Sparad matchdata återställd."
+
+#: hockey.py:1139
+#, docstring
+msgid ""
+"\n"
+" Sets whether or not the game day channels have been created\n"
+" "
+msgstr ""
+"\n"
+" Sets whether or not the game day channels have been created\n"
+" "
+
+#: hockey.py:1143
+msgid "created_gdc set to "
+msgstr "skapade_gdc satta till "
+
+#: hockey.py:1148
+#, docstring
+msgid ""
+"\n"
+" Checks for manually deleted channels from the GDC channel list \n"
+" and removes them\n"
+" "
+msgstr ""
+"\n"
+" Checks for manually deleted channels from the GDC channel list \n"
+" and removes them\n"
+" "
+
+#: hockey.py:1167
+#, docstring
+msgid ""
+"\n"
+" Removes missing channels from the config\n"
+" "
+msgstr ""
+"\n"
+" Removes missing channels from the config\n"
+" "
+
+#: hockey.py:1178
+msgid "Broken channels removed"
+msgstr "Trasiga kanaler borttagna"
+
+#: hockey.py:1183
+#, docstring
+msgid ""
+"\n"
+" Removes a server that no longer exists on the bot\n"
+" "
+msgstr ""
+"\n"
+" Removes a server that no longer exists on the bot\n"
+" "
+
+#: hockey.py:1195
+msgid "Saved servers the bot is no longer on have been removed."
+msgstr "Sparade servrar som botten inte längre är på har blivit borttagna"
+
+#: hockey.py:1201
+#, docstring
+msgid ""
+"\n"
+" Clears the weekly tracker on the current servers pickems\n"
+"\n"
+" May not be necessary anymore\n"
+" "
+msgstr ""
+"\n"
+" Clears the weekly tracker on the current servers pickems\n"
+"\n"
+" May not be necessary anymore\n"
+" "
+
+#: hockey.py:1217
+#, docstring
+msgid ""
+"\n"
+" Tests the philips Hue light integration\n"
+" This is hard coded at the moment with no plans to make work generally\n"
+" this will be safely ignored.\n"
+" "
+msgstr ""
+"\n"
+" Tests the philips Hue light integration\n"
+" This is hard coded at the moment with no plans to make work generally\n"
+" this will be safely ignored.\n"
+" "
+
+#: hockey.py:1231
+#, docstring
+msgid ""
+"\n"
+" Toggle the console print for cog functions\n"
+" "
+msgstr ""
+"\n"
+" Toggle the console print for cog functions\n"
+" "
+
+#: hockey.py:1240
+msgid "Console printing is now "
+msgstr "Konsolutskrift är nu "
+
+#: hockey.py:1245
+#, docstring
+msgid ""
+"\n"
+" Toggle the test game loop\n"
+" "
+msgstr ""
+"\n"
+" Toggle the test game loop\n"
+" "
+
+#: hockey.py:1252
+msgid "Test loop set to "
+msgstr "Test slinga är nu "
+
+#: hockey.py:1257
+#, docstring
+msgid ""
+"\n"
+" Clears the servers current pickems object list\n"
+" "
+msgstr ""
+"\n"
+" Clears the servers current pickems object list\n"
+" "
+
+#: hockey.py:1261
+msgid "All pickems removed on this server."
+msgstr "Alla pickems borttagna från den här servern."
+
+#: hockey.py:1266
+#, docstring
+msgid ""
+"\n"
+" Clears the servers pickems leaderboard\n"
+" "
+msgstr ""
+"\n"
+" Clears the servers pickems leaderboard\n"
+" "
+
+#: hockey.py:1270
+msgid "Server leaderboard reset."
+msgstr "Server tabellställning återställd."
+
+#: goal.py:149
+msgid "Could not post goal in "
+msgstr "Kunde inte posta mål i "
+
+#: goal.py:174
+msgid "Cannot find message "
+msgstr "Kan inte hitta meddelande "
+
+#: goal.py:216
+msgid "Could not edit goal in"
+msgstr "Kunde inte redigera in mål"
+
+#: goal.py:252 goal.py:253
+msgid "Goals: **"
+msgstr "Mål: **"
+
+#: goal.py:252 goal.py:253
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+"** \n"
+"Skott: **"
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " left in the "
+msgstr " kvar av "
+
+#: goal.py:258 goal.py:271 goal.py:282 goal.py:288
+msgid " period"
+msgstr " period "
+
+#: game.py:102
+msgid "Error grabbing game data: "
+msgstr "Fel uppstod vid inhämtande av matchstatistik: "
+
+#: game.py:176 game.py:258
+msgid "Game start "
+msgstr "Matchstart "
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid "Goals: **"
+msgstr "Mål: **"
+
+#: game.py:182 game.py:183 game.py:243 game.py:244
+msgid ""
+"** \n"
+"Shots: **"
+msgstr ""
+"** \n"
+"Shots: **"
+
+#: game.py:201
+msgid " Period Goals"
+msgstr " Period Mål "
+
+#: game.py:218 game.py:219
+msgid " Shootout"
+msgstr " Straffläggning"
+
+#: game.py:222 game.py:255
+msgid "Stars of the game"
+msgstr "Matchens stjärnor"
+
+#: game.py:226 game.py:228
+msgid " Left in the "
+msgstr " Kvar av"
+
+#: game.py:226 game.py:228
+msgid " period"
+msgstr ""
+
+#: game.py:268
+msgid ""
+"**__Current Score__**\n"
+msgstr ""
+"**__Current Score__**\n"
+
+#: game.py:377
+msgid " Period starting "
+msgstr " Period börjar "
+
+#: game.py:377
+msgid " at "
+msgstr " vid "
+
+#: game.py:384 game.py:408 game.py:508
+msgid "Could not post goal in "
+msgstr "Kunde inte posta mål i "
+
+#: game.py:503
+msgid " minutes until "
+msgstr " minuter till "
+
+#: game.py:504
+msgid " starts"
+msgstr " börjar"
+
+#: embeds.py:16
+msgid "***Any violation of the [Discord TOS](https://discordapp.com/terms) or [Community Guidelines](https://discordapp.com/guidelines) will result in immediate banning and possibly reported to discord.***"
+msgstr "***Någon som helst avvikelse från [Discord TOS](https://discordapp.com/terms) eller [gemenskapens regler](https://discordapp.com/guidelines) kommer leda till omedelbar ban och möjlig rapport till discord.***"
+
+#: embeds.py:21
+msgid "__RULES__"
+msgstr "__REGLER__"
+
+#: embeds.py:22
+msgid "__**WARNING**__"
+msgstr "__**VARNING**__"
+
+#: embeds.py:38
+msgid " Pickems "
+msgstr " Pickems"
+
+#: embeds.py:38
+msgid " Leaderboard"
+msgstr " Tabellställning "
+
+#: embeds.py:40
+msgid "Page"
+msgstr "Sida"
+
+#: embeds.py:65
+msgid "Shots"
+msgstr "Skott"
+
+#: embeds.py:66
+msgid "Goals"
+msgstr "Mål"
+
+#: embeds.py:67
+msgid "Assists"
+msgstr "Assist"
+
+#: embeds.py:68
+msgid "Hits"
+msgstr "Tacklingar"
+
+#: embeds.py:69
+msgid "Face Off Percent"
+msgstr "Tekningsprocent"
+
+#: embeds.py:71
+msgid "Blocked Shots"
+msgstr "Blockerade skott"
+
+#: embeds.py:72
+msgid "PIM"
+msgstr "Utvisningsminuter"
+
+#: embeds.py:80
+msgid "Saves"
+msgstr "Räddningar"
+
+#: embeds.py:81
+msgid "Save Percentage"
+msgstr "Räddningsprocent"
+
+#: embeds.py:82
+msgid "Goals Against Average"
+msgstr "Genomsnitt mål mot"
+
+#: menu.py:47
+msgid "I don't have embed links permission!"
+msgstr "Jag har inte tillstånd att bädda in länkar!"
+
+#: helper.py:31
+msgid ""
+"There's multiple teams with that name, pick one of these:\n"
+msgstr ""
+"There's multiple teams with that name, pick one of these:\n"
+
+#: helper.py:42 helper.py:56
+msgid "I guess not."
+msgstr "Jan antar inte."
+
+#: pickems.py:44
+msgid "You have voted for "
+msgstr "Du har röstat för "
+
+#: pickems.py:54
+msgid "You did not vote on this game!"
+msgstr "Du röstade inte på den här matchen!"
+
+#: pickems.py:119
+msgid "Pickem already exists, adding channel"
+msgstr "Pickem finns redan, lägger till kanal"
+
+#: pickems.py:183
+msgid "Error tallying leaderboard in "
+msgstr "Problem med sammanställning av tabell i "
+
diff --git a/hockey/menu.py b/hockey/menu.py
new file mode 100644
index 0000000..fb77085
--- /dev/null
+++ b/hockey/menu.py
@@ -0,0 +1,90 @@
+import asyncio
+import discord
+import aiohttp
+from redbot.core.commands import Context
+from .embeds import *
+from .standings import Standings
+from .game import Game
+from redbot.core.i18n import Translator
+
+_ = Translator("Hockey", __file__)
+
+numbs = {
+ "next": "➡",
+ "back": "⬅",
+ "exit": "❌"
+}
+async def hockey_menu(ctx:Context, display_type:str, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ if display_type == "standings":
+ em = await Standings.build_standing_embed(post_list, page)
+ if display_type == "division":
+ em = await Standings.build_standing_embed(post_list, page)
+ if display_type == "conference":
+ em = await Standings.build_standing_embed(post_list, page)
+ if display_type == "teams":
+ em = await Standings.build_standing_embed(post_list, page)
+ if display_type == "all":
+ em = await Standings.all_standing_embed(post_list, page)
+ if display_type == "roster":
+ em = await roster_embed(post_list, page)
+ if display_type == "game":
+ em = await Game.get_game_embed(post_list, page)
+ if display_type == "season":
+ leaderboard = {"type": "Seasonal", "lists": post_list}
+ em = await make_leaderboard_embed(ctx.guild, leaderboard, page)
+ if display_type == "weekly":
+ leaderboard = {"type": "Weekly", "lists": post_list}
+ em = await make_leaderboard_embed(ctx.guild, leaderboard, page)
+ if display_type == "worst":
+ leaderboard = {"type": "Worst", "lists": post_list}
+ em = await make_leaderboard_embed(ctx.guild, leaderboard, page)
+ else:
+ await ctx.send(_("I don't have embed links permission!"))
+ return
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await ctx.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await hockey_menu(ctx, display_type, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await hockey_menu(ctx, display_type, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
\ No newline at end of file
diff --git a/hockey/oilers.py b/hockey/oilers.py
new file mode 100644
index 0000000..84e873e
--- /dev/null
+++ b/hockey/oilers.py
@@ -0,0 +1,88 @@
+import asyncio
+from phue import Bridge
+import functools
+
+class Oilers:
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.bridge = Bridge("192.168.0.35")
+ self.lights = self.bridge.lights
+ self.bridge2 = Bridge("192.168.0.115")
+ self.lights2 = self.bridge2.lights
+ self.cur_lights = {}
+ self.cur_lights2 = {}
+
+ # @commands.command(pass_context=True)
+ async def goal_lights(self):
+ task = functools.partial(self.get_current_lights_setting)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ for i in range(5):
+ task = functools.partial(self.oilers_hex_set, x=1.0, y=1.0)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ pass
+ # await self.oilers_hex_set(1.0, 1.0)
+ await asyncio.sleep(0.5)
+ task = functools.partial(self.oilers_hex_set, x=0, y=0)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ pass
+ # await self.oilers_hex_set(0, 0)
+ await asyncio.sleep(0.5)
+ task = functools.partial(self.reset_light_setting)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+
+
+ def reset_light_setting(self):
+ for light in self.lights:
+ old_temp = self.cur_lights[light.name][1]
+ if old_temp < 154:
+ old_temp = 154
+ if old_temp > 500:
+ old_temp = 499
+ light.colortemp = old_temp
+ light.on = self.cur_lights[light.name][0]
+ for light in self.lights2:
+ old_temp = self.cur_lights2[light.name][1]
+ if old_temp < 154:
+ old_temp = 154
+ if old_temp > 500:
+ old_temp = 499
+ light.colortemp = old_temp
+ light.on = self.cur_lights2[light.name][0]
+ return
+
+ def get_current_lights_setting(self):
+ for light in self.lights:
+ self.cur_lights[light.name] = [light.on, light.colortemp]
+ for light in self.lights2:
+ self.cur_lights2[light.name] = [light.on, light.colortemp]
+ return
+
+ def oilers_hex_set(self, x:float, y:float):
+ """Sets the colour for Oilers Goals"""
+ if x > 1.0 or x < 0.0:
+ x = 1.0
+ if y > 1.0 or y < 0.0:
+ y = 1.0
+ for light in self.lights:
+ if not light.on:
+ light.on = True
+ light.xy = [x, y]
+ for light in self.lights2:
+ if not light.on:
+ light.on = True
+ light.xy = [x, y]
diff --git a/hockey/pickems.py b/hockey/pickems.py
new file mode 100644
index 0000000..2a626e8
--- /dev/null
+++ b/hockey/pickems.py
@@ -0,0 +1,207 @@
+from .errors import *
+from datetime import datetime
+from .constants import TEAMS
+from .helper import *
+from redbot.core.i18n import Translator
+
+_ = Translator("Hockey", __file__)
+
+class Pickems:
+ """
+ Pickems object for handling votes on games for the day
+ """
+ def __init__(self, message:list, channel:list, game_start:str, home_team:str, away_team:str, votes:list, winner:str=None):
+ super().__init__()
+ self.message = message
+ self.channel = channel
+ self.game_start = datetime.strptime(game_start, "%Y-%m-%dT%H:%M:%SZ")
+ self.home_team = home_team
+ self.away_team = away_team
+ self.votes = votes
+ self.home_emoji = TEAMS[home_team]["emoji"] if home_team in TEAMS else "nhl:496510372828807178"
+ self.away_emoji = TEAMS[away_team]["emoji"] if away_team in TEAMS else "nhl:496510372828807178"
+ self.winner = winner
+
+ def add_vote(self, user_id, team):
+ time_now = datetime.utcnow()
+
+ team_choice = None
+ if str(team.id) in self.home_emoji:
+ team_choice = self.home_team
+ if str(team.id) in self.away_emoji:
+ team_choice = self.away_team
+ if team_choice is None:
+ raise NotAValidTeamError()
+ user_voted = False
+ for user, choice in self.votes:
+ if user_id == user:
+ user_voted = True
+ if time_now > self.game_start:
+ if choice == self.home_team:
+ emoji = self.home_emoji
+ if choice == self.away_team:
+ emoji = self.away_emoji
+ raise VotingHasEndedError(_("You have voted for ") + f"<:{emoji}>")
+ if choice != team_choice:
+ if (user, choice) in self.votes:
+ self.votes.remove((user, choice))
+ if (user, team_choice) in self.votes:
+ # Redundancy so we don't end up with duplicate votes
+ self.votes.remove((user, team_choice))
+ self.votes.append((user_id, team_choice))
+ raise UserHasVotedError("{} {}".format(team, team_choice))
+ if time_now > self.game_start and not user_voted:
+ raise VotingHasEndedError(_("You did not vote on this game!"))
+ if not user_voted and team_choice is not None:
+ self.votes.append((user_id, team_choice))
+
+ async def set_pickem_winner(self, game):
+ """
+ Sets the pickem object winner from game object
+ """
+ if game.home_score > game.away_score:
+ self.winner = self.home_team
+ if game.away_score > game.home_score:
+ self.winner = self.away_team
+
+ @staticmethod
+ async def find_pickems_object(bot, game):
+ """
+ Returns a list of all pickems on the bot for that game
+ """
+ config = hockey_config()
+ return_pickems = []
+ for guild_id in await config.all_guilds():
+ guild = bot.get_guild(int(guild_id))
+ pickems = await config.guild(guild).pickems()
+ if pickems is None:
+ pickems = []
+ for p in pickems:
+ if p["home_team"] == game.home_team and p["away_team"] == game.away_team:
+ if p["game_start"] == game.game_start.strftime("%Y-%m-%dT%H:%M:%SZ"):
+ # Only use the old one if the date is the same and the same teams are playing
+ return_pickems.append(Pickems.from_json(p))
+ return return_pickems
+
+ @staticmethod
+ async def set_guild_pickem_winner(bot, game):
+ pickem_obj = await Pickems.find_pickems_object(bot, game)
+ config = hockey_config()
+ for pickem in pickem_obj:
+ for channel in pickem.channel:
+ chn = bot.get_channel(channel)
+ if chn is None:
+ continue
+ if pickem.winner != None:
+ continue
+ p_data = await config.guild(chn.guild).pickems()
+ p_data.remove(pickem.to_json())
+ await pickem.set_pickem_winner(game)
+ p_data.append(pickem.to_json())
+ await config.guild(chn.guild).pickems.set(p_data)
+
+
+ @staticmethod
+ async def create_pickem_object(guild, message, channel, game):
+ """
+ Checks to see if a pickem object is already created for the game
+ if not it creates one or adds the message, channel to the current ones
+ """
+ config = hockey_config()
+ pickems = await config.guild(guild).pickems()
+ if pickems is None:
+ pickems = []
+ old_pickem = None
+ for p in pickems:
+ if p["home_team"] == game.home_team and p["away_team"] == game.away_team:
+ if p["game_start"] == game.game_start.strftime("%Y-%m-%dT%H:%M:%SZ"):
+ # Only use the old one if the date is the same and the same teams are playing
+ print(_("Pickem already exists, adding channel"))
+ old_pickem = p
+
+ if old_pickem is None:
+ pickems.append({"message":[message.id],
+ "channel":[channel.id],
+ "game_start": game.game_start.strftime("%Y-%m-%dT%H:%M:%SZ"),
+ "home_team":game.home_team,
+ "away_team": game.away_team,
+ "votes": [],
+ "winner":None})
+ else:
+ pickems.remove(old_pickem)
+ old_pickem["message"].append(message.id)
+ old_pickem["channel"].append(channel.id)
+ pickems.append(old_pickem)
+ await config.guild(guild).pickems.set(pickems)
+
+ @staticmethod
+ async def reset_weekly(bot):
+ # Reset the weekly leaderboard for all servers
+ config =hockey_config()
+ for guild_id in await config.all_guilds():
+ guild = bot.get_guild(id=guild_id)
+ if guild is None:
+ continue
+ leaderboard = await config.guild(guild).leaderboard()
+ if leaderboard is None:
+ leaderboard = {}
+ for user in leaderboard:
+ leaderboard[str(user)]["weekly"] = 0
+ await config.guild(guild).leaderboard.set(leaderboard)
+
+
+ @staticmethod
+ async def tally_leaderboard(bot):
+ """
+ This should be where the pickems is removed and tallies are added
+ to the leaderboard
+ """
+ config = hockey_config()
+ for guild_id in await config.all_guilds():
+ guild = bot.get_guild(id=guild_id)
+ if guild is None:
+ continue
+ try:
+ pickem_list_json = await config.guild(guild).pickems()
+ if pickem_list_json is None:
+ continue
+ pickem_list = [Pickems.from_json(p) for p in pickem_list_json]
+ for pickems in pickem_list:
+ if pickems.winner is not None:
+ leaderboard = await config.guild(guild).leaderboard()
+ if leaderboard is None:
+ leaderboard = {}
+ for user, choice in pickems.votes:
+ if str(user) not in leaderboard:
+ leaderboard[str(user)] = {"season": 0, "weekly": 0, "total":0}
+ if choice == pickems.winner:
+ if str(user) not in leaderboard:
+ leaderboard[str(user)] = {"season": 1, "weekly": 1, "total":0}
+ else:
+ leaderboard[str(user)]["season"] += 1
+ leaderboard[str(user)]["weekly"] += 1
+ if "total" not in leaderboard[str(user)]:
+ leaderboard[str(user)]["total"] = 0
+ leaderboard[str(user)]["total"] += 1
+ await config.guild(guild).leaderboard.set(leaderboard)
+ await config.guild(guild).pickems.set([p.to_json() for p in pickem_list if p.winner is None])
+ except Exception as e:
+ print(_("Error tallying leaderboard in ") + f"{guild.name} {e}")
+
+
+
+ def to_json(self) -> dict:
+ return {
+ "message" : self.message,
+ "channel" : self.channel,
+ "game_start" : self.game_start.strftime("%Y-%m-%dT%H:%M:%SZ"),
+ "home_team" : self.home_team,
+ "away_team" : self.away_team,
+ "votes" : self.votes,
+ "winner" : self.winner
+ }
+
+ @classmethod
+ def from_json(cls, data: dict):
+ return cls(data["message"], data["channel"], data["game_start"],
+ data["home_team"], data["away_team"], data["votes"], data["winner"])
\ No newline at end of file
diff --git a/hockey/standings.py b/hockey/standings.py
new file mode 100644
index 0000000..b26dd7a
--- /dev/null
+++ b/hockey/standings.py
@@ -0,0 +1,253 @@
+from datetime import datetime
+import aiohttp
+import discord
+from .constants import BASE_URL, TEAMS
+from .helper import hockey_config
+
+class Standings:
+ def __init__(self, name:str, division:str, conference:str, division_rank:int, conference_rank:int,
+ league_rank:int, wins:int, losses:int, ot:int, gp:int, pts:int, streak:int, streak_type:str,
+ goals:int, gaa:int, last_updated:str):
+ super().__init__()
+ self.name = name
+ self.division = division
+ self.conference = conference
+ self.division_rank = division_rank
+ self.conference_rank = conference_rank
+ self.league_rank = league_rank
+ self.wins = wins
+ self.losses = losses
+ self.ot = ot
+ self.gp = gp
+ self.pts = pts
+ self.streak = streak
+ self.streak_type = streak_type
+ self.goals = goals
+ self.gaa = gaa
+ self.last_updated = datetime.strptime(last_updated, "%Y-%m-%dT%H:%M:%SZ")
+
+
+ def to_json(self) -> dict:
+ return {
+ "team" : self.team,
+ "division": self.division_rank,
+ "conference" : self.conference_rank,
+ "division_rank" : self.division_rank,
+ "conference_rank" : self.conference_rank,
+ "league_rank" : self.league_rank,
+ "wins" : self.wins,
+ "losses" : self.losses,
+ "ot" : self.ot,
+ "gp" : self.gp,
+ "pts" : self.pts,
+ "streak" : self.streak,
+ "streak_type" : self.streak_type,
+ "goals" : self.goals,
+ "gaa" : self.gaa,
+ "last_updated": self.last_updated.strftime("%Y-%m-%dT%H:%M:%SZ"),
+
+ }
+
+
+
+ @staticmethod
+ async def get_team_standings(style):
+ """
+ Creates a list of standings when given a particular style
+ accepts Division names, Conference names, and Team names
+ returns a list of standings objects and the location of the given
+ style in the list
+ """
+ async with aiohttp.ClientSession() as session:
+ async with session.get(BASE_URL + "/api/v1/standings") as resp:
+ data = await resp.json()
+ conference = ["eastern", "western", "conference"]
+ division = ["metropolitan", "atlantic", "pacific", "central", "division"]
+ if style.lower() in conference:
+ e = [await Standings.from_json(team, record["division"]["name"], record["conference"]["name"])\
+ for record in data["records"] for team in record["teamRecords"] \
+ if record["conference"]["name"] =="Eastern"]
+ w = [await Standings.from_json(team, record["division"]["name"], record["conference"]["name"])\
+ for record in data["records"] for team in record["teamRecords"] \
+ if record["conference"]["name"] =="Western"]
+
+ index = 0
+ for div in [e, w]:
+ print(div[0].conference)
+ if div[0].conference.lower() == style and style != "conference":
+ index = [e, w].index(div)
+ return [e, w], index
+ if style.lower() in division:
+ new_list = []
+ for record in data["records"]:
+ new_list.append([await Standings.from_json(team, record["division"]["name"],\
+ record["conference"]["name"]) for team in record["teamRecords"]])
+ index = 0
+ for div in new_list:
+ if div[0].division.lower() == style and style != "division":
+ index = new_list.index(div)
+ return new_list, index
+ else:
+ all_teams = [await Standings.from_json(team, record["division"]["name"], record["conference"]["name"])\
+ for record in data["records"] for team in record["teamRecords"]]
+ index = 0
+ for team in all_teams:
+ if team.name.lower() == style:
+ index = all_teams.index(team)
+ return all_teams, index
+
+
+ @staticmethod
+ async def post_automatic_standings(bot):
+ """
+ Automatically update a standings embed with the latest stats
+ run when new games for the day is updated
+ """
+ print("Updating Standings.")
+ config = hockey_config()
+ all_guilds = await config.all_guilds()
+ for guilds in all_guilds:
+ guild = bot.get_guild(guilds)
+ if guild is None:
+ continue
+ print(guild.name)
+ if await config.guild(guild).post_standings():
+
+ search = await config.guild(guild).standings_type()
+ if search is None:
+ continue
+ standings_channel = await config.guild(guild).standings_channel()
+ if standings_channel is None:
+ continue
+ channel = bot.get_channel(standings_channel)
+ if channel is None:
+ continue
+ standings_msg = await config.guild(guild).standings_msg()
+ if standings_msg is None:
+ continue
+ message = await channel.get_message(standings_msg)
+
+ standings, page = await Standings.get_team_standings(search)
+ if search != "all":
+ em = await Standings.build_standing_embed(standings, page)
+ else:
+ em = await Standings.all_standing_embed(standings, page)
+ if message is not None:
+ await message.edit(embed=em)
+
+
+ @classmethod
+ async def from_json(cls, data: dict, division:str, conference:str):
+ if "streak" in data:
+ streak_number = data["streak"]["streakNumber"]
+ streak_type = data["streak"]["streakType"]
+ else:
+ streak_number = 0
+ streak_type = 0
+ return cls(data["team"]["name"],
+ division,
+ conference,
+ data["divisionRank"],
+ data["conferenceRank"],
+ data["leagueRank"],
+ data["leagueRecord"]["wins"],
+ data["leagueRecord"]["losses"],
+ data["leagueRecord"]["ot"],
+ data["gamesPlayed"],
+ data["points"],
+ streak_number,
+ streak_type,
+ data["goalsScored"],
+ data["goalsAgainst"],
+ data["lastUpdated"]
+ )
+
+ @staticmethod
+ async def all_standing_embed(post_standings, page=0):
+ """
+ Builds the standing embed when all TEAMS are selected
+ """
+ em = discord.Embed()
+ new_dict = {}
+ nhl_icon = "https://cdn.bleacherreport.net/images/team_logos/328x328/nhl.png"
+ latest_timestamp = post_standings[0].last_updated
+ for team in post_standings:
+ if team.division not in new_dict:
+ new_dict[team.division] = ""
+ emoji=TEAMS[team.name]["emoji"]
+ new_dict[team.division] += (f"{team.division_rank}. <:{emoji}> GP: **{team.gp}** "
+ f"W: **{team.wins}** L: **{team.losses}** OT: "
+ f"**{team.ot}** PTS: **{team.pts}**\n")
+ if team == post_standings[-1]:
+ new_dict[team.division] += "\nFrom: https://www.nhl.com/standings"
+ for div in new_dict:
+ em.add_field(name=f"{div} Division", value=new_dict[div])
+ em.set_author(name="NHL Standings", url="https://www.nhl.com/standings",
+ icon_url="https://cdn.bleacherreport.net/images/team_logos/328x328/nhl.png")
+ em.set_thumbnail(url=nhl_icon)
+ em.timestamp = latest_timestamp
+ em.set_footer(text="Stats Last Updated", icon_url=nhl_icon)
+ return em
+
+ @staticmethod
+ async def build_standing_embed(post_list, page=0):
+ """
+ Builds the standings type based on number of items in the list
+ """
+ team_stats = post_list[page]
+ em = discord.Embed()
+ if type(team_stats) is not list:
+ em.set_author(name="# {} {}".format(team_stats.league_rank, team_stats.name),
+ url="https://www.nhl.com/standings",
+ icon_url=TEAMS[team_stats.name]["logo"])
+ em.colour = int(TEAMS[team_stats.name]["home"].replace("#", ""), 16)
+ em.set_thumbnail(url=TEAMS[team_stats.name]["logo"])
+ em.add_field(name="Division", value="# " + team_stats.division_rank)
+ em.add_field(name="Conference", value="# " + team_stats.conference_rank)
+ em.add_field(name="Wins", value=team_stats.wins)
+ em.add_field(name="Losses", value=team_stats.losses)
+ em.add_field(name="OT", value=team_stats.ot)
+ em.add_field(name="Points", value=team_stats.pts)
+ em.add_field(name="Games Played", value=team_stats.gp)
+ em.add_field(name="Goals Scored", value=team_stats.goals)
+ em.add_field(name="Goals Against", value=team_stats.gaa)
+ em.add_field(name="Current Streak", value="{} {}".format(team_stats.streak, team_stats.streak_type))
+ # timestamp = datetime.strptime(team_stats.last_updated, "%Y-%m-%dT%H:%M:%SZ")
+ em.timestamp = team_stats.last_updated
+ em.set_footer(text="Stats last Updated", icon_url=TEAMS[team_stats.name]["logo"])
+ return em
+
+ msg = ""
+ # timestamp = datetime.strptime(team_stats[0].last_updated, "%Y-%m-%dT%H:%M:%SZ")
+ em.timestamp = team_stats[0].last_updated
+
+ if len(team_stats) <= 8:
+ for team in team_stats:
+ emoji=TEAMS[team.name]["emoji"]
+ msg += (f"{team.division_rank}. <:{emoji}> GP: **{team.gp}** "
+ f"W: **{team.wins}** L: **{team.losses}** OT: "
+ f"**{team.ot}** PTS: **{team.pts}**\n")
+ em.description = msg
+ division = team_stats[0].division
+ division_logo = TEAMS["Team {}".format(division)]["logo"]
+ em.colour = int(TEAMS["Team {}".format(division)]["home"].replace("#", ""), 16)
+ em.set_author(name=division + " Division", url="https://www.nhl.com/standings", icon_url=division_logo)
+ em.set_footer(text="Stats last Updated", icon_url=division_logo)
+ em.set_thumbnail(url=division_logo)
+ return em
+ if len(team_stats) > 8 and len(team_stats) <= 16:
+ newteam_stats = sorted(team_stats, key=lambda k: int(k.conference_rank))
+ for team in newteam_stats:
+ emoji=TEAMS[team.name]["emoji"]
+ msg += (f"{team.conference_rank}. <:{emoji}> GP: **{team.gp}** "
+ f"W: **{team.wins}** L: **{team.losses}** OT: "
+ f"**{team.ot}** PTS: **{team.pts}**\n")
+ em.description = msg
+ conference = team_stats[0].conference
+ em.colour = int("c41230", 16) if conference == "Eastern" else int("003e7e", 16)
+ logo = {"Eastern":"https://upload.wikimedia.org/wikipedia/en/thumb/1/16/NHL_Eastern_Conference.svg/1280px-NHL_Eastern_Conference.svg.png",
+ "Western":"https://upload.wikimedia.org/wikipedia/en/thumb/6/65/NHL_Western_Conference.svg/1280px-NHL_Western_Conference.svg.png"}
+ em.set_author(name=conference + " Conference", url="https://www.nhl.com/standings", icon_url=logo[conference])
+ em.set_thumbnail(url=logo[conference])
+ em.set_footer(text="Stats last Updated", icon_url=logo[conference])
+ return em
\ No newline at end of file
diff --git a/hockey/teamentry.py b/hockey/teamentry.py
new file mode 100644
index 0000000..3db3b2a
--- /dev/null
+++ b/hockey/teamentry.py
@@ -0,0 +1,27 @@
+class TeamEntry:
+ def __init__(self, game_state:str, team_name: str, period:int,
+ channel: list, goal_id: dict, created_channel:list, game_start:str):
+ super().__init__()
+ self.game_state = game_state
+ self.team_name = team_name
+ self.period = period
+ self.channel = channel
+ self.goal_id = goal_id
+ self.created_channel = created_channel
+ self.game_start = game_start
+
+ def to_json(self) -> dict:
+ return {
+ "team_name": self.team_name,
+ "game_state": self.game_state,
+ "channel": self.channel,
+ "period": self.period,
+ "created_channel": self.created_channel,
+ "game_start": self.game_start,
+ "goal_id": self.goal_id
+ }
+
+ @classmethod
+ def from_json(cls, data: dict):
+ return cls(data["team_name"], data["game_state"], data["game_start"],
+ data["channel"], data["period"], data["goal_id"], data["created_channel"])
\ No newline at end of file
diff --git a/hockey/testgame.json b/hockey/testgame.json
new file mode 100644
index 0000000..b353bc6
--- /dev/null
+++ b/hockey/testgame.json
@@ -0,0 +1,16288 @@
+{
+ "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.",
+ "gamePk" : 2018020287,
+ "link" : "/api/v1/game/2018020287/feed/live",
+ "metaData" : {
+ "wait" : 10,
+ "timeStamp" : "20181117_034650"
+ },
+ "gameData" : {
+ "game" : {
+ "pk" : 2018020287,
+ "season" : "20182019",
+ "type" : "R"
+ },
+ "datetime" : {
+ "dateTime" : "2018-11-17T01:00:00Z",
+ "endDateTime" : "2018-11-17T03:44:56Z"
+ },
+ "status" : {
+ "abstractGameState" : "Live",
+ "codedGameState" : "6",
+ "detailedState" : "Final",
+ "statusCode" : "6",
+ "startTimeTBD" : false
+ },
+ "teams" : {
+ "away" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "venue" : {
+ "id" : 5039,
+ "name" : "KeyBank Center",
+ "link" : "/api/v1/venues/5039",
+ "city" : "Buffalo",
+ "timeZone" : {
+ "id" : "America/New_York",
+ "offset" : -5,
+ "tz" : "EST"
+ }
+ },
+ "abbreviation" : "BUF",
+ "triCode" : "BUF",
+ "teamName" : "Sabres",
+ "locationName" : "Buffalo",
+ "firstYearOfPlay" : "1970",
+ "division" : {
+ "id" : 17,
+ "name" : "Atlantic",
+ "nameShort" : "ATL",
+ "link" : "/api/v1/divisions/17",
+ "abbreviation" : "A"
+ },
+ "conference" : {
+ "id" : 6,
+ "name" : "Eastern",
+ "link" : "/api/v1/conferences/6"
+ },
+ "franchise" : {
+ "franchiseId" : 19,
+ "teamName" : "Sabres",
+ "link" : "/api/v1/franchises/19"
+ },
+ "shortName" : "Buffalo",
+ "officialSiteUrl" : "http://www.sabres.com/",
+ "franchiseId" : 19,
+ "active" : true
+ },
+ "home" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "venue" : {
+ "id" : 5058,
+ "name" : "Bell MTS Place",
+ "link" : "/api/v1/venues/5058",
+ "city" : "Winnipeg",
+ "timeZone" : {
+ "id" : "America/Winnipeg",
+ "offset" : -6,
+ "tz" : "CST"
+ }
+ },
+ "abbreviation" : "WPG",
+ "triCode" : "WPG",
+ "teamName" : "Jets",
+ "locationName" : "Winnipeg",
+ "firstYearOfPlay" : "2011",
+ "division" : {
+ "id" : 16,
+ "name" : "Central",
+ "nameShort" : "CEN",
+ "link" : "/api/v1/divisions/16",
+ "abbreviation" : "C"
+ },
+ "conference" : {
+ "id" : 5,
+ "name" : "Western",
+ "link" : "/api/v1/conferences/5"
+ },
+ "franchise" : {
+ "franchiseId" : 35,
+ "teamName" : "Jets",
+ "link" : "/api/v1/franchises/35"
+ },
+ "shortName" : "Winnipeg",
+ "officialSiteUrl" : "http://winnipegjets.com/",
+ "franchiseId" : 35,
+ "active" : true
+ }
+ },
+ "players" : {
+ "ID8473618" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618",
+ "firstName" : "Mathieu",
+ "lastName" : "Perreault",
+ "primaryNumber" : "85",
+ "birthDate" : "1988-01-05",
+ "currentAge" : 30,
+ "birthCity" : "Drummondville",
+ "birthStateProvince" : "QC",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "5' 10\"",
+ "weight" : 188,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8471218" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218",
+ "firstName" : "Blake",
+ "lastName" : "Wheeler",
+ "primaryNumber" : "26",
+ "birthDate" : "1986-08-31",
+ "currentAge" : 32,
+ "birthCity" : "Plymouth",
+ "birthStateProvince" : "MN",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 5\"",
+ "weight" : 225,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : true,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ }
+ },
+ "ID8473534" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534",
+ "firstName" : "Patrik",
+ "lastName" : "Berglund",
+ "primaryNumber" : "10",
+ "birthDate" : "1988-06-02",
+ "currentAge" : 30,
+ "birthCity" : "Västerås",
+ "birthCountry" : "SWE",
+ "nationality" : "SWE",
+ "height" : "6' 4\"",
+ "weight" : 215,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476945" : {
+ "id" : 8476945,
+ "fullName" : "Connor Hellebuyck",
+ "link" : "/api/v1/people/8476945",
+ "firstName" : "Connor",
+ "lastName" : "Hellebuyck",
+ "primaryNumber" : "37",
+ "birthDate" : "1993-05-19",
+ "currentAge" : 25,
+ "birthCity" : "Commerce",
+ "birthStateProvince" : "MI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 4\"",
+ "weight" : 207,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ }
+ },
+ "ID8473412" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412",
+ "firstName" : "Bryan",
+ "lastName" : "Little",
+ "primaryNumber" : "18",
+ "birthDate" : "1987-11-12",
+ "currentAge" : 31,
+ "birthCity" : "Edmonton",
+ "birthStateProvince" : "AB",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 0\"",
+ "weight" : 191,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8477839" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839",
+ "firstName" : "Conor",
+ "lastName" : "Sheary",
+ "primaryNumber" : "43",
+ "birthDate" : "1992-06-08",
+ "currentAge" : 26,
+ "birthCity" : "Winchester",
+ "birthStateProvince" : "MA",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "5' 8\"",
+ "weight" : 176,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8474567" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567",
+ "firstName" : "Zach",
+ "lastName" : "Bogosian",
+ "primaryNumber" : "4",
+ "birthDate" : "1990-07-15",
+ "currentAge" : 28,
+ "birthCity" : "Massena",
+ "birthStateProvince" : "NY",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 3\"",
+ "weight" : 226,
+ "active" : true,
+ "alternateCaptain" : true,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8479999" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999",
+ "firstName" : "Casey",
+ "lastName" : "Mittelstadt",
+ "primaryNumber" : "37",
+ "birthDate" : "1998-11-22",
+ "currentAge" : 19,
+ "birthCity" : "Eden Prairie",
+ "birthStateProvince" : "MN",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 202,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8479339" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339",
+ "firstName" : "Patrik",
+ "lastName" : "Laine",
+ "primaryNumber" : "29",
+ "birthDate" : "1998-04-19",
+ "currentAge" : 20,
+ "birthCity" : "Tampere",
+ "birthCountry" : "FIN",
+ "nationality" : "FIN",
+ "height" : "6' 5\"",
+ "weight" : 206,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ }
+ },
+ "ID8477933" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933",
+ "firstName" : "Sam",
+ "lastName" : "Reinhart",
+ "primaryNumber" : "23",
+ "birthDate" : "1995-11-06",
+ "currentAge" : 23,
+ "birthCity" : "West Vancouver",
+ "birthStateProvince" : "BC",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 1\"",
+ "weight" : 192,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476476" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476",
+ "firstName" : "Joe",
+ "lastName" : "Morrow",
+ "primaryNumber" : "70",
+ "birthDate" : "1992-12-09",
+ "currentAge" : 25,
+ "birthCity" : "Edmonton",
+ "birthStateProvince" : "AB",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 0\"",
+ "weight" : 196,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8475784" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784",
+ "firstName" : "Jeff",
+ "lastName" : "Skinner",
+ "primaryNumber" : "53",
+ "birthDate" : "1992-05-16",
+ "currentAge" : 26,
+ "birthCity" : "Toronto",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "5' 11\"",
+ "weight" : 187,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8478458" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458",
+ "firstName" : "Jack",
+ "lastName" : "Roslovic",
+ "primaryNumber" : "28",
+ "birthDate" : "1997-01-29",
+ "currentAge" : 21,
+ "birthCity" : "Columbus",
+ "birthStateProvince" : "OH",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 187,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8474574" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574",
+ "firstName" : "Tyler",
+ "lastName" : "Myers",
+ "primaryNumber" : "57",
+ "birthDate" : "1990-02-01",
+ "currentAge" : 28,
+ "birthCity" : "Houston",
+ "birthStateProvince" : "TX",
+ "birthCountry" : "USA",
+ "nationality" : "CAN",
+ "height" : "6' 8\"",
+ "weight" : 229,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8477940" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940",
+ "firstName" : "Nikolaj",
+ "lastName" : "Ehlers",
+ "primaryNumber" : "27",
+ "birthDate" : "1996-02-14",
+ "currentAge" : 22,
+ "birthCity" : "Aalborg",
+ "birthCountry" : "DNK",
+ "nationality" : "DNK",
+ "height" : "6' 0\"",
+ "weight" : 172,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8477962" : {
+ "id" : 8477962,
+ "fullName" : "Brendan Lemieux",
+ "link" : "/api/v1/people/8477962",
+ "firstName" : "Brendan",
+ "lastName" : "Lemieux",
+ "primaryNumber" : "48",
+ "birthDate" : "1996-03-15",
+ "currentAge" : 22,
+ "birthCity" : "Denver",
+ "birthStateProvince" : "CO",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 210,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8477461" : {
+ "id" : 8477461,
+ "fullName" : "Remi Elie",
+ "link" : "/api/v1/people/8477461",
+ "firstName" : "Remi",
+ "lastName" : "Elie",
+ "primaryNumber" : "81",
+ "birthDate" : "1995-04-16",
+ "currentAge" : 23,
+ "birthCity" : "Cornwall",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 1\"",
+ "weight" : 215,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8479268" : {
+ "id" : 8479268,
+ "fullName" : "Casey Nelson",
+ "link" : "/api/v1/people/8479268",
+ "firstName" : "Casey",
+ "lastName" : "Nelson",
+ "primaryNumber" : "8",
+ "birthDate" : "1992-07-18",
+ "currentAge" : 26,
+ "birthCity" : "Wisconsin Rapids",
+ "birthStateProvince" : "WI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 185,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8477464" : {
+ "id" : 8477464,
+ "fullName" : "Nic Petan",
+ "link" : "/api/v1/people/8477464",
+ "firstName" : "Nic",
+ "lastName" : "Petan",
+ "primaryNumber" : "19",
+ "birthDate" : "1995-03-22",
+ "currentAge" : 23,
+ "birthCity" : "Delta",
+ "birthStateProvince" : "BC",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "5' 9\"",
+ "weight" : 179,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8479420" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420",
+ "firstName" : "Tage",
+ "lastName" : "Thompson",
+ "primaryNumber" : "72",
+ "birthDate" : "1997-10-30",
+ "currentAge" : 21,
+ "birthCity" : "Phoenix",
+ "birthStateProvince" : "AZ",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 6\"",
+ "weight" : 205,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ }
+ },
+ "ID8478398" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398",
+ "firstName" : "Kyle",
+ "lastName" : "Connor",
+ "primaryNumber" : "81",
+ "birthDate" : "1996-12-09",
+ "currentAge" : 21,
+ "birthCity" : "Shelby Twp.",
+ "birthStateProvince" : "MI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 182,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8476392" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392",
+ "firstName" : "Adam",
+ "lastName" : "Lowry",
+ "primaryNumber" : "17",
+ "birthDate" : "1993-03-29",
+ "currentAge" : 25,
+ "birthCity" : "St. Louis",
+ "birthStateProvince" : "MO",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 5\"",
+ "weight" : 210,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476470" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470",
+ "firstName" : "Nathan",
+ "lastName" : "Beaulieu",
+ "primaryNumber" : "82",
+ "birthDate" : "1992-12-05",
+ "currentAge" : 25,
+ "birthCity" : "Strathroy",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 2\"",
+ "weight" : 200,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8480005" : {
+ "id" : 8480005,
+ "fullName" : "Kristian Vesalainen",
+ "link" : "/api/v1/people/8480005",
+ "firstName" : "Kristian",
+ "lastName" : "Vesalainen",
+ "primaryNumber" : "93",
+ "birthDate" : "1999-06-01",
+ "currentAge" : 19,
+ "birthCity" : "Helsinki",
+ "birthCountry" : "FIN",
+ "nationality" : "FIN",
+ "height" : "6' 3\"",
+ "weight" : 207,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "N",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8469506" : {
+ "id" : 8469506,
+ "fullName" : "Jason Pominville",
+ "link" : "/api/v1/people/8469506",
+ "firstName" : "Jason",
+ "lastName" : "Pominville",
+ "primaryNumber" : "29",
+ "birthDate" : "1982-11-30",
+ "currentAge" : 35,
+ "birthCity" : "Repentigny",
+ "birthStateProvince" : "QC",
+ "birthCountry" : "CAN",
+ "nationality" : "USA",
+ "height" : "5' 11\"",
+ "weight" : 180,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ }
+ },
+ "ID8470834" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834",
+ "firstName" : "Dustin",
+ "lastName" : "Byfuglien",
+ "primaryNumber" : "33",
+ "birthDate" : "1985-03-27",
+ "currentAge" : 33,
+ "birthCity" : "Roseau",
+ "birthStateProvince" : "MN",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 5\"",
+ "weight" : 260,
+ "active" : true,
+ "alternateCaptain" : true,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8475728" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728",
+ "firstName" : "Johan",
+ "lastName" : "Larsson",
+ "primaryNumber" : "22",
+ "birthDate" : "1992-07-25",
+ "currentAge" : 26,
+ "birthCity" : "Lau",
+ "birthCountry" : "SWE",
+ "nationality" : "SWE",
+ "height" : "5' 11\"",
+ "weight" : 202,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8474618" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618",
+ "firstName" : "Marco",
+ "lastName" : "Scandella",
+ "primaryNumber" : "6",
+ "birthDate" : "1990-02-23",
+ "currentAge" : 28,
+ "birthCity" : "Montreal",
+ "birthStateProvince" : "QC",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 3\"",
+ "weight" : 210,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8478915" : {
+ "id" : 8478915,
+ "fullName" : "Sami Niku",
+ "link" : "/api/v1/people/8478915",
+ "firstName" : "Sami",
+ "lastName" : "Niku",
+ "primaryNumber" : "83",
+ "birthDate" : "1996-10-10",
+ "currentAge" : 22,
+ "birthCity" : "Haapavesi",
+ "birthCountry" : "FIN",
+ "nationality" : "FIN",
+ "height" : "6' 1\"",
+ "weight" : 176,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8477429" : {
+ "id" : 8477429,
+ "fullName" : "Andrew Copp",
+ "link" : "/api/v1/people/8477429",
+ "firstName" : "Andrew",
+ "lastName" : "Copp",
+ "primaryNumber" : "9",
+ "birthDate" : "1994-07-08",
+ "currentAge" : 24,
+ "birthCity" : "Ann Arbor",
+ "birthStateProvince" : "MI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 206,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476931" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931",
+ "firstName" : "Jake",
+ "lastName" : "McCabe",
+ "primaryNumber" : "19",
+ "birthDate" : "1993-10-12",
+ "currentAge" : 25,
+ "birthCity" : "Eau Claire",
+ "birthStateProvince" : "WI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 1\"",
+ "weight" : 206,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8473449" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449",
+ "firstName" : "Kyle",
+ "lastName" : "Okposo",
+ "primaryNumber" : "21",
+ "birthDate" : "1988-04-16",
+ "currentAge" : 30,
+ "birthCity" : "St. Paul",
+ "birthStateProvince" : "MN",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 0\"",
+ "weight" : 219,
+ "active" : true,
+ "alternateCaptain" : true,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ }
+ },
+ "ID8475622" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622",
+ "firstName" : "Carter",
+ "lastName" : "Hutton",
+ "primaryNumber" : "40",
+ "birthDate" : "1985-12-19",
+ "currentAge" : 32,
+ "birthCity" : "Thunder Bay",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 0\"",
+ "weight" : 198,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ }
+ },
+ "ID8476316" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316",
+ "firstName" : "Laurent",
+ "lastName" : "Brossoit",
+ "primaryNumber" : "30",
+ "birthDate" : "1993-03-23",
+ "currentAge" : 25,
+ "birthCity" : "Port Alberni",
+ "birthStateProvince" : "BC",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 3\"",
+ "weight" : 204,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ }
+ },
+ "ID8471743" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743",
+ "firstName" : "Vladimir",
+ "lastName" : "Sobotka",
+ "primaryNumber" : "17",
+ "birthDate" : "1987-07-02",
+ "currentAge" : 31,
+ "birthCity" : "Trebic",
+ "birthCountry" : "CZE",
+ "nationality" : "CZE",
+ "height" : "5' 11\"",
+ "weight" : 189,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476878" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878",
+ "firstName" : "Zemgus",
+ "lastName" : "Girgensons",
+ "primaryNumber" : "28",
+ "birthDate" : "1994-01-05",
+ "currentAge" : 24,
+ "birthCity" : "Riga",
+ "birthCountry" : "LVA",
+ "nationality" : "LVA",
+ "height" : "6' 2\"",
+ "weight" : 211,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8476999" : {
+ "id" : 8476999,
+ "fullName" : "Linus Ullmark",
+ "link" : "/api/v1/people/8476999",
+ "firstName" : "Linus",
+ "lastName" : "Ullmark",
+ "primaryNumber" : "35",
+ "birthDate" : "1993-07-31",
+ "currentAge" : 25,
+ "birthCity" : "Lugnvik",
+ "birthCountry" : "SWE",
+ "nationality" : "SWE",
+ "height" : "6' 4\"",
+ "weight" : 213,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ }
+ },
+ "ID8477504" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504",
+ "firstName" : "Josh",
+ "lastName" : "Morrissey",
+ "primaryNumber" : "44",
+ "birthDate" : "1995-03-28",
+ "currentAge" : 23,
+ "birthCity" : "Calgary",
+ "birthStateProvince" : "AB",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 0\"",
+ "weight" : 195,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8477499" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499",
+ "firstName" : "Rasmus",
+ "lastName" : "Ristolainen",
+ "primaryNumber" : "55",
+ "birthDate" : "1994-10-27",
+ "currentAge" : 24,
+ "birthCity" : "Turku",
+ "birthCountry" : "FIN",
+ "nationality" : "FIN",
+ "height" : "6' 4\"",
+ "weight" : 215,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8478403" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403",
+ "firstName" : "Jack",
+ "lastName" : "Eichel",
+ "primaryNumber" : "9",
+ "birthDate" : "1996-10-28",
+ "currentAge" : 22,
+ "birthCity" : "North Chelmsford",
+ "birthStateProvince" : "MA",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 2\"",
+ "weight" : 200,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : true,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8475279" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279",
+ "firstName" : "Ben",
+ "lastName" : "Chiarot",
+ "primaryNumber" : "7",
+ "birthDate" : "1991-05-09",
+ "currentAge" : 27,
+ "birthCity" : "Hamilton",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 3\"",
+ "weight" : 219,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8476885" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885",
+ "firstName" : "Jacob",
+ "lastName" : "Trouba",
+ "primaryNumber" : "8",
+ "birthDate" : "1994-02-26",
+ "currentAge" : 24,
+ "birthCity" : "Rochester",
+ "birthStateProvince" : "MI",
+ "birthCountry" : "USA",
+ "nationality" : "USA",
+ "height" : "6' 3\"",
+ "weight" : 202,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8476460" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460",
+ "firstName" : "Mark",
+ "lastName" : "Scheifele",
+ "primaryNumber" : "55",
+ "birthDate" : "1993-03-15",
+ "currentAge" : 25,
+ "birthCity" : "Kitchener",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 3\"",
+ "weight" : 207,
+ "active" : true,
+ "alternateCaptain" : true,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ }
+ },
+ "ID8478542" : {
+ "id" : 8478542,
+ "fullName" : "Evan Rodrigues",
+ "link" : "/api/v1/people/8478542",
+ "firstName" : "Evan",
+ "lastName" : "Rodrigues",
+ "primaryNumber" : "71",
+ "birthDate" : "1993-07-28",
+ "currentAge" : 25,
+ "birthCity" : "Toronto",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "5' 10\"",
+ "weight" : 176,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ },
+ "ID8480839" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839",
+ "firstName" : "Rasmus",
+ "lastName" : "Dahlin",
+ "primaryNumber" : "26",
+ "birthDate" : "2000-04-13",
+ "currentAge" : 18,
+ "birthCity" : "Trollhattan",
+ "birthCountry" : "SWE",
+ "nationality" : "SWE",
+ "height" : "6' 3\"",
+ "weight" : 190,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : true,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ },
+ "primaryPosition" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ }
+ },
+ "ID8479293" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293",
+ "firstName" : "Brandon",
+ "lastName" : "Tanev",
+ "primaryNumber" : "13",
+ "birthDate" : "1991-12-31",
+ "currentAge" : 26,
+ "birthCity" : "Toronto",
+ "birthStateProvince" : "ON",
+ "birthCountry" : "CAN",
+ "nationality" : "CAN",
+ "height" : "6' 0\"",
+ "weight" : 180,
+ "active" : true,
+ "alternateCaptain" : false,
+ "captain" : false,
+ "rookie" : false,
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y",
+ "currentTeam" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ },
+ "primaryPosition" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ }
+ }
+ },
+ "venue" : {
+ "id" : 5058,
+ "name" : "Bell MTS Place",
+ "link" : "/api/v1/venues/5058"
+ }
+ },
+ "liveData" : {
+ "plays" : {
+ "allPlays" : [ {
+ "result" : {
+ "event" : "Game Scheduled",
+ "eventCode" : "WPG1",
+ "eventTypeId" : "GAME_SCHEDULED",
+ "description" : "Game Scheduled"
+ },
+ "about" : {
+ "eventIdx" : 0,
+ "eventId" : 1,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T00:15:19Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Ready",
+ "eventCode" : "WPG5",
+ "eventTypeId" : "PERIOD_READY",
+ "description" : "Period Ready"
+ },
+ "about" : {
+ "eventIdx" : 1,
+ "eventId" : 5,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T01:07:43Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Start",
+ "eventCode" : "WPG51",
+ "eventTypeId" : "PERIOD_START",
+ "description" : "Period Start"
+ },
+ "about" : {
+ "eventIdx" : 2,
+ "eventId" : 51,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T01:07:48Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG52",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Vladimir Sobotka faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 3,
+ "eventId" : 52,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T01:07:48Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG8",
+ "eventTypeId" : "STOP",
+ "description" : "Offside"
+ },
+ "about" : {
+ "eventIdx" : 4,
+ "eventId" : 8,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:05",
+ "periodTimeRemaining" : "19:55",
+ "dateTime" : "2018-11-17T01:08:17Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG53",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 5,
+ "eventId" : 53,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:05",
+ "periodTimeRemaining" : "19:55",
+ "dateTime" : "2018-11-17T01:08:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 20.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG9",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Carter Hutton"
+ },
+ "about" : {
+ "eventIdx" : 6,
+ "eventId" : 9,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:29",
+ "periodTimeRemaining" : "19:31",
+ "dateTime" : "2018-11-17T01:09:02Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -32.0,
+ "y" : 39.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG10",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Zach Bogosian"
+ },
+ "about" : {
+ "eventIdx" : 7,
+ "eventId" : 10,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:41",
+ "periodTimeRemaining" : "19:19",
+ "dateTime" : "2018-11-17T01:09:14Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -43.0,
+ "y" : 39.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG54",
+ "eventTypeId" : "SHOT",
+ "description" : "Joe Morrow Slap Shot saved by Carter Hutton",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 8,
+ "eventId" : 54,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:47",
+ "periodTimeRemaining" : "19:13",
+ "dateTime" : "2018-11-17T01:09:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -30.0,
+ "y" : -33.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG11",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 9,
+ "eventId" : 11,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:48",
+ "periodTimeRemaining" : "19:12",
+ "dateTime" : "2018-11-17T01:09:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG55",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Zemgus Girgensons"
+ },
+ "about" : {
+ "eventIdx" : 10,
+ "eventId" : 55,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:48",
+ "periodTimeRemaining" : "19:12",
+ "dateTime" : "2018-11-17T01:09:32Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG56",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Dustin Byfuglien - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 11,
+ "eventId" : 56,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "00:53",
+ "periodTimeRemaining" : "19:07",
+ "dateTime" : "2018-11-17T01:10:05Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -34.0,
+ "y" : 20.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG12",
+ "eventTypeId" : "HIT",
+ "description" : "Patrik Laine hit Tage Thompson"
+ },
+ "about" : {
+ "eventIdx" : 12,
+ "eventId" : 12,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "01:20",
+ "periodTimeRemaining" : "18:40",
+ "dateTime" : "2018-11-17T01:10:32Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 14.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG57",
+ "eventTypeId" : "SHOT",
+ "description" : "Tage Thompson Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 13,
+ "eventId" : 57,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "01:31",
+ "periodTimeRemaining" : "18:29",
+ "dateTime" : "2018-11-17T01:10:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 33.0,
+ "y" : 19.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG13",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 14,
+ "eventId" : 13,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "01:32",
+ "periodTimeRemaining" : "18:28",
+ "dateTime" : "2018-11-17T01:10:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG58",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Blake Wheeler faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 15,
+ "eventId" : 58,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "01:32",
+ "periodTimeRemaining" : "18:28",
+ "dateTime" : "2018-11-17T01:10:54Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG59",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Casey Mittelstadt - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 16,
+ "eventId" : 59,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "02:41",
+ "periodTimeRemaining" : "17:19",
+ "dateTime" : "2018-11-17T01:12:37Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 48.0,
+ "y" : 24.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG60",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Zach Bogosian - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 17,
+ "eventId" : 60,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "02:48",
+ "periodTimeRemaining" : "17:12",
+ "dateTime" : "2018-11-17T01:12:44Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 85.0,
+ "y" : -10.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG14",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Ben Chiarot"
+ },
+ "about" : {
+ "eventIdx" : 18,
+ "eventId" : 14,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "03:34",
+ "periodTimeRemaining" : "16:26",
+ "dateTime" : "2018-11-17T01:13:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 42.0,
+ "y" : 41.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG15",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Laurent Brossoit"
+ },
+ "about" : {
+ "eventIdx" : 19,
+ "eventId" : 15,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "03:52",
+ "periodTimeRemaining" : "16:08",
+ "dateTime" : "2018-11-17T01:13:48Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 73.0,
+ "y" : -41.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG16",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 20,
+ "eventId" : 16,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:09",
+ "periodTimeRemaining" : "15:51",
+ "dateTime" : "2018-11-17T01:14:05Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 55.0,
+ "y" : 39.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG61",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Patrik Berglund - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 21,
+ "eventId" : 61,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:10",
+ "periodTimeRemaining" : "15:50",
+ "dateTime" : "2018-11-17T01:14:06Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : 8.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG21",
+ "eventTypeId" : "HIT",
+ "description" : "Dustin Byfuglien hit Patrik Berglund"
+ },
+ "about" : {
+ "eventIdx" : 22,
+ "eventId" : 21,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:11",
+ "periodTimeRemaining" : "15:49",
+ "dateTime" : "2018-11-17T01:16:14Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : 2.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477429,
+ "fullName" : "Andrew Copp",
+ "link" : "/api/v1/people/8477429"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG17",
+ "eventTypeId" : "HIT",
+ "description" : "Andrew Copp hit Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 23,
+ "eventId" : 17,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:16",
+ "periodTimeRemaining" : "15:44",
+ "dateTime" : "2018-11-17T01:14:12Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 88.0,
+ "y" : -39.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG18",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Rasmus Dahlin"
+ },
+ "about" : {
+ "eventIdx" : 24,
+ "eventId" : 18,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:32",
+ "periodTimeRemaining" : "15:28",
+ "dateTime" : "2018-11-17T01:14:42Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -18.0,
+ "y" : 26.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG62",
+ "eventTypeId" : "SHOT",
+ "description" : "Mark Scheifele Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 25,
+ "eventId" : 62,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "04:40",
+ "periodTimeRemaining" : "15:20",
+ "dateTime" : "2018-11-17T01:14:36Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -56.0,
+ "y" : 19.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG19",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 26,
+ "eventId" : 19,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:24",
+ "periodTimeRemaining" : "14:36",
+ "dateTime" : "2018-11-17T01:15:20Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG63",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Blake Wheeler faceoff won against Casey Mittelstadt"
+ },
+ "about" : {
+ "eventIdx" : 27,
+ "eventId" : 63,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:24",
+ "periodTimeRemaining" : "14:36",
+ "dateTime" : "2018-11-17T01:15:32Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG64",
+ "eventTypeId" : "SHOT",
+ "description" : "Blake Wheeler Slap Shot saved by Carter Hutton",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 28,
+ "eventId" : 64,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:37",
+ "periodTimeRemaining" : "14:23",
+ "dateTime" : "2018-11-17T01:16:09Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -65.0,
+ "y" : 31.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG20",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 29,
+ "eventId" : 20,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:38",
+ "periodTimeRemaining" : "14:22",
+ "dateTime" : "2018-11-17T01:16:09Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG65",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Johan Larsson faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 30,
+ "eventId" : 65,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:38",
+ "periodTimeRemaining" : "14:22",
+ "dateTime" : "2018-11-17T01:16:23Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG66",
+ "eventTypeId" : "SHOT",
+ "description" : "Josh Morrissey Slap Shot saved by Carter Hutton",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 31,
+ "eventId" : 66,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:49",
+ "periodTimeRemaining" : "14:11",
+ "dateTime" : "2018-11-17T01:16:46Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -37.0,
+ "y" : -29.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG22",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 32,
+ "eventId" : 22,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:50",
+ "periodTimeRemaining" : "14:10",
+ "dateTime" : "2018-11-17T01:16:47Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG67",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Zemgus Girgensons"
+ },
+ "about" : {
+ "eventIdx" : 33,
+ "eventId" : 67,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "05:50",
+ "periodTimeRemaining" : "14:10",
+ "dateTime" : "2018-11-17T01:16:56Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG23",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 34,
+ "eventId" : 23,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "06:10",
+ "periodTimeRemaining" : "13:50",
+ "dateTime" : "2018-11-17T01:17:37Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG68",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Johan Larsson faceoff won against Jack Roslovic"
+ },
+ "about" : {
+ "eventIdx" : 35,
+ "eventId" : 68,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "06:10",
+ "periodTimeRemaining" : "13:50",
+ "dateTime" : "2018-11-17T01:17:43Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG24",
+ "eventTypeId" : "HIT",
+ "description" : "Johan Larsson hit Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 36,
+ "eventId" : 24,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "06:18",
+ "periodTimeRemaining" : "13:42",
+ "dateTime" : "2018-11-17T01:18:09Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -92.0,
+ "y" : -38.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG25",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Crowd"
+ },
+ "about" : {
+ "eventIdx" : 37,
+ "eventId" : 25,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "06:37",
+ "periodTimeRemaining" : "13:23",
+ "dateTime" : "2018-11-17T01:18:29Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG69",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Casey Mittelstadt"
+ },
+ "about" : {
+ "eventIdx" : 38,
+ "eventId" : 69,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "06:37",
+ "periodTimeRemaining" : "13:23",
+ "dateTime" : "2018-11-17T01:20:33Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -20.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG70",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Dustin Byfuglien - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 39,
+ "eventId" : 70,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:07",
+ "periodTimeRemaining" : "12:53",
+ "dateTime" : "2018-11-17T01:21:14Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -71.0,
+ "y" : 21.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG71",
+ "eventTypeId" : "SHOT",
+ "description" : "Dustin Byfuglien Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 40,
+ "eventId" : 71,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:14",
+ "periodTimeRemaining" : "12:46",
+ "dateTime" : "2018-11-17T01:21:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -79.0,
+ "y" : -13.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG72",
+ "eventTypeId" : "SHOT",
+ "description" : "Dustin Byfuglien Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 41,
+ "eventId" : 72,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:21",
+ "periodTimeRemaining" : "12:39",
+ "dateTime" : "2018-11-17T01:21:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -75.0,
+ "y" : -3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG75",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Conor Sheary blocked shot from Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 42,
+ "eventId" : 75,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:26",
+ "periodTimeRemaining" : "12:34",
+ "dateTime" : "2018-11-17T01:21:39Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -72.0,
+ "y" : 18.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG26",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Casey Mittelstadt"
+ },
+ "about" : {
+ "eventIdx" : 43,
+ "eventId" : 26,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:51",
+ "periodTimeRemaining" : "12:09",
+ "dateTime" : "2018-11-17T01:21:58Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -75.0,
+ "y" : 14.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG76",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Rasmus Dahlin blocked shot from Nikolaj Ehlers"
+ },
+ "about" : {
+ "eventIdx" : 44,
+ "eventId" : 76,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "07:58",
+ "periodTimeRemaining" : "12:02",
+ "dateTime" : "2018-11-17T01:22:04Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -71.0,
+ "y" : -21.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG77",
+ "eventTypeId" : "SHOT",
+ "description" : "Nikolaj Ehlers Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 45,
+ "eventId" : 77,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:06",
+ "periodTimeRemaining" : "11:54",
+ "dateTime" : "2018-11-17T01:22:12Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -73.0,
+ "y" : -8.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG78",
+ "eventTypeId" : "SHOT",
+ "description" : "Mark Scheifele Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 46,
+ "eventId" : 78,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:14",
+ "periodTimeRemaining" : "11:46",
+ "dateTime" : "2018-11-17T01:22:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -82.0,
+ "y" : 8.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG27",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 47,
+ "eventId" : 27,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:15",
+ "periodTimeRemaining" : "11:45",
+ "dateTime" : "2018-11-17T01:22:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG79",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 48,
+ "eventId" : 79,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:15",
+ "periodTimeRemaining" : "11:45",
+ "dateTime" : "2018-11-17T01:22:51Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG28",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Crowd"
+ },
+ "about" : {
+ "eventIdx" : 49,
+ "eventId" : 28,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:35",
+ "periodTimeRemaining" : "11:25",
+ "dateTime" : "2018-11-17T01:23:19Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG80",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Sam Reinhart"
+ },
+ "about" : {
+ "eventIdx" : 50,
+ "eventId" : 80,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "08:35",
+ "periodTimeRemaining" : "11:25",
+ "dateTime" : "2018-11-17T01:23:31Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 20.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG81",
+ "eventTypeId" : "SHOT",
+ "description" : "Adam Lowry Tip-In saved by Carter Hutton",
+ "secondaryType" : "Tip-In"
+ },
+ "about" : {
+ "eventIdx" : 51,
+ "eventId" : 81,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "09:12",
+ "periodTimeRemaining" : "10:48",
+ "dateTime" : "2018-11-17T01:24:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -23.0,
+ "y" : -24.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG29",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Kyle Okposo"
+ },
+ "about" : {
+ "eventIdx" : 52,
+ "eventId" : 29,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "09:43",
+ "periodTimeRemaining" : "10:17",
+ "dateTime" : "2018-11-17T01:24:55Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -62.0,
+ "y" : 29.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG82",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Jake McCabe blocked shot from Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 53,
+ "eventId" : 82,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "09:45",
+ "periodTimeRemaining" : "10:15",
+ "dateTime" : "2018-11-17T01:24:55Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -60.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG83",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Tyler Myers - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 54,
+ "eventId" : 83,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "09:51",
+ "periodTimeRemaining" : "10:09",
+ "dateTime" : "2018-11-17T01:25:01Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -43.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG30",
+ "eventTypeId" : "HIT",
+ "description" : "Jake McCabe hit Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 55,
+ "eventId" : 30,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "09:57",
+ "periodTimeRemaining" : "10:03",
+ "dateTime" : "2018-11-17T01:25:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -64.0,
+ "y" : 2.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG32",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 56,
+ "eventId" : 32,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:19",
+ "periodTimeRemaining" : "08:41",
+ "dateTime" : "2018-11-17T01:26:29Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG84",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 57,
+ "eventId" : 84,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:19",
+ "periodTimeRemaining" : "08:41",
+ "dateTime" : "2018-11-17T01:26:48Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG33",
+ "eventTypeId" : "HIT",
+ "description" : "Blake Wheeler hit Patrik Berglund"
+ },
+ "about" : {
+ "eventIdx" : 58,
+ "eventId" : 33,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:32",
+ "periodTimeRemaining" : "08:28",
+ "dateTime" : "2018-11-17T01:27:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -48.0,
+ "y" : 40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG34",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 59,
+ "eventId" : 34,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:41",
+ "periodTimeRemaining" : "08:19",
+ "dateTime" : "2018-11-17T01:27:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -54.0,
+ "y" : -36.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG85",
+ "eventTypeId" : "SHOT",
+ "description" : "Ben Chiarot Snap Shot saved by Carter Hutton",
+ "secondaryType" : "Snap Shot"
+ },
+ "about" : {
+ "eventIdx" : 60,
+ "eventId" : 85,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:44",
+ "periodTimeRemaining" : "08:16",
+ "dateTime" : "2018-11-17T01:27:26Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -33.0,
+ "y" : 1.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG35",
+ "eventTypeId" : "STOP",
+ "description" : "TV timeout"
+ },
+ "about" : {
+ "eventIdx" : 61,
+ "eventId" : 35,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:45",
+ "periodTimeRemaining" : "08:15",
+ "dateTime" : "2018-11-17T01:27:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG86",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Blake Wheeler faceoff won against Sam Reinhart"
+ },
+ "about" : {
+ "eventIdx" : 62,
+ "eventId" : 86,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "11:45",
+ "periodTimeRemaining" : "08:15",
+ "dateTime" : "2018-11-17T01:28:56Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG36",
+ "eventTypeId" : "HIT",
+ "description" : "Ben Chiarot hit Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 63,
+ "eventId" : 36,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:00",
+ "periodTimeRemaining" : "08:00",
+ "dateTime" : "2018-11-17T01:30:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 41.0,
+ "y" : -41.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "PenaltyOn"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "DrewBy"
+ } ],
+ "result" : {
+ "event" : "Penalty",
+ "eventCode" : "WPG37",
+ "eventTypeId" : "PENALTY",
+ "description" : "Nikolaj Ehlers Tripping against Jack Eichel",
+ "secondaryType" : "Tripping",
+ "penaltySeverity" : "Minor",
+ "penaltyMinutes" : 2
+ },
+ "about" : {
+ "eventIdx" : 64,
+ "eventId" : 37,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:19",
+ "periodTimeRemaining" : "07:41",
+ "dateTime" : "2018-11-17T01:30:37Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 66.0,
+ "y" : 4.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG87",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Patrik Berglund faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 65,
+ "eventId" : 87,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:19",
+ "periodTimeRemaining" : "07:41",
+ "dateTime" : "2018-11-17T01:31:06Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG88",
+ "eventTypeId" : "SHOT",
+ "description" : "Jeff Skinner Slap Shot saved by Laurent Brossoit",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 66,
+ "eventId" : 88,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:27",
+ "periodTimeRemaining" : "07:33",
+ "dateTime" : "2018-11-17T01:31:24Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 45.0,
+ "y" : -33.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG89",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Jacob Trouba blocked shot from Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 67,
+ "eventId" : 89,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:33",
+ "periodTimeRemaining" : "07:27",
+ "dateTime" : "2018-11-17T01:31:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : 34.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG90",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Adam Lowry blocked shot from Rasmus Dahlin"
+ },
+ "about" : {
+ "eventIdx" : 68,
+ "eventId" : 90,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "12:45",
+ "periodTimeRemaining" : "07:15",
+ "dateTime" : "2018-11-17T01:31:42Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 41.0,
+ "y" : -11.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "PenaltyOn"
+ }, {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "DrewBy"
+ } ],
+ "result" : {
+ "event" : "Penalty",
+ "eventCode" : "WPG39",
+ "eventTypeId" : "PENALTY",
+ "description" : "Patrik Berglund Hooking against Jacob Trouba",
+ "secondaryType" : "Hooking",
+ "penaltySeverity" : "Minor",
+ "penaltyMinutes" : 2
+ },
+ "about" : {
+ "eventIdx" : 69,
+ "eventId" : 39,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "13:10",
+ "periodTimeRemaining" : "06:50",
+ "dateTime" : "2018-11-17T01:32:15Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 67.0,
+ "y" : 3.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG91",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Conor Sheary faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 70,
+ "eventId" : 91,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "13:10",
+ "periodTimeRemaining" : "06:50",
+ "dateTime" : "2018-11-17T01:32:39Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG92",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Dustin Byfuglien blocked shot from Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 71,
+ "eventId" : 92,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "14:07",
+ "periodTimeRemaining" : "05:53",
+ "dateTime" : "2018-11-17T01:34:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 46.0,
+ "y" : -25.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG93",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Dustin Byfuglien blocked shot from Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 72,
+ "eventId" : 93,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "14:16",
+ "periodTimeRemaining" : "05:44",
+ "dateTime" : "2018-11-17T01:34:31Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : -28.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG41",
+ "eventTypeId" : "HIT",
+ "description" : "Marco Scandella hit Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 73,
+ "eventId" : 41,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "15:01",
+ "periodTimeRemaining" : "04:59",
+ "dateTime" : "2018-11-17T01:35:23Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -65.0,
+ "y" : 40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG94",
+ "eventTypeId" : "SHOT",
+ "description" : "Rasmus Dahlin Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 74,
+ "eventId" : 94,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "15:34",
+ "periodTimeRemaining" : "04:26",
+ "dateTime" : "2018-11-17T01:35:49Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 51.0,
+ "y" : 12.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG42",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 75,
+ "eventId" : 42,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "15:35",
+ "periodTimeRemaining" : "04:25",
+ "dateTime" : "2018-11-17T01:35:50Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG95",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Jeff Skinner"
+ },
+ "about" : {
+ "eventIdx" : 76,
+ "eventId" : 95,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "15:35",
+ "periodTimeRemaining" : "04:25",
+ "dateTime" : "2018-11-17T01:37:58Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG96",
+ "eventTypeId" : "SHOT",
+ "description" : "Brandon Tanev Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 77,
+ "eventId" : 96,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "15:48",
+ "periodTimeRemaining" : "04:12",
+ "dateTime" : "2018-11-17T01:38:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -68.0,
+ "y" : 16.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG43",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Josh Morrissey"
+ },
+ "about" : {
+ "eventIdx" : 78,
+ "eventId" : 43,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:05",
+ "periodTimeRemaining" : "03:55",
+ "dateTime" : "2018-11-17T01:38:41Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG44",
+ "eventTypeId" : "HIT",
+ "description" : "Jack Eichel hit Brandon Tanev"
+ },
+ "about" : {
+ "eventIdx" : 79,
+ "eventId" : 44,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:11",
+ "periodTimeRemaining" : "03:49",
+ "dateTime" : "2018-11-17T01:38:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 32.0,
+ "y" : 40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG45",
+ "eventTypeId" : "HIT",
+ "description" : "Kyle Okposo hit Joe Morrow"
+ },
+ "about" : {
+ "eventIdx" : 80,
+ "eventId" : 45,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:41",
+ "periodTimeRemaining" : "03:19",
+ "dateTime" : "2018-11-17T01:39:15Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 2.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG46",
+ "eventTypeId" : "STOP",
+ "description" : "Puck Frozen"
+ },
+ "about" : {
+ "eventIdx" : 81,
+ "eventId" : 46,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:43",
+ "periodTimeRemaining" : "03:17",
+ "dateTime" : "2018-11-17T01:39:18Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG97",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Vladimir Sobotka faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 82,
+ "eventId" : 97,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:43",
+ "periodTimeRemaining" : "03:17",
+ "dateTime" : "2018-11-17T01:39:44Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG98",
+ "eventTypeId" : "SHOT",
+ "description" : "Vladimir Sobotka Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 83,
+ "eventId" : 98,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "16:53",
+ "periodTimeRemaining" : "03:07",
+ "dateTime" : "2018-11-17T01:39:59Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 38.0,
+ "y" : -21.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG47",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 84,
+ "eventId" : 47,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "18:30",
+ "periodTimeRemaining" : "01:30",
+ "dateTime" : "2018-11-17T01:41:36Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG99",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Jack Eichel faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 85,
+ "eventId" : 99,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "18:30",
+ "periodTimeRemaining" : "01:30",
+ "dateTime" : "2018-11-17T01:41:46Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG100",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Sam Reinhart blocked shot from Nikolaj Ehlers"
+ },
+ "about" : {
+ "eventIdx" : 86,
+ "eventId" : 100,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "19:30",
+ "periodTimeRemaining" : "00:30",
+ "dateTime" : "2018-11-17T01:43:09Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -58.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG48",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 87,
+ "eventId" : 48,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "19:31",
+ "periodTimeRemaining" : "00:29",
+ "dateTime" : "2018-11-17T01:43:11Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -35.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG251",
+ "eventTypeId" : "SHOT",
+ "description" : "Jacob Trouba Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 88,
+ "eventId" : 251,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "19:33",
+ "periodTimeRemaining" : "00:27",
+ "dateTime" : "2018-11-17T01:43:14Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -42.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG49",
+ "eventTypeId" : "STOP",
+ "description" : "Offside"
+ },
+ "about" : {
+ "eventIdx" : 89,
+ "eventId" : 49,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "19:37",
+ "periodTimeRemaining" : "00:23",
+ "dateTime" : "2018-11-17T01:43:17Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG252",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 90,
+ "eventId" : 252,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "19:37",
+ "periodTimeRemaining" : "00:23",
+ "dateTime" : "2018-11-17T01:43:33Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -20.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Period End",
+ "eventCode" : "WPG50",
+ "eventTypeId" : "PERIOD_END",
+ "description" : "End of 1st Period"
+ },
+ "about" : {
+ "eventIdx" : 91,
+ "eventId" : 50,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T01:44:07Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Official",
+ "eventCode" : "WPG203",
+ "eventTypeId" : "PERIOD_OFFICIAL",
+ "description" : "Period Official"
+ },
+ "about" : {
+ "eventIdx" : 92,
+ "eventId" : 203,
+ "period" : 1,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "1st",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T02:01:18Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Ready",
+ "eventCode" : "WPG204",
+ "eventTypeId" : "PERIOD_READY",
+ "description" : "Period Ready"
+ },
+ "about" : {
+ "eventIdx" : 93,
+ "eventId" : 204,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:02:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Start",
+ "eventCode" : "WPG253",
+ "eventTypeId" : "PERIOD_START",
+ "description" : "Period Start"
+ },
+ "about" : {
+ "eventIdx" : 94,
+ "eventId" : 253,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:02:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG254",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Vladimir Sobotka faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 95,
+ "eventId" : 254,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:02:31Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG205",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 96,
+ "eventId" : 205,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:25",
+ "periodTimeRemaining" : "19:35",
+ "dateTime" : "2018-11-17T02:02:58Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG255",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Jack Eichel faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 97,
+ "eventId" : 255,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:25",
+ "periodTimeRemaining" : "19:35",
+ "dateTime" : "2018-11-17T02:03:06Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG206",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 98,
+ "eventId" : 206,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:35",
+ "periodTimeRemaining" : "19:25",
+ "dateTime" : "2018-11-17T02:03:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG256",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 99,
+ "eventId" : 256,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "00:35",
+ "periodTimeRemaining" : "19:25",
+ "dateTime" : "2018-11-17T02:03:38Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG274",
+ "eventTypeId" : "SHOT",
+ "description" : "Jeff Skinner Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 100,
+ "eventId" : 274,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "01:02",
+ "periodTimeRemaining" : "18:58",
+ "dateTime" : "2018-11-17T02:04:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -81.0,
+ "y" : 18.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG207",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 101,
+ "eventId" : 207,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "01:03",
+ "periodTimeRemaining" : "18:57",
+ "dateTime" : "2018-11-17T02:04:21Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG258",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Casey Mittelstadt"
+ },
+ "about" : {
+ "eventIdx" : 102,
+ "eventId" : 258,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "01:03",
+ "periodTimeRemaining" : "18:57",
+ "dateTime" : "2018-11-17T02:04:52Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG208",
+ "eventTypeId" : "HIT",
+ "description" : "Blake Wheeler hit Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 103,
+ "eventId" : 208,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "01:23",
+ "periodTimeRemaining" : "18:37",
+ "dateTime" : "2018-11-17T02:05:18Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -78.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG259",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Connor Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 104,
+ "eventId" : 259,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "01:58",
+ "periodTimeRemaining" : "18:02",
+ "dateTime" : "2018-11-17T02:05:52Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 46.0,
+ "y" : -17.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG260",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Nathan Beaulieu blocked shot from Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 105,
+ "eventId" : 260,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "02:43",
+ "periodTimeRemaining" : "17:17",
+ "dateTime" : "2018-11-17T02:06:38Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : -1.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG209",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 106,
+ "eventId" : 209,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "02:44",
+ "periodTimeRemaining" : "17:16",
+ "dateTime" : "2018-11-17T02:06:39Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG261",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Vladimir Sobotka faceoff won against Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 107,
+ "eventId" : 261,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "02:44",
+ "periodTimeRemaining" : "17:16",
+ "dateTime" : "2018-11-17T02:06:55Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG210",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Jack Roslovic"
+ },
+ "about" : {
+ "eventIdx" : 108,
+ "eventId" : 210,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:08",
+ "periodTimeRemaining" : "16:52",
+ "dateTime" : "2018-11-17T02:07:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 87.0,
+ "y" : -33.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG262",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Mathieu Perreault - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 109,
+ "eventId" : 262,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:11",
+ "periodTimeRemaining" : "16:49",
+ "dateTime" : "2018-11-17T02:07:33Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 65.0,
+ "y" : -4.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG263",
+ "eventTypeId" : "SHOT",
+ "description" : "Nikolaj Ehlers Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 110,
+ "eventId" : 263,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:51",
+ "periodTimeRemaining" : "16:09",
+ "dateTime" : "2018-11-17T02:08:15Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG211",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 111,
+ "eventId" : 211,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:52",
+ "periodTimeRemaining" : "16:08",
+ "dateTime" : "2018-11-17T02:08:16Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG264",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Johan Larsson faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 112,
+ "eventId" : 264,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:52",
+ "periodTimeRemaining" : "16:08",
+ "dateTime" : "2018-11-17T02:08:54Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG212",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 113,
+ "eventId" : 212,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "03:58",
+ "periodTimeRemaining" : "16:02",
+ "dateTime" : "2018-11-17T02:08:54Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 71.0,
+ "y" : 40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG213",
+ "eventTypeId" : "HIT",
+ "description" : "Jake McCabe hit Nikolaj Ehlers"
+ },
+ "about" : {
+ "eventIdx" : 114,
+ "eventId" : 213,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "04:18",
+ "periodTimeRemaining" : "15:42",
+ "dateTime" : "2018-11-17T02:09:12Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 88.0,
+ "y" : 38.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG265",
+ "eventTypeId" : "SHOT",
+ "description" : "Sam Reinhart Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 115,
+ "eventId" : 265,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "04:30",
+ "periodTimeRemaining" : "15:30",
+ "dateTime" : "2018-11-17T02:09:24Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -61.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG266",
+ "eventTypeId" : "SHOT",
+ "description" : "Sam Reinhart Slap Shot saved by Laurent Brossoit",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 116,
+ "eventId" : 266,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "04:39",
+ "periodTimeRemaining" : "15:21",
+ "dateTime" : "2018-11-17T02:09:34Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -52.0,
+ "y" : 14.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG267",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Backhand saved by Laurent Brossoit",
+ "secondaryType" : "Backhand"
+ },
+ "about" : {
+ "eventIdx" : 117,
+ "eventId" : 267,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "04:42",
+ "periodTimeRemaining" : "15:18",
+ "dateTime" : "2018-11-17T02:09:41Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -77.0,
+ "y" : 8.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG214",
+ "eventTypeId" : "HIT",
+ "description" : "Josh Morrissey hit Sam Reinhart"
+ },
+ "about" : {
+ "eventIdx" : 118,
+ "eventId" : 214,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "04:50",
+ "periodTimeRemaining" : "15:10",
+ "dateTime" : "2018-11-17T02:09:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -96.0,
+ "y" : -34.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG268",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Okposo Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 119,
+ "eventId" : 268,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "05:14",
+ "periodTimeRemaining" : "14:46",
+ "dateTime" : "2018-11-17T02:10:08Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -55.0,
+ "y" : 23.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG215",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 120,
+ "eventId" : 215,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "05:19",
+ "periodTimeRemaining" : "14:41",
+ "dateTime" : "2018-11-17T02:10:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -43.0,
+ "y" : -34.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG216",
+ "eventTypeId" : "HIT",
+ "description" : "Kyle Okposo hit Brandon Tanev"
+ },
+ "about" : {
+ "eventIdx" : 121,
+ "eventId" : 216,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "05:26",
+ "periodTimeRemaining" : "14:34",
+ "dateTime" : "2018-11-17T02:10:20Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -10.0,
+ "y" : 32.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG269",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Dustin Byfuglien - Goalpost"
+ },
+ "about" : {
+ "eventIdx" : 122,
+ "eventId" : 269,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "05:29",
+ "periodTimeRemaining" : "14:31",
+ "dateTime" : "2018-11-17T02:10:24Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 42.0,
+ "y" : -29.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG270",
+ "eventTypeId" : "SHOT",
+ "description" : "Ben Chiarot Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 123,
+ "eventId" : 270,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "05:56",
+ "periodTimeRemaining" : "14:04",
+ "dateTime" : "2018-11-17T02:10:51Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : 53.0,
+ "y" : 3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG271",
+ "eventTypeId" : "SHOT",
+ "description" : "Tage Thompson Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 124,
+ "eventId" : 271,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "06:35",
+ "periodTimeRemaining" : "13:25",
+ "dateTime" : "2018-11-17T02:11:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -65.0,
+ "y" : 35.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG217",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 125,
+ "eventId" : 217,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "06:45",
+ "periodTimeRemaining" : "13:15",
+ "dateTime" : "2018-11-17T02:11:39Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -67.0,
+ "y" : -37.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG218",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 126,
+ "eventId" : 218,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "06:50",
+ "periodTimeRemaining" : "13:10",
+ "dateTime" : "2018-11-17T02:11:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 0
+ }
+ },
+ "coordinates" : {
+ "x" : -25.0,
+ "y" : 28.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 9
+ }, {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Assist",
+ "seasonTotal" : 3
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Assist",
+ "seasonTotal" : 4
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG272",
+ "eventTypeId" : "GOAL",
+ "description" : "Kyle Connor (9) Wrist Shot, assists: Patrik Laine (3), Bryan Little (4)",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false,
+ "emptyNet" : false
+ },
+ "about" : {
+ "eventIdx" : 127,
+ "eventId" : 272,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:10",
+ "periodTimeRemaining" : "12:50",
+ "dateTime" : "2018-11-17T02:12:06Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 66.0,
+ "y" : 20.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG273",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Jack Eichel faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 128,
+ "eventId" : 273,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:10",
+ "periodTimeRemaining" : "12:50",
+ "dateTime" : "2018-11-17T02:12:54Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG219",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Benches"
+ },
+ "about" : {
+ "eventIdx" : 129,
+ "eventId" : 219,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:17",
+ "periodTimeRemaining" : "12:43",
+ "dateTime" : "2018-11-17T02:13:04Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG275",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 130,
+ "eventId" : 275,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:17",
+ "periodTimeRemaining" : "12:43",
+ "dateTime" : "2018-11-17T02:14:35Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 20.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG276",
+ "eventTypeId" : "SHOT",
+ "description" : "Jacob Trouba Slap Shot saved by Carter Hutton",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 131,
+ "eventId" : 276,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:49",
+ "periodTimeRemaining" : "12:11",
+ "dateTime" : "2018-11-17T02:15:55Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 50.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG277",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Nikolaj Ehlers - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 132,
+ "eventId" : 277,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:53",
+ "periodTimeRemaining" : "12:07",
+ "dateTime" : "2018-11-17T02:15:59Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 51.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG278",
+ "eventTypeId" : "SHOT",
+ "description" : "Josh Morrissey Slap Shot saved by Carter Hutton",
+ "secondaryType" : "Slap Shot"
+ },
+ "about" : {
+ "eventIdx" : 133,
+ "eventId" : 278,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:55",
+ "periodTimeRemaining" : "12:05",
+ "dateTime" : "2018-11-17T02:16:05Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 38.0,
+ "y" : 6.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG221",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 134,
+ "eventId" : 221,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:56",
+ "periodTimeRemaining" : "12:04",
+ "dateTime" : "2018-11-17T02:16:03Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG279",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Patrik Berglund faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 135,
+ "eventId" : 279,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "07:56",
+ "periodTimeRemaining" : "12:04",
+ "dateTime" : "2018-11-17T02:16:28Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG222",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 136,
+ "eventId" : 222,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "08:40",
+ "periodTimeRemaining" : "11:20",
+ "dateTime" : "2018-11-17T02:17:28Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG280",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Kyle Okposo"
+ },
+ "about" : {
+ "eventIdx" : 137,
+ "eventId" : 280,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "08:40",
+ "periodTimeRemaining" : "11:20",
+ "dateTime" : "2018-11-17T02:17:53Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG223",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 138,
+ "eventId" : 223,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "09:09",
+ "periodTimeRemaining" : "10:51",
+ "dateTime" : "2018-11-17T02:18:25Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 37.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG281",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Jake McCabe blocked shot from Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 139,
+ "eventId" : 281,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "09:12",
+ "periodTimeRemaining" : "10:48",
+ "dateTime" : "2018-11-17T02:18:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 48.0,
+ "y" : -8.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG224",
+ "eventTypeId" : "HIT",
+ "description" : "Patrik Laine hit Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 140,
+ "eventId" : 224,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "09:15",
+ "periodTimeRemaining" : "10:45",
+ "dateTime" : "2018-11-17T02:18:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 99.0,
+ "y" : -1.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG282",
+ "eventTypeId" : "SHOT",
+ "description" : "Johan Larsson Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 141,
+ "eventId" : 282,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "09:44",
+ "periodTimeRemaining" : "10:16",
+ "dateTime" : "2018-11-17T02:19:00Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -38.0,
+ "y" : -24.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG283",
+ "eventTypeId" : "SHOT",
+ "description" : "Nathan Beaulieu Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 142,
+ "eventId" : 283,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "09:52",
+ "periodTimeRemaining" : "10:08",
+ "dateTime" : "2018-11-17T02:19:08Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -35.0,
+ "y" : 20.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477464,
+ "fullName" : "Nic Petan",
+ "link" : "/api/v1/people/8477464"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG284",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Johan Larsson blocked shot from Nic Petan"
+ },
+ "about" : {
+ "eventIdx" : 143,
+ "eventId" : 284,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:27",
+ "periodTimeRemaining" : "09:33",
+ "dateTime" : "2018-11-17T02:19:43Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 66.0,
+ "y" : 7.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG225",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Zemgus Girgensons"
+ },
+ "about" : {
+ "eventIdx" : 144,
+ "eventId" : 225,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:29",
+ "periodTimeRemaining" : "09:31",
+ "dateTime" : "2018-11-17T02:19:45Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 32.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG285",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Johan Larsson blocked shot from Joe Morrow"
+ },
+ "about" : {
+ "eventIdx" : 145,
+ "eventId" : 285,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:33",
+ "periodTimeRemaining" : "09:27",
+ "dateTime" : "2018-11-17T02:19:53Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 72.0,
+ "y" : 6.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG286",
+ "eventTypeId" : "SHOT",
+ "description" : "Mathieu Perreault Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 146,
+ "eventId" : 286,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:35",
+ "periodTimeRemaining" : "09:25",
+ "dateTime" : "2018-11-17T02:20:00Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : 5.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG226",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 147,
+ "eventId" : 226,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:36",
+ "periodTimeRemaining" : "09:24",
+ "dateTime" : "2018-11-17T02:19:57Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG287",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 148,
+ "eventId" : 287,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:36",
+ "periodTimeRemaining" : "09:24",
+ "dateTime" : "2018-11-17T02:22:19Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "PenaltyOn"
+ }, {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "DrewBy"
+ } ],
+ "result" : {
+ "event" : "Penalty",
+ "eventCode" : "WPG227",
+ "eventTypeId" : "PENALTY",
+ "description" : "Jacob Trouba Interference against Jeff Skinner",
+ "secondaryType" : "Interference",
+ "penaltySeverity" : "Minor",
+ "penaltyMinutes" : 2
+ },
+ "about" : {
+ "eventIdx" : 149,
+ "eventId" : 227,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:45",
+ "periodTimeRemaining" : "09:15",
+ "dateTime" : "2018-11-17T02:22:34Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -33.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG288",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Patrik Berglund faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 150,
+ "eventId" : 288,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:45",
+ "periodTimeRemaining" : "09:15",
+ "dateTime" : "2018-11-17T02:23:02Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG289",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 151,
+ "eventId" : 289,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:53",
+ "periodTimeRemaining" : "09:07",
+ "dateTime" : "2018-11-17T02:23:17Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -51.0,
+ "y" : -26.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG229",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 152,
+ "eventId" : 229,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:54",
+ "periodTimeRemaining" : "09:06",
+ "dateTime" : "2018-11-17T02:23:18Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG290",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Patrik Berglund"
+ },
+ "about" : {
+ "eventIdx" : 153,
+ "eventId" : 290,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "10:54",
+ "periodTimeRemaining" : "09:06",
+ "dateTime" : "2018-11-17T02:23:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG291",
+ "eventTypeId" : "SHOT",
+ "description" : "Jeff Skinner Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 154,
+ "eventId" : 291,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "11:15",
+ "periodTimeRemaining" : "08:45",
+ "dateTime" : "2018-11-17T02:24:03Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -48.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG231",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Benches"
+ },
+ "about" : {
+ "eventIdx" : 155,
+ "eventId" : 231,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "11:21",
+ "periodTimeRemaining" : "08:39",
+ "dateTime" : "2018-11-17T02:24:10Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG292",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Kyle Okposo faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 156,
+ "eventId" : 292,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "11:21",
+ "periodTimeRemaining" : "08:39",
+ "dateTime" : "2018-11-17T02:24:23Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG232",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 157,
+ "eventId" : 232,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "11:33",
+ "periodTimeRemaining" : "08:27",
+ "dateTime" : "2018-11-17T02:24:57Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG293",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Kyle Okposo faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 158,
+ "eventId" : 293,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "11:33",
+ "periodTimeRemaining" : "08:27",
+ "dateTime" : "2018-11-17T02:25:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -20.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG233",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Brandon Tanev"
+ },
+ "about" : {
+ "eventIdx" : 159,
+ "eventId" : 233,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "12:35",
+ "periodTimeRemaining" : "07:25",
+ "dateTime" : "2018-11-17T02:26:30Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -30.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG294",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Tyler Myers blocked shot from Conor Sheary"
+ },
+ "about" : {
+ "eventIdx" : 160,
+ "eventId" : 294,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "12:44",
+ "periodTimeRemaining" : "07:16",
+ "dateTime" : "2018-11-17T02:26:40Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -52.0,
+ "y" : -23.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG234",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Tage Thompson"
+ },
+ "about" : {
+ "eventIdx" : 161,
+ "eventId" : 234,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "13:11",
+ "periodTimeRemaining" : "06:49",
+ "dateTime" : "2018-11-17T02:27:08Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 37.0,
+ "y" : 12.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG295",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Zach Bogosian blocked shot from Blake Wheeler"
+ },
+ "about" : {
+ "eventIdx" : 162,
+ "eventId" : 295,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "13:17",
+ "periodTimeRemaining" : "06:43",
+ "dateTime" : "2018-11-17T02:27:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : -6.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG296",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Mark Scheifele - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 163,
+ "eventId" : 296,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "13:23",
+ "periodTimeRemaining" : "06:37",
+ "dateTime" : "2018-11-17T02:27:19Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 48.0,
+ "y" : -16.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG235",
+ "eventTypeId" : "HIT",
+ "description" : "Marco Scandella hit Nikolaj Ehlers"
+ },
+ "about" : {
+ "eventIdx" : 164,
+ "eventId" : 235,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "13:27",
+ "periodTimeRemaining" : "06:33",
+ "dateTime" : "2018-11-17T02:27:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 71.0,
+ "y" : 41.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG297",
+ "eventTypeId" : "SHOT",
+ "description" : "Blake Wheeler Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 165,
+ "eventId" : 297,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "13:33",
+ "periodTimeRemaining" : "06:27",
+ "dateTime" : "2018-11-17T02:27:29Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG236",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 166,
+ "eventId" : 236,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "14:17",
+ "periodTimeRemaining" : "05:43",
+ "dateTime" : "2018-11-17T02:28:12Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 72.0,
+ "y" : -32.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG298",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Patrik Laine - Goalpost"
+ },
+ "about" : {
+ "eventIdx" : 167,
+ "eventId" : 298,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "14:20",
+ "periodTimeRemaining" : "05:40",
+ "dateTime" : "2018-11-17T02:28:15Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 83.0,
+ "y" : -8.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG237",
+ "eventTypeId" : "HIT",
+ "description" : "Rasmus Ristolainen hit Jack Roslovic"
+ },
+ "about" : {
+ "eventIdx" : 168,
+ "eventId" : 237,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "14:51",
+ "periodTimeRemaining" : "05:09",
+ "dateTime" : "2018-11-17T02:28:46Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 98.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG299",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Joe Morrow - Over Net"
+ },
+ "about" : {
+ "eventIdx" : 169,
+ "eventId" : 299,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "15:21",
+ "periodTimeRemaining" : "04:39",
+ "dateTime" : "2018-11-17T02:29:17Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 36.0,
+ "y" : 30.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG238",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 170,
+ "eventId" : 238,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "15:26",
+ "periodTimeRemaining" : "04:34",
+ "dateTime" : "2018-11-17T02:29:22Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 10.0,
+ "y" : 2.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG300",
+ "eventTypeId" : "SHOT",
+ "description" : "Casey Mittelstadt Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 171,
+ "eventId" : 300,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "15:57",
+ "periodTimeRemaining" : "04:03",
+ "dateTime" : "2018-11-17T02:29:53Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -61.0,
+ "y" : 31.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG401",
+ "eventTypeId" : "SHOT",
+ "description" : "Marco Scandella Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 172,
+ "eventId" : 401,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:00",
+ "periodTimeRemaining" : "04:00",
+ "dateTime" : "2018-11-17T02:29:58Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -46.0,
+ "y" : -14.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG239",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 173,
+ "eventId" : 239,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:01",
+ "periodTimeRemaining" : "03:59",
+ "dateTime" : "2018-11-17T02:29:57Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG402",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Casey Mittelstadt faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 174,
+ "eventId" : 402,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:01",
+ "periodTimeRemaining" : "03:59",
+ "dateTime" : "2018-11-17T02:32:10Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG403",
+ "eventTypeId" : "SHOT",
+ "description" : "Rasmus Dahlin Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 175,
+ "eventId" : 403,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:05",
+ "periodTimeRemaining" : "03:55",
+ "dateTime" : "2018-11-17T02:32:26Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -43.0,
+ "y" : -29.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG240",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 176,
+ "eventId" : 240,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:06",
+ "periodTimeRemaining" : "03:54",
+ "dateTime" : "2018-11-17T02:32:27Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG404",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Casey Mittelstadt"
+ },
+ "about" : {
+ "eventIdx" : 177,
+ "eventId" : 404,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:06",
+ "periodTimeRemaining" : "03:54",
+ "dateTime" : "2018-11-17T02:32:37Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG405",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Jake McCabe blocked shot from Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 178,
+ "eventId" : 405,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "16:52",
+ "periodTimeRemaining" : "03:08",
+ "dateTime" : "2018-11-17T02:33:31Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 48.0,
+ "y" : 6.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG406",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Backhand saved by Laurent Brossoit",
+ "secondaryType" : "Backhand"
+ },
+ "about" : {
+ "eventIdx" : 179,
+ "eventId" : 406,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:22",
+ "periodTimeRemaining" : "02:38",
+ "dateTime" : "2018-11-17T02:34:02Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -67.0,
+ "y" : -23.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG243",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 180,
+ "eventId" : 243,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:23",
+ "periodTimeRemaining" : "02:37",
+ "dateTime" : "2018-11-17T02:34:04Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG407",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 181,
+ "eventId" : 407,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:23",
+ "periodTimeRemaining" : "02:37",
+ "dateTime" : "2018-11-17T02:34:37Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG408",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Nathan Beaulieu - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 182,
+ "eventId" : 408,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:28",
+ "periodTimeRemaining" : "02:32",
+ "dateTime" : "2018-11-17T02:34:49Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -31.0,
+ "y" : 5.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG244",
+ "eventTypeId" : "STOP",
+ "description" : "Puck Frozen"
+ },
+ "about" : {
+ "eventIdx" : 183,
+ "eventId" : 244,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:29",
+ "periodTimeRemaining" : "02:31",
+ "dateTime" : "2018-11-17T02:34:52Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG409",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Zemgus Girgensons"
+ },
+ "about" : {
+ "eventIdx" : 184,
+ "eventId" : 409,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:29",
+ "periodTimeRemaining" : "02:31",
+ "dateTime" : "2018-11-17T02:35:01Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG410",
+ "eventTypeId" : "SHOT",
+ "description" : "Marco Scandella Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 185,
+ "eventId" : 410,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:39",
+ "periodTimeRemaining" : "02:21",
+ "dateTime" : "2018-11-17T02:35:46Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -46.0,
+ "y" : -35.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG411",
+ "eventTypeId" : "SHOT",
+ "description" : "Johan Larsson Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 186,
+ "eventId" : 411,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:44",
+ "periodTimeRemaining" : "02:16",
+ "dateTime" : "2018-11-17T02:35:51Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -66.0,
+ "y" : -4.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG245",
+ "eventTypeId" : "HIT",
+ "description" : "Johan Larsson hit Dustin Byfuglien"
+ },
+ "about" : {
+ "eventIdx" : 187,
+ "eventId" : 245,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "17:49",
+ "periodTimeRemaining" : "02:11",
+ "dateTime" : "2018-11-17T02:35:56Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG246",
+ "eventTypeId" : "HIT",
+ "description" : "Tage Thompson hit Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 188,
+ "eventId" : 246,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "18:05",
+ "periodTimeRemaining" : "01:55",
+ "dateTime" : "2018-11-17T02:36:14Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -32.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG247",
+ "eventTypeId" : "HIT",
+ "description" : "Bryan Little hit Nathan Beaulieu"
+ },
+ "about" : {
+ "eventIdx" : 189,
+ "eventId" : 247,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "18:26",
+ "periodTimeRemaining" : "01:34",
+ "dateTime" : "2018-11-17T02:36:33Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -32.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG248",
+ "eventTypeId" : "HIT",
+ "description" : "Adam Lowry hit Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 190,
+ "eventId" : 248,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "18:42",
+ "periodTimeRemaining" : "01:18",
+ "dateTime" : "2018-11-17T02:36:49Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -22.0,
+ "y" : -41.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG249",
+ "eventTypeId" : "HIT",
+ "description" : "Brandon Tanev hit Kyle Okposo"
+ },
+ "about" : {
+ "eventIdx" : 191,
+ "eventId" : 249,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:28",
+ "periodTimeRemaining" : "00:32",
+ "dateTime" : "2018-11-17T02:37:35Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 90.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG250",
+ "eventTypeId" : "HIT",
+ "description" : "Rasmus Ristolainen hit Brandon Tanev"
+ },
+ "about" : {
+ "eventIdx" : 192,
+ "eventId" : 250,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:30",
+ "periodTimeRemaining" : "00:30",
+ "dateTime" : "2018-11-17T02:37:40Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 76.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "PenaltyOn"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "DrewBy"
+ } ],
+ "result" : {
+ "event" : "Penalty",
+ "eventCode" : "WPG453",
+ "eventTypeId" : "PENALTY",
+ "description" : "Brandon Tanev Holding against Rasmus Ristolainen",
+ "secondaryType" : "Holding",
+ "penaltySeverity" : "Minor",
+ "penaltyMinutes" : 2
+ },
+ "about" : {
+ "eventIdx" : 193,
+ "eventId" : 453,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:41",
+ "periodTimeRemaining" : "00:19",
+ "dateTime" : "2018-11-17T02:38:29Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 79.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG412",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 194,
+ "eventId" : 412,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:41",
+ "periodTimeRemaining" : "00:19",
+ "dateTime" : "2018-11-17T02:38:36Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG413",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Sam Reinhart - Hit Crossbar"
+ },
+ "about" : {
+ "eventIdx" : 195,
+ "eventId" : 413,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:47",
+ "periodTimeRemaining" : "00:13",
+ "dateTime" : "2018-11-17T02:38:41Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -30.0,
+ "y" : 24.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG455",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Netting"
+ },
+ "about" : {
+ "eventIdx" : 196,
+ "eventId" : 455,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:48",
+ "periodTimeRemaining" : "00:12",
+ "dateTime" : "2018-11-17T02:38:43Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG414",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Patrik Berglund faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 197,
+ "eventId" : 414,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:48",
+ "periodTimeRemaining" : "00:12",
+ "dateTime" : "2018-11-17T02:38:56Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG415",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Jack Eichel - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 198,
+ "eventId" : 415,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "19:57",
+ "periodTimeRemaining" : "00:03",
+ "dateTime" : "2018-11-17T02:39:13Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -43.0,
+ "y" : -34.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Period End",
+ "eventCode" : "WPG456",
+ "eventTypeId" : "PERIOD_END",
+ "description" : "End of 2nd Period"
+ },
+ "about" : {
+ "eventIdx" : 199,
+ "eventId" : 456,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T02:39:20Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Official",
+ "eventCode" : "WPG459",
+ "eventTypeId" : "PERIOD_OFFICIAL",
+ "description" : "Period Official"
+ },
+ "about" : {
+ "eventIdx" : 200,
+ "eventId" : 459,
+ "period" : 2,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "2nd",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T02:56:40Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Ready",
+ "eventCode" : "WPG460",
+ "eventTypeId" : "PERIOD_READY",
+ "description" : "Period Ready"
+ },
+ "about" : {
+ "eventIdx" : 201,
+ "eventId" : 460,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:57:41Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Start",
+ "eventCode" : "WPG416",
+ "eventTypeId" : "PERIOD_START",
+ "description" : "Period Start"
+ },
+ "about" : {
+ "eventIdx" : 202,
+ "eventId" : 416,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:57:44Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG417",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Patrik Berglund"
+ },
+ "about" : {
+ "eventIdx" : 203,
+ "eventId" : 417,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "20:00",
+ "dateTime" : "2018-11-17T02:57:44Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG418",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 204,
+ "eventId" : 418,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:50",
+ "periodTimeRemaining" : "19:10",
+ "dateTime" : "2018-11-17T02:58:34Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 57.0,
+ "y" : 15.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG419",
+ "eventTypeId" : "SHOT",
+ "description" : "Jeff Skinner Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 205,
+ "eventId" : 419,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:52",
+ "periodTimeRemaining" : "19:08",
+ "dateTime" : "2018-11-17T02:58:40Z",
+ "goals" : {
+ "away" : 0,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 71.0,
+ "y" : 6.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 14
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Assist",
+ "seasonTotal" : 16
+ }, {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Assist",
+ "seasonTotal" : 7
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG420",
+ "eventTypeId" : "GOAL",
+ "description" : "Jeff Skinner (14) Backhand, assists: Jack Eichel (16), Rasmus Dahlin (7)",
+ "secondaryType" : "Backhand",
+ "strength" : {
+ "code" : "PPG",
+ "name" : "Power Play"
+ },
+ "gameWinningGoal" : false,
+ "emptyNet" : false
+ },
+ "about" : {
+ "eventIdx" : 206,
+ "eventId" : 420,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:53",
+ "periodTimeRemaining" : "19:07",
+ "dateTime" : "2018-11-17T02:58:46Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 84.0,
+ "y" : 3.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG421",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 207,
+ "eventId" : 421,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "00:53",
+ "periodTimeRemaining" : "19:07",
+ "dateTime" : "2018-11-17T02:59:15Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG461",
+ "eventTypeId" : "HIT",
+ "description" : "Patrik Laine hit Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 208,
+ "eventId" : 461,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "01:11",
+ "periodTimeRemaining" : "18:49",
+ "dateTime" : "2018-11-17T02:59:41Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -94.0,
+ "y" : 36.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG422",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Joe Morrow blocked shot from Tage Thompson"
+ },
+ "about" : {
+ "eventIdx" : 209,
+ "eventId" : 422,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "01:32",
+ "periodTimeRemaining" : "18:28",
+ "dateTime" : "2018-11-17T03:00:01Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 71.0,
+ "y" : 11.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG423",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Zemgus Girgensons - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 210,
+ "eventId" : 423,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "01:37",
+ "periodTimeRemaining" : "18:23",
+ "dateTime" : "2018-11-17T03:00:07Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 77.0,
+ "y" : -6.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG424",
+ "eventTypeId" : "SHOT",
+ "description" : "Casey Mittelstadt Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 211,
+ "eventId" : 424,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "02:02",
+ "periodTimeRemaining" : "17:58",
+ "dateTime" : "2018-11-17T03:00:31Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 54.0,
+ "y" : -10.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG462",
+ "eventTypeId" : "STOP",
+ "description" : "Puck in Benches"
+ },
+ "about" : {
+ "eventIdx" : 212,
+ "eventId" : 462,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "02:56",
+ "periodTimeRemaining" : "17:04",
+ "dateTime" : "2018-11-17T03:01:25Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG425",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 213,
+ "eventId" : 425,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "02:56",
+ "periodTimeRemaining" : "17:04",
+ "dateTime" : "2018-11-17T03:01:47Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477429,
+ "fullName" : "Andrew Copp",
+ "link" : "/api/v1/people/8477429"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG426",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Nathan Beaulieu blocked shot from Andrew Copp"
+ },
+ "about" : {
+ "eventIdx" : 214,
+ "eventId" : 426,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "03:10",
+ "periodTimeRemaining" : "16:50",
+ "dateTime" : "2018-11-17T03:02:03Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -44.0,
+ "y" : -21.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG463",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 215,
+ "eventId" : 463,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "03:19",
+ "periodTimeRemaining" : "16:41",
+ "dateTime" : "2018-11-17T03:02:12Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -30.0,
+ "y" : -38.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG427",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Rasmus Ristolainen blocked shot from Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 216,
+ "eventId" : 427,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "04:03",
+ "periodTimeRemaining" : "15:57",
+ "dateTime" : "2018-11-17T03:02:56Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -68.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG464",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 217,
+ "eventId" : 464,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "04:29",
+ "periodTimeRemaining" : "15:31",
+ "dateTime" : "2018-11-17T03:03:22Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -35.0,
+ "y" : 39.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG428",
+ "eventTypeId" : "SHOT",
+ "description" : "Casey Mittelstadt Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 218,
+ "eventId" : 428,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "04:41",
+ "periodTimeRemaining" : "15:19",
+ "dateTime" : "2018-11-17T03:03:35Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -16.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG465",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 219,
+ "eventId" : 465,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "04:42",
+ "periodTimeRemaining" : "15:18",
+ "dateTime" : "2018-11-17T03:03:37Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG429",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 220,
+ "eventId" : 429,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "04:42",
+ "periodTimeRemaining" : "15:18",
+ "dateTime" : "2018-11-17T03:03:47Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG430",
+ "eventTypeId" : "SHOT",
+ "description" : "Sam Reinhart Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 221,
+ "eventId" : 430,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "05:23",
+ "periodTimeRemaining" : "14:37",
+ "dateTime" : "2018-11-17T03:04:49Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 48.0,
+ "y" : -33.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG431",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Tyler Myers blocked shot from Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 222,
+ "eventId" : 431,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "05:55",
+ "periodTimeRemaining" : "14:05",
+ "dateTime" : "2018-11-17T03:05:22Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 46.0,
+ "y" : 25.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG466",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Joe Morrow"
+ },
+ "about" : {
+ "eventIdx" : 223,
+ "eventId" : 466,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:00",
+ "periodTimeRemaining" : "14:00",
+ "dateTime" : "2018-11-17T03:05:28Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 32.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG467",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 224,
+ "eventId" : 467,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:41",
+ "periodTimeRemaining" : "13:19",
+ "dateTime" : "2018-11-17T03:06:07Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 70.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG468",
+ "eventTypeId" : "STOP",
+ "description" : "Net Off"
+ },
+ "about" : {
+ "eventIdx" : 225,
+ "eventId" : 468,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:44",
+ "periodTimeRemaining" : "13:16",
+ "dateTime" : "2018-11-17T03:06:12Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG432",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Jeff Skinner"
+ },
+ "about" : {
+ "eventIdx" : 226,
+ "eventId" : 432,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:44",
+ "periodTimeRemaining" : "13:16",
+ "dateTime" : "2018-11-17T03:08:13Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG433",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Mark Scheifele blocked shot from Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 227,
+ "eventId" : 433,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:50",
+ "periodTimeRemaining" : "13:10",
+ "dateTime" : "2018-11-17T03:08:30Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 80.0,
+ "y" : 25.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG434",
+ "eventTypeId" : "SHOT",
+ "description" : "Jeff Skinner Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 228,
+ "eventId" : 434,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "06:57",
+ "periodTimeRemaining" : "13:03",
+ "dateTime" : "2018-11-17T03:08:36Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 75.0,
+ "y" : 16.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG436",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Jeff Skinner - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 229,
+ "eventId" : 436,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "07:17",
+ "periodTimeRemaining" : "12:43",
+ "dateTime" : "2018-11-17T03:08:56Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 53.0,
+ "y" : -25.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG469",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 230,
+ "eventId" : 469,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "07:41",
+ "periodTimeRemaining" : "12:19",
+ "dateTime" : "2018-11-17T03:09:21Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG437",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Kyle Okposo faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 231,
+ "eventId" : 437,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "07:41",
+ "periodTimeRemaining" : "12:19",
+ "dateTime" : "2018-11-17T03:09:33Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG470",
+ "eventTypeId" : "HIT",
+ "description" : "Bryan Little hit Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 232,
+ "eventId" : 470,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "08:09",
+ "periodTimeRemaining" : "11:51",
+ "dateTime" : "2018-11-17T03:10:17Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -94.0,
+ "y" : 33.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG438",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Dustin Byfuglien - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 233,
+ "eventId" : 438,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "08:13",
+ "periodTimeRemaining" : "11:47",
+ "dateTime" : "2018-11-17T03:10:21Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -33.0,
+ "y" : 17.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG471",
+ "eventTypeId" : "HIT",
+ "description" : "Ben Chiarot hit Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 234,
+ "eventId" : 471,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "08:25",
+ "periodTimeRemaining" : "11:35",
+ "dateTime" : "2018-11-17T03:10:34Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 1.0,
+ "y" : -38.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG439",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Zach Bogosian blocked shot from Tyler Myers"
+ },
+ "about" : {
+ "eventIdx" : 235,
+ "eventId" : 439,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "08:54",
+ "periodTimeRemaining" : "11:06",
+ "dateTime" : "2018-11-17T03:11:03Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -45.0,
+ "y" : 37.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG472",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Tage Thompson"
+ },
+ "about" : {
+ "eventIdx" : 236,
+ "eventId" : 472,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "09:31",
+ "periodTimeRemaining" : "10:29",
+ "dateTime" : "2018-11-17T03:11:39Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -1.0,
+ "y" : 29.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477429,
+ "fullName" : "Andrew Copp",
+ "link" : "/api/v1/people/8477429"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG473",
+ "eventTypeId" : "HIT",
+ "description" : "Jake McCabe hit Andrew Copp"
+ },
+ "about" : {
+ "eventIdx" : 237,
+ "eventId" : 473,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "09:55",
+ "periodTimeRemaining" : "10:05",
+ "dateTime" : "2018-11-17T03:12:04Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -31.0,
+ "y" : 39.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG474",
+ "eventTypeId" : "HIT",
+ "description" : "Brandon Tanev hit Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 238,
+ "eventId" : 474,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "10:00",
+ "periodTimeRemaining" : "10:00",
+ "dateTime" : "2018-11-17T03:12:08Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -98.0,
+ "y" : -27.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG440",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Josh Morrissey blocked shot from Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 239,
+ "eventId" : 440,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "10:07",
+ "periodTimeRemaining" : "09:53",
+ "dateTime" : "2018-11-17T03:12:15Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : -29.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG442",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Mark Scheifele - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 240,
+ "eventId" : 442,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "10:24",
+ "periodTimeRemaining" : "09:36",
+ "dateTime" : "2018-11-17T03:12:42Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -79.0,
+ "y" : 8.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG441",
+ "eventTypeId" : "SHOT",
+ "description" : "Blake Wheeler Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 241,
+ "eventId" : 441,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "10:27",
+ "periodTimeRemaining" : "09:33",
+ "dateTime" : "2018-11-17T03:12:35Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG475",
+ "eventTypeId" : "HIT",
+ "description" : "Bryan Little hit Rasmus Dahlin"
+ },
+ "about" : {
+ "eventIdx" : 242,
+ "eventId" : 475,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "11:28",
+ "periodTimeRemaining" : "08:32",
+ "dateTime" : "2018-11-17T03:13:36Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -97.0,
+ "y" : -6.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG443",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Connor Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 243,
+ "eventId" : 443,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "11:53",
+ "periodTimeRemaining" : "08:07",
+ "dateTime" : "2018-11-17T03:14:01Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -56.0,
+ "y" : -33.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG444",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Kyle Connor - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 244,
+ "eventId" : 444,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "11:58",
+ "periodTimeRemaining" : "08:02",
+ "dateTime" : "2018-11-17T03:14:07Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -55.0,
+ "y" : 19.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Giveaway",
+ "eventCode" : "WPG477",
+ "eventTypeId" : "GIVEAWAY",
+ "description" : "Giveaway by Rasmus Dahlin"
+ },
+ "about" : {
+ "eventIdx" : 245,
+ "eventId" : 477,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "12:34",
+ "periodTimeRemaining" : "07:26",
+ "dateTime" : "2018-11-17T03:14:42Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -96.0,
+ "y" : 2.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG445",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Nathan Beaulieu blocked shot from Mathieu Perreault"
+ },
+ "about" : {
+ "eventIdx" : 246,
+ "eventId" : 445,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "12:36",
+ "periodTimeRemaining" : "07:24",
+ "dateTime" : "2018-11-17T03:14:44Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -77.0,
+ "y" : 23.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG446",
+ "eventTypeId" : "SHOT",
+ "description" : "Joe Morrow Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 247,
+ "eventId" : 446,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "12:50",
+ "periodTimeRemaining" : "07:10",
+ "dateTime" : "2018-11-17T03:14:59Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -63.0,
+ "y" : -36.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG478",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 248,
+ "eventId" : 478,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "12:51",
+ "periodTimeRemaining" : "07:09",
+ "dateTime" : "2018-11-17T03:15:01Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG447",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 249,
+ "eventId" : 447,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "12:51",
+ "periodTimeRemaining" : "07:09",
+ "dateTime" : "2018-11-17T03:17:22Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG479",
+ "eventTypeId" : "HIT",
+ "description" : "Nikolaj Ehlers hit Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 250,
+ "eventId" : 479,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "13:13",
+ "periodTimeRemaining" : "06:47",
+ "dateTime" : "2018-11-17T03:17:47Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -97.0,
+ "y" : -28.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG480",
+ "eventTypeId" : "HIT",
+ "description" : "Zemgus Girgensons hit Tyler Myers"
+ },
+ "about" : {
+ "eventIdx" : 251,
+ "eventId" : 480,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "13:38",
+ "periodTimeRemaining" : "06:22",
+ "dateTime" : "2018-11-17T03:18:09Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -22.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG481",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 252,
+ "eventId" : 481,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "13:47",
+ "periodTimeRemaining" : "06:13",
+ "dateTime" : "2018-11-17T03:18:20Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG448",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Jack Eichel faceoff won against Adam Lowry"
+ },
+ "about" : {
+ "eventIdx" : 253,
+ "eventId" : 448,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "13:47",
+ "periodTimeRemaining" : "06:13",
+ "dateTime" : "2018-11-17T03:18:33Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG449",
+ "eventTypeId" : "SHOT",
+ "description" : "Marco Scandella Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 254,
+ "eventId" : 449,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "14:05",
+ "periodTimeRemaining" : "05:55",
+ "dateTime" : "2018-11-17T03:19:06Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 33.0,
+ "y" : 30.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG450",
+ "eventTypeId" : "SHOT",
+ "description" : "Patrik Laine Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 255,
+ "eventId" : 450,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "14:50",
+ "periodTimeRemaining" : "05:10",
+ "dateTime" : "2018-11-17T03:19:52Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -56.0,
+ "y" : 18.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG482",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 256,
+ "eventId" : 482,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "14:51",
+ "periodTimeRemaining" : "05:09",
+ "dateTime" : "2018-11-17T03:19:52Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG601",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Bryan Little faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 257,
+ "eventId" : 601,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "14:51",
+ "periodTimeRemaining" : "05:09",
+ "dateTime" : "2018-11-17T03:21:57Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG602",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Okposo Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 258,
+ "eventId" : 602,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "16:01",
+ "periodTimeRemaining" : "03:59",
+ "dateTime" : "2018-11-17T03:23:19Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 50.0,
+ "y" : 16.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG483",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Nikolaj Ehlers"
+ },
+ "about" : {
+ "eventIdx" : 259,
+ "eventId" : 483,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "16:16",
+ "periodTimeRemaining" : "03:44",
+ "dateTime" : "2018-11-17T03:23:34Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -12.0,
+ "y" : 38.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG484",
+ "eventTypeId" : "HIT",
+ "description" : "Brandon Tanev hit Rasmus Ristolainen"
+ },
+ "about" : {
+ "eventIdx" : 260,
+ "eventId" : 484,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "16:59",
+ "periodTimeRemaining" : "03:01",
+ "dateTime" : "2018-11-17T03:24:17Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -97.0,
+ "y" : 3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG485",
+ "eventTypeId" : "HIT",
+ "description" : "Rasmus Ristolainen hit Dustin Byfuglien"
+ },
+ "about" : {
+ "eventIdx" : 261,
+ "eventId" : 485,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "17:09",
+ "periodTimeRemaining" : "02:51",
+ "dateTime" : "2018-11-17T03:24:27Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -19.0,
+ "y" : -40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG603",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Kyle Connor - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 262,
+ "eventId" : 603,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "17:24",
+ "periodTimeRemaining" : "02:36",
+ "dateTime" : "2018-11-17T03:24:42Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -46.0,
+ "y" : -36.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG604",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Jacob Trouba blocked shot from Jake McCabe"
+ },
+ "about" : {
+ "eventIdx" : 263,
+ "eventId" : 604,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "17:47",
+ "periodTimeRemaining" : "02:13",
+ "dateTime" : "2018-11-17T03:25:05Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 49.0,
+ "y" : 25.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG486",
+ "eventTypeId" : "HIT",
+ "description" : "Josh Morrissey hit Jeff Skinner"
+ },
+ "about" : {
+ "eventIdx" : 264,
+ "eventId" : 486,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "17:50",
+ "periodTimeRemaining" : "02:10",
+ "dateTime" : "2018-11-17T03:25:08Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 97.0,
+ "y" : 19.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG487",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 265,
+ "eventId" : 487,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "18:10",
+ "periodTimeRemaining" : "01:50",
+ "dateTime" : "2018-11-17T03:25:31Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG605",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 266,
+ "eventId" : 605,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "18:10",
+ "periodTimeRemaining" : "01:50",
+ "dateTime" : "2018-11-17T03:25:46Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG488",
+ "eventTypeId" : "HIT",
+ "description" : "Dustin Byfuglien hit Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 267,
+ "eventId" : 488,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "18:38",
+ "periodTimeRemaining" : "01:22",
+ "dateTime" : "2018-11-17T03:26:29Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -8.0,
+ "y" : 36.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG489",
+ "eventTypeId" : "STOP",
+ "description" : "Icing"
+ },
+ "about" : {
+ "eventIdx" : 268,
+ "eventId" : 489,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:07",
+ "periodTimeRemaining" : "00:53",
+ "dateTime" : "2018-11-17T03:27:01Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG606",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Adam Lowry faceoff won against Vladimir Sobotka"
+ },
+ "about" : {
+ "eventIdx" : 269,
+ "eventId" : 606,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:07",
+ "periodTimeRemaining" : "00:53",
+ "dateTime" : "2018-11-17T03:27:11Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG607",
+ "eventTypeId" : "SHOT",
+ "description" : "Sam Reinhart Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 270,
+ "eventId" : 607,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:27",
+ "periodTimeRemaining" : "00:33",
+ "dateTime" : "2018-11-17T03:27:57Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 10.0,
+ "y" : -37.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG490",
+ "eventTypeId" : "HIT",
+ "description" : "Rasmus Dahlin hit Kyle Connor"
+ },
+ "about" : {
+ "eventIdx" : 271,
+ "eventId" : 490,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:41",
+ "periodTimeRemaining" : "00:19",
+ "dateTime" : "2018-11-17T03:28:12Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -87.0,
+ "y" : 40.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG497",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Patrik Laine"
+ },
+ "about" : {
+ "eventIdx" : 272,
+ "eventId" : 497,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:55",
+ "periodTimeRemaining" : "00:05",
+ "dateTime" : "2018-11-17T03:28:29Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -81.0,
+ "y" : -15.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG608",
+ "eventTypeId" : "SHOT",
+ "description" : "Patrik Laine Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 273,
+ "eventId" : 608,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "19:57",
+ "periodTimeRemaining" : "00:03",
+ "dateTime" : "2018-11-17T03:28:29Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -82.0,
+ "y" : -10.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Period End",
+ "eventCode" : "WPG493",
+ "eventTypeId" : "PERIOD_END",
+ "description" : "End of 3rd Period"
+ },
+ "about" : {
+ "eventIdx" : 274,
+ "eventId" : 493,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:28:39Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Official",
+ "eventCode" : "WPG496",
+ "eventTypeId" : "PERIOD_OFFICIAL",
+ "description" : "Period Official"
+ },
+ "about" : {
+ "eventIdx" : 275,
+ "eventId" : 496,
+ "period" : 3,
+ "periodType" : "REGULAR",
+ "ordinalNum" : "3rd",
+ "periodTime" : "20:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:28:42Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Ready",
+ "eventCode" : "WPG498",
+ "eventTypeId" : "PERIOD_READY",
+ "description" : "Period Ready"
+ },
+ "about" : {
+ "eventIdx" : 276,
+ "eventId" : 498,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "05:00",
+ "dateTime" : "2018-11-17T03:30:38Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Start",
+ "eventCode" : "WPG609",
+ "eventTypeId" : "PERIOD_START",
+ "description" : "Period Start"
+ },
+ "about" : {
+ "eventIdx" : 277,
+ "eventId" : 609,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "05:00",
+ "dateTime" : "2018-11-17T03:30:42Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG610",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Jack Eichel faceoff won against Mark Scheifele"
+ },
+ "about" : {
+ "eventIdx" : 278,
+ "eventId" : 610,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "05:00",
+ "dateTime" : "2018-11-17T03:31:07Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 0.0,
+ "y" : 0.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG611",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Backhand saved by Laurent Brossoit",
+ "secondaryType" : "Backhand"
+ },
+ "about" : {
+ "eventIdx" : 279,
+ "eventId" : 611,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:25",
+ "periodTimeRemaining" : "04:35",
+ "dateTime" : "2018-11-17T03:31:40Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -83.0,
+ "y" : -8.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG499",
+ "eventTypeId" : "HIT",
+ "description" : "Mark Scheifele hit Conor Sheary"
+ },
+ "about" : {
+ "eventIdx" : 280,
+ "eventId" : 499,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:38",
+ "periodTimeRemaining" : "04:22",
+ "dateTime" : "2018-11-17T03:31:53Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 17.0,
+ "y" : 38.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG500",
+ "eventTypeId" : "STOP",
+ "description" : "Offside"
+ },
+ "about" : {
+ "eventIdx" : 281,
+ "eventId" : 500,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:40",
+ "periodTimeRemaining" : "04:20",
+ "dateTime" : "2018-11-17T03:32:00Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG612",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Sam Reinhart faceoff won against Bryan Little"
+ },
+ "about" : {
+ "eventIdx" : 282,
+ "eventId" : 612,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "00:40",
+ "periodTimeRemaining" : "04:20",
+ "dateTime" : "2018-11-17T03:32:17Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 20.0,
+ "y" : 22.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG613",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Connor Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 283,
+ "eventId" : 613,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "02:14",
+ "periodTimeRemaining" : "02:46",
+ "dateTime" : "2018-11-17T03:33:56Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 76.0,
+ "y" : -7.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Stoppage",
+ "eventCode" : "WPG651",
+ "eventTypeId" : "STOP",
+ "description" : "Goalie Stopped"
+ },
+ "about" : {
+ "eventIdx" : 284,
+ "eventId" : 651,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "02:15",
+ "periodTimeRemaining" : "02:45",
+ "dateTime" : "2018-11-17T03:33:58Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Winner"
+ }, {
+ "player" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728"
+ },
+ "playerType" : "Loser"
+ } ],
+ "result" : {
+ "event" : "Faceoff",
+ "eventCode" : "WPG614",
+ "eventTypeId" : "FACEOFF",
+ "description" : "Mark Scheifele faceoff won against Johan Larsson"
+ },
+ "about" : {
+ "eventIdx" : 285,
+ "eventId" : 614,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "02:15",
+ "periodTimeRemaining" : "02:45",
+ "dateTime" : "2018-11-17T03:34:11Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -22.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG615",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Blake Wheeler blocked shot from Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 286,
+ "eventId" : 615,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "02:55",
+ "periodTimeRemaining" : "02:05",
+ "dateTime" : "2018-11-17T03:35:11Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -68.0,
+ "y" : 19.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG652",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Jack Eichel"
+ },
+ "about" : {
+ "eventIdx" : 287,
+ "eventId" : 652,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "03:11",
+ "periodTimeRemaining" : "01:49",
+ "dateTime" : "2018-11-17T03:35:27Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 25.0,
+ "y" : 24.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG616",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Eichel Wrist Shot saved by Laurent Brossoit",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 288,
+ "eventId" : 616,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "03:15",
+ "periodTimeRemaining" : "01:45",
+ "dateTime" : "2018-11-17T03:35:31Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -78.0,
+ "y" : -3.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839"
+ },
+ "playerType" : "Hitter"
+ }, {
+ "player" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504"
+ },
+ "playerType" : "Hittee"
+ } ],
+ "result" : {
+ "event" : "Hit",
+ "eventCode" : "WPG653",
+ "eventTypeId" : "HIT",
+ "description" : "Rasmus Dahlin hit Josh Morrissey"
+ },
+ "about" : {
+ "eventIdx" : 289,
+ "eventId" : 653,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "03:52",
+ "periodTimeRemaining" : "01:08",
+ "dateTime" : "2018-11-17T03:36:08Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 98.0,
+ "y" : 18.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Blocker"
+ }, {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Blocked Shot",
+ "eventCode" : "WPG617",
+ "eventTypeId" : "BLOCKED_SHOT",
+ "description" : "Patrik Laine blocked shot from Sam Reinhart"
+ },
+ "about" : {
+ "eventIdx" : 290,
+ "eventId" : 617,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "04:09",
+ "periodTimeRemaining" : "00:51",
+ "dateTime" : "2018-11-17T03:36:26Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -67.0,
+ "y" : -3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG618",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Vladimir Sobotka - Over Net"
+ },
+ "about" : {
+ "eventIdx" : 291,
+ "eventId" : 618,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "04:39",
+ "periodTimeRemaining" : "00:21",
+ "dateTime" : "2018-11-17T03:37:02Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -74.0,
+ "y" : -5.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574"
+ },
+ "playerType" : "PlayerID"
+ } ],
+ "result" : {
+ "event" : "Takeaway",
+ "eventCode" : "WPG654",
+ "eventTypeId" : "TAKEAWAY",
+ "description" : "Takeaway by Tyler Myers"
+ },
+ "about" : {
+ "eventIdx" : 292,
+ "eventId" : 654,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "04:51",
+ "periodTimeRemaining" : "00:09",
+ "dateTime" : "2018-11-17T03:37:07Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -91.0,
+ "y" : 18.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "result" : {
+ "event" : "Period End",
+ "eventCode" : "WPG655",
+ "eventTypeId" : "PERIOD_END",
+ "description" : "End of OT"
+ },
+ "about" : {
+ "eventIdx" : 293,
+ "eventId" : 655,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "05:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:37:21Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Official",
+ "eventCode" : "WPG658",
+ "eventTypeId" : "PERIOD_OFFICIAL",
+ "description" : "Period Official"
+ },
+ "about" : {
+ "eventIdx" : 294,
+ "eventId" : 658,
+ "period" : 4,
+ "periodType" : "OVERTIME",
+ "ordinalNum" : "OT",
+ "periodTime" : "05:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:37:22Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Ready",
+ "eventCode" : "WPG659",
+ "eventTypeId" : "PERIOD_READY",
+ "description" : "Period Ready"
+ },
+ "about" : {
+ "eventIdx" : 295,
+ "eventId" : 659,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:37:38Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Start",
+ "eventCode" : "WPG660",
+ "eventTypeId" : "PERIOD_START",
+ "description" : "Period Start"
+ },
+ "about" : {
+ "eventIdx" : 296,
+ "eventId" : 660,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:39:06Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG619",
+ "eventTypeId" : "SHOT",
+ "description" : "Mark Scheifele Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 297,
+ "eventId" : 619,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:39:17Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -65.0,
+ "y" : -3.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 0
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG620",
+ "eventTypeId" : "GOAL",
+ "description" : "Jack Eichel - Wrist Shot",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false
+ },
+ "about" : {
+ "eventIdx" : 298,
+ "eventId" : 620,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:39:50Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 64.0,
+ "y" : 5.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 0
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG621",
+ "eventTypeId" : "GOAL",
+ "description" : "Patrik Laine - Wrist Shot",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false
+ },
+ "about" : {
+ "eventIdx" : 299,
+ "eventId" : 621,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:40:15Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -62.0,
+ "y" : 1.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG623",
+ "eventTypeId" : "SHOT",
+ "description" : "Sam Reinhart Backhand saved by Laurent Brossoit",
+ "secondaryType" : "Backhand"
+ },
+ "about" : {
+ "eventIdx" : 300,
+ "eventId" : 623,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:40:44Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 78.0,
+ "y" : 7.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG624",
+ "eventTypeId" : "SHOT",
+ "description" : "Blake Wheeler Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 301,
+ "eventId" : 624,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:41:04Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -66.0,
+ "y" : -1.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG625",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Casey Mittelstadt - Goalpost"
+ },
+ "about" : {
+ "eventIdx" : 302,
+ "eventId" : 625,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:41:30Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 69.0,
+ "y" : -7.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG626",
+ "eventTypeId" : "SHOT",
+ "description" : "Bryan Little Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 303,
+ "eventId" : 626,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:41:54Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -66.0,
+ "y" : -6.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420"
+ },
+ "playerType" : "Shooter"
+ } ],
+ "result" : {
+ "event" : "Missed Shot",
+ "eventCode" : "WPG627",
+ "eventTypeId" : "MISSED_SHOT",
+ "description" : "Tage Thompson - Wide of Net"
+ },
+ "about" : {
+ "eventIdx" : 304,
+ "eventId" : 627,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:42:17Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 60.0,
+ "y" : -2.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 0
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG628",
+ "eventTypeId" : "GOAL",
+ "description" : "Kyle Connor - Wrist Shot",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false
+ },
+ "about" : {
+ "eventIdx" : 305,
+ "eventId" : 628,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:42:38Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -78.0,
+ "y" : -2.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8469506,
+ "fullName" : "Jason Pominville",
+ "link" : "/api/v1/people/8469506"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 0
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG629",
+ "eventTypeId" : "GOAL",
+ "description" : "Jason Pominville - Wrist Shot",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false
+ },
+ "about" : {
+ "eventIdx" : 306,
+ "eventId" : 629,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:43:05Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 65.0,
+ "y" : -2.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG630",
+ "eventTypeId" : "SHOT",
+ "description" : "Jack Roslovic Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 307,
+ "eventId" : 630,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:43:28Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -70.0,
+ "y" : 6.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG631",
+ "eventTypeId" : "SHOT",
+ "description" : "Kyle Okposo Backhand saved by Laurent Brossoit",
+ "secondaryType" : "Backhand"
+ },
+ "about" : {
+ "eventIdx" : 308,
+ "eventId" : 631,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:43:53Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 78.0,
+ "y" : 4.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618"
+ },
+ "playerType" : "Shooter"
+ }, {
+ "player" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Shot",
+ "eventCode" : "WPG632",
+ "eventTypeId" : "SHOT",
+ "description" : "Mathieu Perreault Wrist Shot saved by Carter Hutton",
+ "secondaryType" : "Wrist Shot"
+ },
+ "about" : {
+ "eventIdx" : 309,
+ "eventId" : 632,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:18Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : -74.0,
+ "y" : -1.0
+ },
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "triCode" : "WPG"
+ }
+ }, {
+ "players" : [ {
+ "player" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839"
+ },
+ "playerType" : "Scorer",
+ "seasonTotal" : 0
+ }, {
+ "player" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "playerType" : "Goalie"
+ } ],
+ "result" : {
+ "event" : "Goal",
+ "eventCode" : "WPG633",
+ "eventTypeId" : "GOAL",
+ "description" : "Conor Sheary - Wrist Shot",
+ "secondaryType" : "Wrist Shot",
+ "strength" : {
+ "code" : "EVEN",
+ "name" : "Even"
+ },
+ "gameWinningGoal" : false
+ },
+ "about" : {
+ "eventIdx" : 310,
+ "eventId" : 633,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:38Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : {
+ "x" : 63.0,
+ "y" : -12.0
+ },
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "triCode" : "BUF"
+ }
+ }, {
+ "result" : {
+ "event" : "Shootout Complete",
+ "eventCode" : "WPG634",
+ "eventTypeId" : "SHOOTOUT_COMPLETE",
+ "description" : "End of Shootout"
+ },
+ "about" : {
+ "eventIdx" : 311,
+ "eventId" : 634,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:47Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period End",
+ "eventCode" : "WPG661",
+ "eventTypeId" : "PERIOD_END",
+ "description" : "End of OT"
+ },
+ "about" : {
+ "eventIdx" : 312,
+ "eventId" : 661,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:54Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Period Official",
+ "eventCode" : "WPG664",
+ "eventTypeId" : "PERIOD_OFFICIAL",
+ "description" : "Period Official"
+ },
+ "about" : {
+ "eventIdx" : 313,
+ "eventId" : 664,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:55Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }, {
+ "result" : {
+ "event" : "Game End",
+ "eventCode" : "WPG665",
+ "eventTypeId" : "GAME_END",
+ "description" : "Game End"
+ },
+ "about" : {
+ "eventIdx" : 314,
+ "eventId" : 665,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:56Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ } ],
+ "scoringPlays" : [ 127, 206, 298, 299, 305, 306, 310 ],
+ "penaltyPlays" : [ 64, 69, 149, 193 ],
+ "playsByPeriod" : [ {
+ "startIndex" : 0,
+ "plays" : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92 ],
+ "endIndex" : 91
+ }, {
+ "startIndex" : 93,
+ "plays" : [ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 ],
+ "endIndex" : 199
+ }, {
+ "startIndex" : 201,
+ "plays" : [ 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275 ],
+ "endIndex" : 274
+ }, {
+ "startIndex" : 276,
+ "plays" : [ 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294 ],
+ "endIndex" : 293
+ }, {
+ "startIndex" : 295,
+ "plays" : [ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314 ],
+ "endIndex" : 314
+ } ],
+ "currentPlay" : {
+ "result" : {
+ "event" : "Game End",
+ "eventCode" : "WPG665",
+ "eventTypeId" : "GAME_END",
+ "description" : "Game End"
+ },
+ "about" : {
+ "eventIdx" : 314,
+ "eventId" : 665,
+ "period" : 5,
+ "periodType" : "SHOOTOUT",
+ "ordinalNum" : "SO",
+ "periodTime" : "00:00",
+ "periodTimeRemaining" : "00:00",
+ "dateTime" : "2018-11-17T03:44:56Z",
+ "goals" : {
+ "away" : 1,
+ "home" : 1
+ }
+ },
+ "coordinates" : { }
+ }
+ },
+ "linescore" : {
+ "currentPeriod" : 5,
+ "currentPeriodOrdinal" : "SO",
+ "currentPeriodTimeRemaining" : "Final",
+ "periods" : [ {
+ "periodType" : "REGULAR",
+ "startTime" : "2018-11-17T01:07:48Z",
+ "endTime" : "2018-11-17T01:44:07Z",
+ "num" : 1,
+ "ordinalNum" : "1st",
+ "home" : {
+ "goals" : 0,
+ "shotsOnGoal" : 12,
+ "rinkSide" : "right"
+ },
+ "away" : {
+ "goals" : 0,
+ "shotsOnGoal" : 4,
+ "rinkSide" : "left"
+ }
+ }, {
+ "periodType" : "REGULAR",
+ "startTime" : "2018-11-17T02:02:30Z",
+ "endTime" : "2018-11-17T02:39:20Z",
+ "num" : 2,
+ "ordinalNum" : "2nd",
+ "home" : {
+ "goals" : 1,
+ "shotsOnGoal" : 8,
+ "rinkSide" : "left"
+ },
+ "away" : {
+ "goals" : 0,
+ "shotsOnGoal" : 16,
+ "rinkSide" : "right"
+ }
+ }, {
+ "periodType" : "REGULAR",
+ "startTime" : "2018-11-17T02:57:44Z",
+ "endTime" : "2018-11-17T03:28:39Z",
+ "num" : 3,
+ "ordinalNum" : "3rd",
+ "home" : {
+ "goals" : 0,
+ "shotsOnGoal" : 5,
+ "rinkSide" : "right"
+ },
+ "away" : {
+ "goals" : 1,
+ "shotsOnGoal" : 10,
+ "rinkSide" : "left"
+ }
+ }, {
+ "periodType" : "OVERTIME",
+ "startTime" : "2018-11-17T03:30:42Z",
+ "endTime" : "2018-11-17T03:37:21Z",
+ "num" : 4,
+ "ordinalNum" : "OT",
+ "home" : {
+ "goals" : 0,
+ "shotsOnGoal" : 1,
+ "rinkSide" : "left"
+ },
+ "away" : {
+ "goals" : 0,
+ "shotsOnGoal" : 2,
+ "rinkSide" : "right"
+ }
+ } ],
+ "shootoutInfo" : {
+ "away" : {
+ "scores" : 3,
+ "attempts" : 7
+ },
+ "home" : {
+ "scores" : 2,
+ "attempts" : 7
+ },
+ "startTime" : "2018-11-17T03:39:06Z"
+ },
+ "teams" : {
+ "home" : {
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "abbreviation" : "WPG",
+ "triCode" : "WPG"
+ },
+ "goals" : 1,
+ "shotsOnGoal" : 26,
+ "goaliePulled" : false,
+ "numSkaters" : 0,
+ "powerPlay" : false
+ },
+ "away" : {
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "abbreviation" : "BUF",
+ "triCode" : "BUF"
+ },
+ "goals" : 2,
+ "shotsOnGoal" : 32,
+ "goaliePulled" : false,
+ "numSkaters" : 1,
+ "powerPlay" : false
+ }
+ },
+ "powerPlayStrength" : "Even",
+ "hasShootout" : true,
+ "intermissionInfo" : {
+ "intermissionTimeRemaining" : 0,
+ "intermissionTimeElapsed" : 0,
+ "inIntermission" : false
+ },
+ "powerPlayInfo" : {
+ "situationTimeRemaining" : 0,
+ "situationTimeElapsed" : 0,
+ "inSituation" : false
+ }
+ },
+ "boxscore" : {
+ "teams" : {
+ "away" : {
+ "team" : {
+ "id" : 7,
+ "name" : "Buffalo Sabres",
+ "link" : "/api/v1/teams/7",
+ "abbreviation" : "BUF",
+ "triCode" : "BUF"
+ },
+ "teamStats" : {
+ "teamSkaterStats" : {
+ "goals" : 1,
+ "pim" : 2,
+ "shots" : 32,
+ "powerPlayPercentage" : "33.3",
+ "powerPlayGoals" : 1.0,
+ "powerPlayOpportunities" : 3.0,
+ "faceOffWinPercentage" : "40.7",
+ "blocked" : 14,
+ "takeaways" : 5,
+ "giveaways" : 9,
+ "hits" : 17
+ }
+ },
+ "players" : {
+ "ID8469506" : {
+ "person" : {
+ "id" : 8469506,
+ "fullName" : "Jason Pominville",
+ "link" : "/api/v1/people/8469506",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "29",
+ "position" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "12:45",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "11:42",
+ "powerPlayTimeOnIce" : "1:03",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8475728" : {
+ "person" : {
+ "id" : 8475728,
+ "fullName" : "Johan Larsson",
+ "link" : "/api/v1/people/8475728",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "22",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "15:21",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 33.0,
+ "faceOffWins" : 3,
+ "faceoffTaken" : 9,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 2,
+ "plusMinus" : -1,
+ "evenTimeOnIce" : "14:21",
+ "powerPlayTimeOnIce" : "0:09",
+ "shortHandedTimeOnIce" : "0:51"
+ }
+ }
+ },
+ "ID8474618" : {
+ "person" : {
+ "id" : 8474618,
+ "fullName" : "Marco Scandella",
+ "link" : "/api/v1/people/8474618",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "6",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "16:38",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 3,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : -1,
+ "evenTimeOnIce" : "15:51",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:47"
+ }
+ }
+ },
+ "ID8473534" : {
+ "person" : {
+ "id" : 8473534,
+ "fullName" : "Patrik Berglund",
+ "link" : "/api/v1/people/8473534",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "10",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "16:34",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 2,
+ "faceOffPct" : 67.0,
+ "faceOffWins" : 4,
+ "faceoffTaken" : 6,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "13:43",
+ "powerPlayTimeOnIce" : "2:51",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8477839" : {
+ "person" : {
+ "id" : 8477839,
+ "fullName" : "Conor Sheary",
+ "link" : "/api/v1/people/8477839",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "43",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "15:59",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 100.0,
+ "faceOffWins" : 1,
+ "faceoffTaken" : 1,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "14:47",
+ "powerPlayTimeOnIce" : "1:12",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8476931" : {
+ "person" : {
+ "id" : 8476931,
+ "fullName" : "Jake McCabe",
+ "link" : "/api/v1/people/8476931",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "19",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "18:26",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 3,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 1,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 3,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "18:26",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8473449" : {
+ "person" : {
+ "id" : 8473449,
+ "fullName" : "Kyle Okposo",
+ "link" : "/api/v1/people/8473449",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "21",
+ "position" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "13:58",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 75.0,
+ "faceOffWins" : 3,
+ "faceoffTaken" : 4,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "12:39",
+ "powerPlayTimeOnIce" : "1:15",
+ "shortHandedTimeOnIce" : "0:04"
+ }
+ }
+ },
+ "ID8475622" : {
+ "person" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "40",
+ "position" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ },
+ "stats" : {
+ "goalieStats" : {
+ "timeOnIce" : "64:56",
+ "assists" : 0,
+ "goals" : 0,
+ "pim" : 0,
+ "shots" : 26,
+ "saves" : 25,
+ "powerPlaySaves" : 0,
+ "shortHandedSaves" : 0,
+ "evenSaves" : 30,
+ "shortHandedShotsAgainst" : 0,
+ "evenShotsAgainst" : 33,
+ "powerPlayShotsAgainst" : 0,
+ "savePercentage" : 96.15384615384616,
+ "evenStrengthSavePercentage" : 90.9090909090909
+ }
+ }
+ },
+ "ID8474567" : {
+ "person" : {
+ "id" : 8474567,
+ "fullName" : "Zach Bogosian",
+ "link" : "/api/v1/people/8474567",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "4",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "20:17",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 2,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "19:21",
+ "powerPlayTimeOnIce" : "0:09",
+ "shortHandedTimeOnIce" : "0:47"
+ }
+ }
+ },
+ "ID8479999" : {
+ "person" : {
+ "id" : 8479999,
+ "fullName" : "Casey Mittelstadt",
+ "link" : "/api/v1/people/8479999",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "37",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "15:48",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 3,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 20.0,
+ "faceOffWins" : 1,
+ "faceoffTaken" : 5,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "14:36",
+ "powerPlayTimeOnIce" : "1:12",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8471743" : {
+ "person" : {
+ "id" : 8471743,
+ "fullName" : "Vladimir Sobotka",
+ "link" : "/api/v1/people/8471743",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "17",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "15:55",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 1,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 40.0,
+ "faceOffWins" : 4,
+ "faceoffTaken" : 10,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "15:55",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8477933" : {
+ "person" : {
+ "id" : 8477933,
+ "fullName" : "Sam Reinhart",
+ "link" : "/api/v1/people/8477933",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "23",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "20:58",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 4,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 33.0,
+ "faceOffWins" : 1,
+ "faceoffTaken" : 3,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "18:07",
+ "powerPlayTimeOnIce" : "2:51",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8476878" : {
+ "person" : {
+ "id" : 8476878,
+ "fullName" : "Zemgus Girgensons",
+ "link" : "/api/v1/people/8476878",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "28",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "13:06",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 0.0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 3,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : -1,
+ "evenTimeOnIce" : "12:19",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:47"
+ }
+ }
+ },
+ "ID8476999" : {
+ "person" : {
+ "id" : 8476999,
+ "fullName" : "Linus Ullmark",
+ "link" : "/api/v1/people/8476999",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "35",
+ "position" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ },
+ "stats" : {
+ "goalieStats" : {
+ "timeOnIce" : "0:00",
+ "assists" : 0,
+ "goals" : 0,
+ "pim" : 0,
+ "shots" : 0,
+ "saves" : 0,
+ "powerPlaySaves" : 0,
+ "shortHandedSaves" : 0,
+ "evenSaves" : 0,
+ "shortHandedShotsAgainst" : 0,
+ "evenShotsAgainst" : 0,
+ "powerPlayShotsAgainst" : 0
+ }
+ }
+ },
+ "ID8477499" : {
+ "person" : {
+ "id" : 8477499,
+ "fullName" : "Rasmus Ristolainen",
+ "link" : "/api/v1/people/8477499",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "55",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "26:31",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 3,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "25:15",
+ "powerPlayTimeOnIce" : "1:12",
+ "shortHandedTimeOnIce" : "0:04"
+ }
+ }
+ },
+ "ID8478403" : {
+ "person" : {
+ "id" : 8478403,
+ "fullName" : "Jack Eichel",
+ "link" : "/api/v1/people/8478403",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "9",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "20:24",
+ "assists" : 1,
+ "goals" : 0,
+ "shots" : 6,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 1,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 45.0,
+ "faceOffWins" : 5,
+ "faceoffTaken" : 11,
+ "takeaways" : 1,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "17:33",
+ "powerPlayTimeOnIce" : "2:51",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8475784" : {
+ "person" : {
+ "id" : 8475784,
+ "fullName" : "Jeff Skinner",
+ "link" : "/api/v1/people/8475784",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "53",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "18:34",
+ "assists" : 0,
+ "goals" : 1,
+ "shots" : 6,
+ "hits" : 0,
+ "powerPlayGoals" : 1,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 0.0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 2,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "15:55",
+ "powerPlayTimeOnIce" : "2:39",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8477461" : {
+ "person" : {
+ "id" : 8477461,
+ "fullName" : "Remi Elie",
+ "link" : "/api/v1/people/8477461",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "81",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ },
+ "ID8479268" : {
+ "person" : {
+ "id" : 8479268,
+ "fullName" : "Casey Nelson",
+ "link" : "/api/v1/people/8479268",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "8",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ },
+ "ID8478542" : {
+ "person" : {
+ "id" : 8478542,
+ "fullName" : "Evan Rodrigues",
+ "link" : "/api/v1/people/8478542",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "71",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ },
+ "ID8480839" : {
+ "person" : {
+ "id" : 8480839,
+ "fullName" : "Rasmus Dahlin",
+ "link" : "/api/v1/people/8480839",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "26",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "22:57",
+ "assists" : 1,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 1,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 2,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "20:06",
+ "powerPlayTimeOnIce" : "2:51",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8479420" : {
+ "person" : {
+ "id" : 8479420,
+ "fullName" : "Tage Thompson",
+ "link" : "/api/v1/people/8479420",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "72",
+ "position" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "12:36",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 1,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : -1,
+ "evenTimeOnIce" : "12:36",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8476470" : {
+ "person" : {
+ "id" : 8476470,
+ "fullName" : "Nathan Beaulieu",
+ "link" : "/api/v1/people/8476470",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "82",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "16:17",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 1,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 3,
+ "plusMinus" : -1,
+ "evenTimeOnIce" : "16:13",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:04"
+ }
+ }
+ }
+ },
+ "goalies" : [ 8476999, 8475622 ],
+ "skaters" : [ 8474567, 8474618, 8478403, 8473534, 8471743, 8476931, 8473449, 8475728, 8477933, 8480839, 8476878, 8469506, 8479999, 8477839, 8475784, 8477499, 8479420, 8476470, 8477461, 8479268, 8478542 ],
+ "onIce" : [ ],
+ "onIcePlus" : [ ],
+ "scratches" : [ 8477461, 8479268, 8478542 ],
+ "penaltyBox" : [ ],
+ "coaches" : [ {
+ "person" : {
+ "fullName" : "Phil Housley",
+ "link" : "/api/v1/people/null"
+ },
+ "position" : {
+ "code" : "HC",
+ "name" : "Head Coach",
+ "type" : "Head Coach",
+ "abbreviation" : "Head Coach"
+ }
+ } ]
+ },
+ "home" : {
+ "team" : {
+ "id" : 52,
+ "name" : "Winnipeg Jets",
+ "link" : "/api/v1/teams/52",
+ "abbreviation" : "WPG",
+ "triCode" : "WPG"
+ },
+ "teamStats" : {
+ "teamSkaterStats" : {
+ "goals" : 1,
+ "pim" : 6,
+ "shots" : 26,
+ "powerPlayPercentage" : "0.0",
+ "powerPlayGoals" : 0.0,
+ "powerPlayOpportunities" : 1.0,
+ "faceOffWinPercentage" : "59.3",
+ "blocked" : 12,
+ "takeaways" : 11,
+ "giveaways" : 7,
+ "hits" : 21
+ }
+ },
+ "players" : {
+ "ID8473618" : {
+ "person" : {
+ "id" : 8473618,
+ "fullName" : "Mathieu Perreault",
+ "link" : "/api/v1/people/8473618",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "85",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "8:46",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 1,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 0.0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 1,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "8:46",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8471218" : {
+ "person" : {
+ "id" : 8471218,
+ "fullName" : "Blake Wheeler",
+ "link" : "/api/v1/people/8471218",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "26",
+ "position" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "21:19",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 3,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 100.0,
+ "faceOffWins" : 3,
+ "faceoffTaken" : 3,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "19:05",
+ "powerPlayTimeOnIce" : "0:51",
+ "shortHandedTimeOnIce" : "1:23"
+ }
+ }
+ },
+ "ID8470834" : {
+ "person" : {
+ "id" : 8470834,
+ "fullName" : "Dustin Byfuglien",
+ "link" : "/api/v1/people/8470834",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "33",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "25:12",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 2,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "23:18",
+ "powerPlayTimeOnIce" : "0:51",
+ "shortHandedTimeOnIce" : "1:03"
+ }
+ }
+ },
+ "ID8476945" : {
+ "person" : {
+ "id" : 8476945,
+ "fullName" : "Connor Hellebuyck",
+ "link" : "/api/v1/people/8476945",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "37",
+ "position" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ },
+ "stats" : {
+ "goalieStats" : {
+ "timeOnIce" : "0:00",
+ "assists" : 0,
+ "goals" : 0,
+ "pim" : 0,
+ "shots" : 0,
+ "saves" : 0,
+ "powerPlaySaves" : 0,
+ "shortHandedSaves" : 0,
+ "evenSaves" : 0,
+ "shortHandedShotsAgainst" : 0,
+ "evenShotsAgainst" : 0,
+ "powerPlayShotsAgainst" : 0
+ }
+ }
+ },
+ "ID8478915" : {
+ "person" : {
+ "id" : 8478915,
+ "fullName" : "Sami Niku",
+ "link" : "/api/v1/people/8478915",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "83",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ },
+ "ID8477429" : {
+ "person" : {
+ "id" : 8477429,
+ "fullName" : "Andrew Copp",
+ "link" : "/api/v1/people/8477429",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "9",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "13:59",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "12:44",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "1:15"
+ }
+ }
+ },
+ "ID8473412" : {
+ "person" : {
+ "id" : 8473412,
+ "fullName" : "Bryan Little",
+ "link" : "/api/v1/people/8473412",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "18",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "17:48",
+ "assists" : 1,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 3,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 57.0,
+ "faceOffWins" : 8,
+ "faceoffTaken" : 14,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 1,
+ "evenTimeOnIce" : "16:58",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:50"
+ }
+ }
+ },
+ "ID8479339" : {
+ "person" : {
+ "id" : 8479339,
+ "fullName" : "Patrik Laine",
+ "link" : "/api/v1/people/8479339",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "29",
+ "position" : {
+ "code" : "R",
+ "name" : "Right Wing",
+ "type" : "Forward",
+ "abbreviation" : "RW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "19:36",
+ "assists" : 1,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 3,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 2,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 1,
+ "evenTimeOnIce" : "18:45",
+ "powerPlayTimeOnIce" : "0:51",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8476316" : {
+ "person" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "30",
+ "position" : {
+ "code" : "G",
+ "name" : "Goalie",
+ "type" : "Goalie",
+ "abbreviation" : "G"
+ },
+ "stats" : {
+ "goalieStats" : {
+ "timeOnIce" : "65:00",
+ "assists" : 0,
+ "goals" : 0,
+ "pim" : 0,
+ "shots" : 32,
+ "saves" : 31,
+ "powerPlaySaves" : 5,
+ "shortHandedSaves" : 0,
+ "evenSaves" : 28,
+ "shortHandedShotsAgainst" : 0,
+ "evenShotsAgainst" : 31,
+ "powerPlayShotsAgainst" : 6,
+ "savePercentage" : 96.875,
+ "powerPlaySavePercentage" : 83.33333333333334,
+ "evenStrengthSavePercentage" : 90.32258064516128
+ }
+ }
+ },
+ "ID8477504" : {
+ "person" : {
+ "id" : 8477504,
+ "fullName" : "Josh Morrissey",
+ "link" : "/api/v1/people/8477504",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "44",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "22:07",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "19:07",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "3:00"
+ }
+ }
+ },
+ "ID8476476" : {
+ "person" : {
+ "id" : 8476476,
+ "fullName" : "Joe Morrow",
+ "link" : "/api/v1/people/8476476",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "70",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "16:22",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 1,
+ "evenTimeOnIce" : "16:22",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8478458" : {
+ "person" : {
+ "id" : 8478458,
+ "fullName" : "Jack Roslovic",
+ "link" : "/api/v1/people/8478458",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "28",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "7:50",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 0.0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 1,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "7:50",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8474574" : {
+ "person" : {
+ "id" : 8474574,
+ "fullName" : "Tyler Myers",
+ "link" : "/api/v1/people/8474574",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "57",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "21:14",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 2,
+ "plusMinus" : 1,
+ "evenTimeOnIce" : "20:17",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:57"
+ }
+ }
+ },
+ "ID8475279" : {
+ "person" : {
+ "id" : 8475279,
+ "fullName" : "Ben Chiarot",
+ "link" : "/api/v1/people/8475279",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "7",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "21:02",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 2,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "19:59",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "1:03"
+ }
+ }
+ },
+ "ID8476885" : {
+ "person" : {
+ "id" : 8476885,
+ "fullName" : "Jacob Trouba",
+ "link" : "/api/v1/people/8476885",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "8",
+ "position" : {
+ "code" : "D",
+ "name" : "Defenseman",
+ "type" : "Defenseman",
+ "abbreviation" : "D"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "17:57",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 2,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 2,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "15:54",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "2:03"
+ }
+ }
+ },
+ "ID8477940" : {
+ "person" : {
+ "id" : 8477940,
+ "fullName" : "Nikolaj Ehlers",
+ "link" : "/api/v1/people/8477940",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "27",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "16:35",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 2,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "16:28",
+ "powerPlayTimeOnIce" : "0:07",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8477962" : {
+ "person" : {
+ "id" : 8477962,
+ "fullName" : "Brendan Lemieux",
+ "link" : "/api/v1/people/8477962",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "48",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ },
+ "ID8476460" : {
+ "person" : {
+ "id" : 8476460,
+ "fullName" : "Mark Scheifele",
+ "link" : "/api/v1/people/8476460",
+ "shootsCatches" : "R",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "55",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "22:10",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 2,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 63.0,
+ "faceOffWins" : 12,
+ "faceoffTaken" : 19,
+ "takeaways" : 2,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "19:56",
+ "powerPlayTimeOnIce" : "0:51",
+ "shortHandedTimeOnIce" : "1:23"
+ }
+ }
+ },
+ "ID8477464" : {
+ "person" : {
+ "id" : 8477464,
+ "fullName" : "Nic Petan",
+ "link" : "/api/v1/people/8477464",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "19",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "8:40",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 0,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 0,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "8:40",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8478398" : {
+ "person" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "81",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "19:38",
+ "assists" : 0,
+ "goals" : 1,
+ "shots" : 4,
+ "hits" : 0,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 2,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 1,
+ "evenTimeOnIce" : "18:54",
+ "powerPlayTimeOnIce" : "0:44",
+ "shortHandedTimeOnIce" : "0:00"
+ }
+ }
+ },
+ "ID8476392" : {
+ "person" : {
+ "id" : 8476392,
+ "fullName" : "Adam Lowry",
+ "link" : "/api/v1/people/8476392",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "17",
+ "position" : {
+ "code" : "C",
+ "name" : "Center",
+ "type" : "Forward",
+ "abbreviation" : "C"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "15:07",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 1,
+ "hits" : 1,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 0,
+ "faceOffPct" : 56.0,
+ "faceOffWins" : 9,
+ "faceoffTaken" : 16,
+ "takeaways" : 1,
+ "giveaways" : 1,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 1,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "13:17",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "1:50"
+ }
+ }
+ },
+ "ID8479293" : {
+ "person" : {
+ "id" : 8479293,
+ "fullName" : "Brandon Tanev",
+ "link" : "/api/v1/people/8479293",
+ "shootsCatches" : "L",
+ "rosterStatus" : "Y"
+ },
+ "jerseyNumber" : "13",
+ "position" : {
+ "code" : "L",
+ "name" : "Left Wing",
+ "type" : "Forward",
+ "abbreviation" : "LW"
+ },
+ "stats" : {
+ "skaterStats" : {
+ "timeOnIce" : "14:26",
+ "assists" : 0,
+ "goals" : 0,
+ "shots" : 1,
+ "hits" : 3,
+ "powerPlayGoals" : 0,
+ "powerPlayAssists" : 0,
+ "penaltyMinutes" : 2,
+ "faceOffWins" : 0,
+ "faceoffTaken" : 0,
+ "takeaways" : 1,
+ "giveaways" : 0,
+ "shortHandedGoals" : 0,
+ "shortHandedAssists" : 0,
+ "blocked" : 0,
+ "plusMinus" : 0,
+ "evenTimeOnIce" : "13:01",
+ "powerPlayTimeOnIce" : "0:00",
+ "shortHandedTimeOnIce" : "1:25"
+ }
+ }
+ },
+ "ID8480005" : {
+ "person" : {
+ "id" : 8480005,
+ "fullName" : "Kristian Vesalainen",
+ "link" : "/api/v1/people/8480005",
+ "shootsCatches" : "L",
+ "rosterStatus" : "N"
+ },
+ "jerseyNumber" : "93",
+ "position" : {
+ "code" : "N/A",
+ "name" : "Unknown",
+ "type" : "Unknown",
+ "abbreviation" : "N/A"
+ },
+ "stats" : { }
+ }
+ },
+ "goalies" : [ 8476316, 8476945 ],
+ "skaters" : [ 8475279, 8476885, 8477429, 8479293, 8476392, 8473412, 8477464, 8471218, 8477940, 8478458, 8479339, 8470834, 8477504, 8476460, 8474574, 8476476, 8478398, 8473618, 8477962, 8478915, 8480005 ],
+ "onIce" : [ ],
+ "onIcePlus" : [ ],
+ "scratches" : [ 8477962, 8478915, 8480005 ],
+ "penaltyBox" : [ ],
+ "coaches" : [ {
+ "person" : {
+ "fullName" : "Paul Maurice",
+ "link" : "/api/v1/people/null"
+ },
+ "position" : {
+ "code" : "HC",
+ "name" : "Head Coach",
+ "type" : "Head Coach",
+ "abbreviation" : "Head Coach"
+ }
+ } ]
+ }
+ },
+ "officials" : [ {
+ "official" : {
+ "id" : 4600,
+ "fullName" : "Francis Charron",
+ "link" : "/api/v1/people/4600"
+ },
+ "officialType" : "Referee"
+ }, {
+ "official" : {
+ "id" : 6494,
+ "fullName" : "Tom Chmielewski",
+ "link" : "/api/v1/people/6494"
+ },
+ "officialType" : "Referee"
+ }, {
+ "official" : {
+ "id" : 4713,
+ "fullName" : "Ryan Gibbons",
+ "link" : "/api/v1/people/4713"
+ },
+ "officialType" : "Linesman"
+ }, {
+ "official" : {
+ "id" : 2325,
+ "fullName" : "Brian Mach",
+ "link" : "/api/v1/people/2325"
+ },
+ "officialType" : "Linesman"
+ } ]
+ },
+ "decisions" : {
+ "firstStar" : {
+ "id" : 8475622,
+ "fullName" : "Carter Hutton",
+ "link" : "/api/v1/people/8475622"
+ },
+ "secondStar" : {
+ "id" : 8476316,
+ "fullName" : "Laurent Brossoit",
+ "link" : "/api/v1/people/8476316"
+ },
+ "thirdStar" : {
+ "id" : 8478398,
+ "fullName" : "Kyle Connor",
+ "link" : "/api/v1/people/8478398"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/hue/__init__.py b/hue/__init__.py
new file mode 100644
index 0000000..ec5e2bc
--- /dev/null
+++ b/hue/__init__.py
@@ -0,0 +1,4 @@
+from .hue import Hue
+
+def setup(bot):
+ bot.add_cog(Hue(bot))
\ No newline at end of file
diff --git a/hue/hue.py b/hue/hue.py
new file mode 100644
index 0000000..4d0df2e
--- /dev/null
+++ b/hue/hue.py
@@ -0,0 +1,336 @@
+from random import choice as randchoice
+from datetime import datetime as dt
+from redbot.core import commands
+import discord
+from redbot.core import Config
+from redbot.core import checks
+import random
+import os
+import asyncio
+from phue import Bridge
+
+class Hue(getattr(commands, "Cog", object)):
+ """
+ Control philips hue light on the same network as the bot
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 1384534876565)
+ default_global = {"ip":None}
+ self.bridge = None
+ self.lights = None
+
+ async def get_bridge(self):
+ if self.bridge is None:
+ try:
+ self.bridge = Bridge(await self.config.ip())
+ self.lights = self.bridge.lights
+ return True
+ except Exception as e:
+ print(e)
+ return False
+ else:
+ return True
+
+ # @commands.command(pass_context=True)
+ async def oilersgoal(self):
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ old_lights = {}
+ for light in self.lights:
+ old_lights[light.name] = [light.on, light.colortemp]
+ for i in range(10):
+ await self.oilers_hex_set(1.0, 1.0)
+ await asyncio.sleep(0.5)
+ await self.oilers_hex_set(0, 0)
+ await asyncio.sleep(0.5)
+ for light in self.lights:
+ light.on = old_lights[light.name][0]
+ light.colortemp = old_lights[light.name][1]
+
+
+ async def oilers_hex_set(self, x:float, y:float, *, name=None):
+ """Sets the colour for Oilers Goals"""
+ if x > 1.0 or x < 0.0:
+ x = 1.0
+ if y > 1.0 or y < 0.0:
+ y = 1.0
+ for light in self.lights:
+ if not light.on:
+ light.on = True
+ light.xy = [x, y]
+
+ @commands.group(pass_context=True, name="hue")
+ @checks.is_owner()
+ async def _hue(self, ctx):
+ """Commands for interacting with Hue lights"""
+ pass
+
+ @_hue.command(name="connect")
+ async def hue_connect(self):
+ """Setup command if bridge cannot connect"""
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ self.bridge.connect()
+
+ @_hue.command(pass_context=True, name="set")
+ async def hue_setup(self, ctx, ip):
+ """
+ Set the IP address of the hue bridge
+
+ `ip` is the bridges IP address
+ """
+ await self.config.ip.set(ip)
+ self.bridge = Bridge(await self.config.ip())
+ self.lights = self.bridge.lights
+
+ @_hue.command(pass_context=True, name="check")
+ async def check_api(self, ctx):
+ """Gets light data from bridge and prints to terminal"""
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ print(self.bridge.get_api())
+
+ async def max_min_check(self, value, max, min):
+ if value > max:
+ return max
+ if value < min:
+ return min
+ else:
+ return value
+
+ @_hue.command(pass_context=True, name="brightness")
+ async def brightness_set(self, ctx, brightness:int=254, *, name=None):
+ """
+ Sets the brightness for lights
+
+ `brightness` the level of brightness to set
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ brightness = await self.max_min_check(brightness, 254, 0)
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.brightness = brightness
+
+ @_hue.command(pass_context=True, name="temp", aliases=["ct", "colourtemp", "temperature"])
+ async def colourtemp_set(self, ctx, ct:int=500, *, name=None):
+ """
+ Sets the colour temperature for lights
+
+ `ct` must be a number the colour temperature to set
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ ct = await self.max_min_check(ct, 600, 154)
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.colortemp = ct
+
+ @_hue.command(pass_context=True, name="hue")
+ async def hue_set(self, ctx, hue:int=25000, *, name=None):
+ """
+ Sets the hue for lights
+
+ `hue` must be a number the hue value to set the light to
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.hue = hue
+
+ @_hue.command(pass_context=True, name="saturation", aliases=["sat"])
+ async def saturation_set(self, ctx, saturation:int=254, *, name=None):
+ """
+ Sets the saturation for lights
+
+ `saturation` must be a number the saturation value to set the light to
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ saturation = await self.max_min_check(saturation, 254, 0)
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.saturation = saturation
+
+ @_hue.command(pass_context=True, name="random")
+ async def hue_random_colour(self, ctx, *, name=None):
+ """
+ Sets the light to a random colour
+
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ colours = [random.random(), random.random()]
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.xy = colours
+
+ @_hue.command(pass_context=True, name="colourloop", aliases=["cl"])
+ async def hue_colourloop(self, ctx, *, name=None):
+ """
+ Toggles the light on colour looping all colours
+
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower():
+ if light.effect != "colorloop" and light.on:
+ light.effect = "colorloop"
+ continue
+ if light.effect == "colorloop" and light.on:
+ light.effect = "none"
+ continue
+
+ @_hue.group(pass_context=True, name="colour")
+ async def _colour(self, ctx):
+ """Sets the colour for lights"""
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ pass
+
+ async def rgb_to_xy(self, red:float, green:float, blue:float):
+ X = 0.4124*red + 0.3576*green + 0.1805*blue
+ Y = 0.2126*red + 0.7152*green + 0.0722*blue
+ Z = 0.0193*red + 0.1192*green + 0.9505*blue
+ try:
+ x = X / (X + Y + Z)
+ y = Y / (X + Y + Z)
+ except ZeroDivisionError:
+ x = 1.0
+ y = 1.0
+ return x, y
+
+ @_colour.command(pass_context=True, name="rgb")
+ async def hue_colour_rgb(self, ctx, red:float, green:float, blue:float, *, name=None):
+ """
+ Sets the colour using RGB colour coordinates
+
+ `red` must be a number the red value to set
+ `green` must be a number the green value to set
+ `blue` must be a number the blue value to set
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ x, y = await self.rgb_to_xy(red, green, blue)
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.xy = [x, y]
+
+ @_colour.command(pass_context=True, name="xy", aliases=["xyz"])
+ async def hue_colour_xy(self, ctx, x:float, y:float, *, name=None):
+ """
+ Sets the colour using xyz colour values
+
+ `x` must be a number the x value to set
+ `y` must be a number the y value to set
+ `name` the name of the light to adjust
+ Note: The z value is determined from two other values
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ if x > 1.0 or x < 0.0:
+ x = 1.0
+ if y > 1.0 or y < 0.0:
+ y = 1.0
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.xy = [x, y]
+
+ @_colour.command(pass_context=True, name="hex")
+ async def hue_colour_hex(self, ctx, hex, *, name=None):
+ """
+ Attempt to set the colour based on hex values
+ Not 100% accurate
+
+ `hex` the hex code colour to try to change to
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ if "#" in hex:
+ hex.replace("#", "")
+ r, g, b = tuple(int(hex[i:i+2], 16) for i in (0, 2 ,4))
+ x, y = await self.rgb_to_xy(r, g, b)
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower() and light.on:
+ light.xy = [x, y]
+
+ @_hue.command(pass_context=True, name="test")
+ async def hue_test(self, ctx, cl1:float, cl2:float):
+ """Testing function"""
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ light.xy = [cl1, cl2]
+
+ @_hue.command(pass_context=True, name="switch")
+ async def hue_switch(self, ctx, *, name=None):
+ """
+ Toggles lights on or off
+
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower():
+ if light.on:
+ light.on = False
+ continue
+ if not light.on:
+ light.on = True
+ continue
+
+ @_hue.command(pass_context=True, name="off")
+ async def turn_off(self, ctx, *, name=None):
+ """
+ Turns off light
+
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower():
+ light.on = False
+
+ @_hue.command(pass_context=True, name="on")
+ async def turn_on(self, ctx, name=None):
+ """
+ Turns on Light
+
+ `name` the name of the light to adjust
+ """
+ if not await self.get_bridge():
+ await ctx.send("No IP has been set.")
+ return
+ for light in self.lights:
+ if name is None or light.name.lower() == name.lower():
+ light.on = True
diff --git a/hue/info.json b/hue/info.json
new file mode 100644
index 0000000..f098dac
--- /dev/null
+++ b/hue/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Lets you control your philips hue lights with redbot.",
+ "install_msg":"Type `[p]hue` to see available commands.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Hue",
+ "permissions":[],
+ "requirements":[
+ "phue"
+ ],
+ "short":"Control your philips hue lights with redbot!",
+ "tags":[
+ "general",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/imagemaker/__init__.py b/imagemaker/__init__.py
new file mode 100644
index 0000000..6449be6
--- /dev/null
+++ b/imagemaker/__init__.py
@@ -0,0 +1,7 @@
+from .imagemaker import ImageMaker
+from redbot.core import data_manager
+
+def setup(bot):
+ cog = ImageMaker(bot)
+ data_manager.load_bundled_data(cog, __file__)
+ bot.add_cog(cog)
\ No newline at end of file
diff --git a/imagemaker/data/beautiful.png b/imagemaker/data/beautiful.png
new file mode 100644
index 0000000..f86b69b
Binary files /dev/null and b/imagemaker/data/beautiful.png differ
diff --git a/imagemaker/data/blackpill.png b/imagemaker/data/blackpill.png
new file mode 100644
index 0000000..4ccf4a4
Binary files /dev/null and b/imagemaker/data/blackpill.png differ
diff --git a/imagemaker/data/impact.ttf b/imagemaker/data/impact.ttf
new file mode 100644
index 0000000..114e6c1
Binary files /dev/null and b/imagemaker/data/impact.ttf differ
diff --git a/imagemaker/data/pepetemplate.png b/imagemaker/data/pepetemplate.png
new file mode 100644
index 0000000..1cb6df5
Binary files /dev/null and b/imagemaker/data/pepetemplate.png differ
diff --git a/imagemaker/data/trump_template/Trump_00.png b/imagemaker/data/trump_template/Trump_00.png
new file mode 100644
index 0000000..d5f7f30
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_00.png differ
diff --git a/imagemaker/data/trump_template/Trump_02.png b/imagemaker/data/trump_template/Trump_02.png
new file mode 100644
index 0000000..2e85a5f
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_02.png differ
diff --git a/imagemaker/data/trump_template/Trump_03.png b/imagemaker/data/trump_template/Trump_03.png
new file mode 100644
index 0000000..898d74d
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_03.png differ
diff --git a/imagemaker/data/trump_template/Trump_05.png b/imagemaker/data/trump_template/Trump_05.png
new file mode 100644
index 0000000..0277740
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_05.png differ
diff --git a/imagemaker/data/trump_template/Trump_06.png b/imagemaker/data/trump_template/Trump_06.png
new file mode 100644
index 0000000..bbbd343
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_06.png differ
diff --git a/imagemaker/data/trump_template/Trump_07.png b/imagemaker/data/trump_template/Trump_07.png
new file mode 100644
index 0000000..b79fb5b
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_07.png differ
diff --git a/imagemaker/data/trump_template/Trump_08.png b/imagemaker/data/trump_template/Trump_08.png
new file mode 100644
index 0000000..428d527
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_08.png differ
diff --git a/imagemaker/data/trump_template/Trump_09.png b/imagemaker/data/trump_template/Trump_09.png
new file mode 100644
index 0000000..51e900d
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_09.png differ
diff --git a/imagemaker/data/trump_template/Trump_11.png b/imagemaker/data/trump_template/Trump_11.png
new file mode 100644
index 0000000..1183467
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_11.png differ
diff --git a/imagemaker/data/trump_template/Trump_12.png b/imagemaker/data/trump_template/Trump_12.png
new file mode 100644
index 0000000..dfcbc3b
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_12.png differ
diff --git a/imagemaker/data/trump_template/Trump_14.png b/imagemaker/data/trump_template/Trump_14.png
new file mode 100644
index 0000000..0842c13
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_14.png differ
diff --git a/imagemaker/data/trump_template/Trump_15.png b/imagemaker/data/trump_template/Trump_15.png
new file mode 100644
index 0000000..09b367f
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_15.png differ
diff --git a/imagemaker/data/trump_template/Trump_16.png b/imagemaker/data/trump_template/Trump_16.png
new file mode 100644
index 0000000..b7b7d0c
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_16.png differ
diff --git a/imagemaker/data/trump_template/Trump_17.png b/imagemaker/data/trump_template/Trump_17.png
new file mode 100644
index 0000000..5aa1359
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_17.png differ
diff --git a/imagemaker/data/trump_template/Trump_18.png b/imagemaker/data/trump_template/Trump_18.png
new file mode 100644
index 0000000..f9c8f9f
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_18.png differ
diff --git a/imagemaker/data/trump_template/Trump_21.png b/imagemaker/data/trump_template/Trump_21.png
new file mode 100644
index 0000000..3982e5d
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_21.png differ
diff --git a/imagemaker/data/trump_template/Trump_22.png b/imagemaker/data/trump_template/Trump_22.png
new file mode 100644
index 0000000..87c901a
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_22.png differ
diff --git a/imagemaker/data/trump_template/Trump_24.png b/imagemaker/data/trump_template/Trump_24.png
new file mode 100644
index 0000000..d4c6893
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_24.png differ
diff --git a/imagemaker/data/trump_template/Trump_25.png b/imagemaker/data/trump_template/Trump_25.png
new file mode 100644
index 0000000..2ddebbb
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_25.png differ
diff --git a/imagemaker/data/trump_template/Trump_26.png b/imagemaker/data/trump_template/Trump_26.png
new file mode 100644
index 0000000..cdd6abb
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_26.png differ
diff --git a/imagemaker/data/trump_template/Trump_28.png b/imagemaker/data/trump_template/Trump_28.png
new file mode 100644
index 0000000..5d14b08
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_28.png differ
diff --git a/imagemaker/data/trump_template/Trump_29.png b/imagemaker/data/trump_template/Trump_29.png
new file mode 100644
index 0000000..47ba79a
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_29.png differ
diff --git a/imagemaker/data/trump_template/Trump_30.png b/imagemaker/data/trump_template/Trump_30.png
new file mode 100644
index 0000000..a718a24
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_30.png differ
diff --git a/imagemaker/data/trump_template/Trump_32.png b/imagemaker/data/trump_template/Trump_32.png
new file mode 100644
index 0000000..b0eeeaa
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_32.png differ
diff --git a/imagemaker/data/trump_template/Trump_33.png b/imagemaker/data/trump_template/Trump_33.png
new file mode 100644
index 0000000..0a164a0
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_33.png differ
diff --git a/imagemaker/data/trump_template/Trump_35.png b/imagemaker/data/trump_template/Trump_35.png
new file mode 100644
index 0000000..60084a0
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_35.png differ
diff --git a/imagemaker/data/trump_template/Trump_37.png b/imagemaker/data/trump_template/Trump_37.png
new file mode 100644
index 0000000..e06949c
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_37.png differ
diff --git a/imagemaker/data/trump_template/Trump_38.png b/imagemaker/data/trump_template/Trump_38.png
new file mode 100644
index 0000000..17d39ab
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_38.png differ
diff --git a/imagemaker/data/trump_template/Trump_39.png b/imagemaker/data/trump_template/Trump_39.png
new file mode 100644
index 0000000..ea3967d
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_39.png differ
diff --git a/imagemaker/data/trump_template/Trump_41.png b/imagemaker/data/trump_template/Trump_41.png
new file mode 100644
index 0000000..6861ce8
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_41.png differ
diff --git a/imagemaker/data/trump_template/Trump_42.png b/imagemaker/data/trump_template/Trump_42.png
new file mode 100644
index 0000000..1209060
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_42.png differ
diff --git a/imagemaker/data/trump_template/Trump_43.png b/imagemaker/data/trump_template/Trump_43.png
new file mode 100644
index 0000000..9a2cf9b
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_43.png differ
diff --git a/imagemaker/data/trump_template/Trump_44.png b/imagemaker/data/trump_template/Trump_44.png
new file mode 100644
index 0000000..a9ce5da
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_44.png differ
diff --git a/imagemaker/data/trump_template/Trump_45.png b/imagemaker/data/trump_template/Trump_45.png
new file mode 100644
index 0000000..264dec6
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_45.png differ
diff --git a/imagemaker/data/trump_template/Trump_46.png b/imagemaker/data/trump_template/Trump_46.png
new file mode 100644
index 0000000..ea7a4b8
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_46.png differ
diff --git a/imagemaker/data/trump_template/Trump_47.png b/imagemaker/data/trump_template/Trump_47.png
new file mode 100644
index 0000000..e95ba71
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_47.png differ
diff --git a/imagemaker/data/trump_template/Trump_48.png b/imagemaker/data/trump_template/Trump_48.png
new file mode 100644
index 0000000..ab2f3ca
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_48.png differ
diff --git a/imagemaker/data/trump_template/Trump_49.png b/imagemaker/data/trump_template/Trump_49.png
new file mode 100644
index 0000000..619f4ee
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_49.png differ
diff --git a/imagemaker/data/trump_template/Trump_50.png b/imagemaker/data/trump_template/Trump_50.png
new file mode 100644
index 0000000..4972f2c
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_50.png differ
diff --git a/imagemaker/data/trump_template/Trump_51.png b/imagemaker/data/trump_template/Trump_51.png
new file mode 100644
index 0000000..68f8596
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_51.png differ
diff --git a/imagemaker/data/trump_template/Trump_52.png b/imagemaker/data/trump_template/Trump_52.png
new file mode 100644
index 0000000..eff9091
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_52.png differ
diff --git a/imagemaker/data/trump_template/Trump_54.png b/imagemaker/data/trump_template/Trump_54.png
new file mode 100644
index 0000000..6f390ce
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_54.png differ
diff --git a/imagemaker/data/trump_template/Trump_55.png b/imagemaker/data/trump_template/Trump_55.png
new file mode 100644
index 0000000..08ff0e9
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_55.png differ
diff --git a/imagemaker/data/trump_template/Trump_57.png b/imagemaker/data/trump_template/Trump_57.png
new file mode 100644
index 0000000..4535ecc
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_57.png differ
diff --git a/imagemaker/data/trump_template/Trump_59.png b/imagemaker/data/trump_template/Trump_59.png
new file mode 100644
index 0000000..d7789b5
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_59.png differ
diff --git a/imagemaker/data/trump_template/Trump_60.png b/imagemaker/data/trump_template/Trump_60.png
new file mode 100644
index 0000000..6964527
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_60.png differ
diff --git a/imagemaker/data/trump_template/Trump_62.png b/imagemaker/data/trump_template/Trump_62.png
new file mode 100644
index 0000000..9d2415f
Binary files /dev/null and b/imagemaker/data/trump_template/Trump_62.png differ
diff --git a/imagemaker/data/trump_template/frames.json b/imagemaker/data/trump_template/frames.json
new file mode 100644
index 0000000..9516fdb
--- /dev/null
+++ b/imagemaker/data/trump_template/frames.json
@@ -0,0 +1 @@
+[{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_00.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_02.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_03.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_05.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_06.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_07.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_08.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_09.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_11.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_12.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_14.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_15.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_16.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_17.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_18.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_21.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_22.png","show":false},{"corners":[[0,0],[0,0],[0,0]],"file":"Trump_24.png","show":false},{"corners":[[245,168],[206,190],[173,190]],"file":"Trump_25.png","show":true},{"corners":[[241.0,144],[216,177],[166,177.5]],"file":"Trump_26.png","show":true},{"corners":[[224.5,112.0],[253,152],[160,168]],"file":"Trump_28.png","show":true},{"corners":[[213,102],[268,141],[161,169]],"file":"Trump_29.png","show":true},{"corners":[[200,95],[272,129],[164,169]],"file":"Trump_30.png","show":true},{"corners":[[170.5,95.5],[238,110],[160,175]],"file":"Trump_32.png","show":true},{"corners":[[157.0,97.5],[219,106],[157.0,178.0]],"file":"Trump_33.png","show":true},{"corners":[[144,101],[199,103],[151,180]],"file":"Trump_35.png","show":true},{"corners":[[147,101],[202,104],[153,180]],"file":"Trump_37.png","show":true},{"corners":[[145,100],[202,103],[151,179]],"file":"Trump_38.png","show":true},{"corners":[[140,101],[202,105],[143,180]],"file":"Trump_39.png","show":true},{"corners":[[107,104],[182,108],[104,185]],"file":"Trump_41.png","show":true},{"corners":[[84,102],[163,107],[80,185]],"file":"Trump_42.png","show":true},{"corners":[[69.5,101],[148,107],[62.5,185]],"file":"Trump_43.png","show":true},{"corners":[[60,102],[137,108],[53,185]],"file":"Trump_44.png","show":true},{"corners":[[58.0,104],[134,110],[49.0,186.0]],"file":"Trump_45.png","show":true},{"corners":[[62.0,102],[137,109],[53.0,184]],"file":"Trump_46.png","show":true},{"corners":[[83.5,98],[138,111],[66,178]],"file":"Trump_47.png","show":true},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_48.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_49.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_50.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_51.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_52.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_54.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_55.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_57.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_59.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_60.png","show":false},{"corners":[[11,23],[39,18],[22,53]],"file":"Trump_62.png","show":false}]
\ No newline at end of file
diff --git a/imagemaker/imagemaker.py b/imagemaker/imagemaker.py
new file mode 100644
index 0000000..2505ef3
--- /dev/null
+++ b/imagemaker/imagemaker.py
@@ -0,0 +1,422 @@
+import aiohttp
+import discord
+from redbot.core import commands
+from redbot.core.data_manager import bundled_data_path
+from io import BytesIO, StringIO
+import sys
+import functools
+import asyncio
+from PIL import Image, ImageDraw, ImageFont, ImageColor, ImageSequence
+import numpy as np
+import os
+import json
+from copy import copy
+
+
+try:
+ import cv2
+ TRUMP = True
+except ImportError:
+ TRUMP = False
+
+class ImageMaker(getattr(commands, "Cog", object)):
+ """
+ Create various fun images
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.textFont = None
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ async def dl_image(self, url):
+ async with self.session.get(url) as resp:
+ test = await resp.read()
+ return BytesIO(test)
+
+ @commands.command(pass_context=True)
+ async def beautiful(self, ctx, user:discord.Member=None):
+ """
+ Generate a beautiful image using users avatar
+
+ `user` the user whos avatar will be places on the image
+ """
+ if user is None:
+ user = ctx.message.author
+ async with ctx.channel.typing():
+ beautiful_img = await self.make_beautiful(user)
+ if beautiful_img is None:
+ await ctx.send("sorry something went wrong!")
+ return
+ file = discord.File(beautiful_img)
+ # ext = await self.make_beautiful(user)
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True)
+ async def feels(self, ctx, user:discord.Member=None):
+ """
+ Generate a feels image using users avatar and role colour
+
+ `user` the user whos avatar will be places on the image
+ """
+ if user is None:
+ user = ctx.message.author
+ async with ctx.channel.typing():
+ feels_img = await self.make_feels(user)
+ if feels_img is None:
+ await ctx.send("sorry something went wrong!")
+ return
+ file = discord.File(feels_img)
+ # ext = await self.make_feels(user)
+ await ctx.send(file=file)
+
+ @commands.command(aliases=["isnowillegal"])
+ async def trump(self, ctx, *, message):
+ """
+ Generate isnowillegal gif image
+
+ `message` will be what is pasted on the gif
+ """
+ if not TRUMP:
+ await ctx.send("The bot owner needs to run `pip3 install opencv-python` to run this command")
+ return
+ async with ctx.channel.typing():
+ task = functools.partial(self.make_trump_gif, text=message)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ image = discord.File(temp)
+ await ctx.send(file=image)
+
+ @commands.command()
+ async def redpill(self, ctx):
+ """Generate a Red Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #FF0000"
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command()
+ async def bluepill(self, ctx):
+ """Generate a Blue Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #0000FF"
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command()
+ async def blackpill(self, ctx):
+ """Generate a Black Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #000000"
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command()
+ async def purplepill(self, ctx):
+ """Generate a Purple Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #800080"
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command()
+ async def yellowpill(self, ctx):
+ """Generate a Yellow Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #FFFF00"
+ ctx.bot.dispatch("message", msg)
+
+ @commands.command()
+ async def greenpill(self, ctx):
+ """Generate a Green Pill"""
+ msg = copy(ctx.message)
+ msg.content = ctx.prefix + "pill #008000"
+ ctx.bot.dispatch("message", msg)
+
+ async def make_colour(self, colour):
+ task = functools.partial(self.colour_convert,colour=colour)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ image = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ image.seek(0)
+ return image
+
+ @commands.command()
+ async def pill(self, ctx, colour="#FF0000"):
+ """
+ Generate a pill image to any colour with hex codes
+
+ `colour` is a hexcode colour
+ """
+ async with ctx.channel.typing():
+ pill_image = await self.make_colour(colour)
+ if pill_image is None:
+ await ctx.send("Something went wrong sorry!")
+ return
+ image = discord.File(pill_image)
+ await ctx.send(file=image)
+
+ def make_beautiful_gif(self, avatar):
+ gif_list = [frame.copy() for frame in ImageSequence.Iterator(avatar)]
+ img_list = []
+ num = 0
+ temp = None
+ for frame in gif_list:
+ template = Image.open(str(bundled_data_path(self)) + "/beautiful.png")
+ template = template.convert("RGBA")
+ frame = frame.convert("RGBA")
+ # frame = frame.rotate(-30, expand=True)
+ # frame = frame.resize((60, 60), Image.ANTIALIAS)
+ template.paste(frame, (370, 45), frame)
+ template.paste(frame, (370, 330), frame)
+ # temp2.thumbnail((320, 320), Image.ANTIALIAS)
+ img_list.append(template)
+ num += 1
+ temp = BytesIO()
+ template.save(temp, format="GIF", save_all=True, append_images=img_list, duration=0, loop=0)
+ temp.name = "beautiful.gif"
+ if sys.getsizeof(temp) < 8000000 and sys.getsizeof(temp) > 7000000:
+ break
+ return temp
+
+ def make_beautiful_img(self, avatar):
+ template = Image.open(str(bundled_data_path(self)) + "/beautiful.png")
+ # print(template.info)
+ template = template.convert("RGBA")
+ avatar = avatar.convert("RGBA")
+ template.paste(avatar, (370, 45), avatar)
+ template.paste(avatar, (370, 330), avatar)
+ temp = BytesIO()
+ template.save(temp, format="PNG")
+ temp.name = "beautiful.png"
+ return temp
+
+ async def make_beautiful(self, user):
+
+ if user.is_avatar_animated():
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="gif", size=128)))
+ task = functools.partial(self.make_beautiful_gif, avatar=avatar)
+
+ else:
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="png", size=128)))
+ task = functools.partial(self.make_beautiful_img, avatar=avatar)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ temp.seek(0)
+ return temp
+
+ def make_feels_gif(self, colour, avatar):
+ gif_list = [frame.copy() for frame in ImageSequence.Iterator(avatar)]
+ img_list = []
+ num = 0
+ temp = None
+ for frame in gif_list:
+ template = Image.open(str(bundled_data_path(self)) + "/pepetemplate.png")
+ template = template.convert("RGBA")
+ transparency = template.split()[-1].getdata()
+ data = np.array(template)
+ red, green, blue, alpha = data.T
+ blue_areas = (red == 0) & (blue == 255) & (green == 0) & (alpha == 255)
+ data[..., :-1][blue_areas.T] = colour
+ temp2 = Image.fromarray(data)
+ frame = frame.convert("RGBA")
+ frame = frame.rotate(-30, expand=True)
+ frame = frame.resize((60, 60), Image.ANTIALIAS)
+ temp2.paste(frame, (40, 25), frame)
+ # temp2.thumbnail((320, 320), Image.ANTIALIAS)
+ img_list.append(temp2)
+ num += 1
+ temp = BytesIO()
+ temp2.save(temp, format="GIF", save_all=True, append_images=img_list, duration=0, loop=0, transparency=0)
+ temp.name = "feels.gif"
+ if sys.getsizeof(temp) < 8000000 and sys.getsizeof(temp) > 7000000:
+ break
+ return temp
+
+ def make_feels_img(self, colour, avatar):
+ template = Image.open(str(bundled_data_path(self)) + "/pepetemplate.png")
+ # print(template.info)
+ template = template.convert("RGBA")
+
+ # avatar = Image.open(self.files + "temp." + ext)
+ transparency = template.split()[-1].getdata()
+ data = np.array(template)
+ red, green, blue, alpha = data.T
+ blue_areas = (red == 0) & (blue == 255) & (green == 0) & (alpha == 255)
+ data[..., :-1][blue_areas.T] = colour
+ temp2 = Image.fromarray(data)
+ temp2 = temp2.convert("RGBA")
+ avatar = avatar.convert("RGBA")
+ avatar = avatar.rotate(-30, expand=True)
+ avatar = avatar.resize((60, 60), Image.ANTIALIAS)
+ temp2.paste(avatar, (40, 25), avatar)
+ temp = BytesIO()
+ temp2.save(temp, format="PNG")
+ temp.name = "feels.png"
+ return temp
+
+ async def make_feels(self, user):
+ colour = user.colour.to_rgb()
+ if user.is_avatar_animated():
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="gif", size=64)))
+ task = functools.partial(self.make_feels_gif, colour=colour, avatar=avatar)
+ else:
+ avatar = Image.open(await self.dl_image(user.avatar_url_as(format="png", size=64)))
+ task = functools.partial(self.make_feels_img, colour=colour, avatar=avatar)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ temp = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ temp.seek(0)
+ return temp
+
+ def colour_convert(self, colour="#FF0000"):
+ im = Image.open(str(bundled_data_path(self)) + "/blackpill.png")
+ im = im.convert('RGBA')
+ colour = ImageColor.getrgb(colour)
+ data = np.array(im)
+ red, green, blue, alpha = data.T
+ white_areas = (red == 0) & (blue == 0) & (green == 0) & (alpha == 255)
+ data[..., :-1][white_areas.T] = colour
+ im2 = Image.fromarray(data)
+ temp = BytesIO()
+ im2.save(temp, format="PNG")
+ temp.name = "pill.png"
+ return temp
+
+ """Code is from http://isnowillegal.com/ and made to work on redbot"""
+ def make_trump_gif(self, text):
+ folder = str(bundled_data_path(self))+"/trump_template"
+ jsonPath = os.path.join(folder, 'frames.json')
+
+ # Load frames
+ frames = json.load(open(jsonPath))
+
+ # Used to compute motion blur
+ lastCorners = None
+ textImage = self.generateText(text)
+
+ # Will store all gif frames
+ frameImages = []
+
+ # Iterate trough frames
+ for frame in frames:
+ # Load image
+ name = frame['file']
+ filePath = os.path.join(folder, name)
+ finalFrame = None
+
+ # If it has transformations,
+ # process with opencv and convert back to pillow
+ if frame['show'] == True:
+ image = cv2.imread(filePath)
+
+ # Do rotoscope
+ image = self.rotoscope(image, textImage, frame)
+
+ # Show final result
+ # cv2.imshow(name, image)
+ finalFrame = self.cvImageToPillow(image)
+ else:
+ finalFrame = Image.open(filePath)
+
+ frameImages.append(finalFrame)
+ temp = BytesIO()
+ # Saving...
+ frameImages[0].save(temp, format="GIF", save_all=True, append_images=frameImages, duration=0, loop=0)
+ temp.name = "Trump.gif"
+ temp.seek(0)
+ return temp
+
+
+ def rotoscope(self, dst, warp, properties):
+ if properties['show'] == False:
+ return dst
+
+ corners = properties['corners']
+
+ wRows, wCols, wCh = warp.shape
+ rows, cols, ch = dst.shape
+
+ # Apply blur on warp
+ kernel = np.ones((5, 5), np.float32) / 25
+ warp = cv2.filter2D(warp, -1, kernel)
+
+ # Prepare points to be matched on Affine Transformation
+ pts1 = np.float32([[0, 0],[wCols, 0],[0, wRows]])
+ pts2 = np.float32(corners) * 2
+
+ # Enlarge image to multisample
+ dst = cv2.resize(dst, (cols * 2, rows * 2))
+
+ # Transform image with the Matrix
+ M = cv2.getAffineTransform(pts1, pts2)
+ cv2.warpAffine(warp, M, (cols * 2, rows * 2), dst, flags=cv2.INTER_AREA, borderMode=cv2.BORDER_TRANSPARENT)
+
+ # Sample back image size
+ dst = cv2.resize(dst, (cols, rows))
+
+ return dst
+
+
+ def computeAndLoadTextFontForSize(self, drawer, text, maxWidth):
+ # global textFont
+
+ # Measure text and find out position
+ maxSize = 50
+ minSize = 6
+ curSize = maxSize
+ while curSize >= minSize:
+ self.textFont = ImageFont.truetype(str(bundled_data_path(self))+'/impact.ttf', size=curSize)
+ w, h = drawer.textsize(text, font=self.textFont)
+
+ if w > maxWidth:
+ curSize -= 4
+ else:
+ return self.textFont
+ return self.textFont
+
+ def generateText(self, text):
+ # global impact, textFont
+
+ txtColor = (20, 20, 20)
+ bgColor = (224, 233, 237)
+ # bgColor = (100, 0, 0)
+ imgSize = (160, 200)
+
+ # Create image
+ image = Image.new("RGB", imgSize, bgColor)
+
+ # Draw text on top
+ draw = ImageDraw.Draw(image)
+
+ # Load font for text
+ if self.textFont == None:
+ self.textFont = self.computeAndLoadTextFontForSize(draw, text, imgSize[0])
+
+ w, h = draw.textsize(text, font=self.textFont)
+ xCenter = (imgSize[0] - w) / 2
+ yCenter = (50 - h) / 2
+ draw.text((xCenter, 10 + yCenter), text, font=self.textFont, fill=txtColor)
+ impact = ImageFont.truetype(str(bundled_data_path(self))+'/impact.ttf', 46)
+ draw.text((12, 70), "IS NOW", font=impact, fill=txtColor)
+ draw.text((10, 130), "ILLEGAL", font=impact, fill=txtColor)
+
+ # Convert to CV2
+ cvImage = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
+
+ # cv2.imshow('text', cvImage)
+
+ return cvImage
+
+ def cvImageToPillow(self, cvImage):
+ cvImage = cv2.cvtColor(cvImage, cv2.COLOR_BGR2RGB)
+ return Image.fromarray(cvImage)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/imagemaker/info.json b/imagemaker/info.json
new file mode 100644
index 0000000..f786252
--- /dev/null
+++ b/imagemaker/info.json
@@ -0,0 +1,29 @@
+{
+ "author":[
+ "TrustyJAID",
+ "Ivan Seidel (isnowillegal.com)",
+ "Bruno Lemos (isnowillegal.com)",
+ "Jo\u00e3o Pedro (isnowillegal.com)"
+ ],
+ "description":"Show how you really feel. Make someone beautiful. Make something illegal",
+ "install_msg":"Type [p]feels to see how you really feel.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Imagemaker",
+ "permissions":[
+ "attach_files"
+ ],
+ "requirements":[
+ "pillow",
+ "opencv-python",
+ "numpy"
+ ],
+ "short":"Create your own feels!",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/imgflip/__init__.py b/imgflip/__init__.py
new file mode 100644
index 0000000..7c41312
--- /dev/null
+++ b/imgflip/__init__.py
@@ -0,0 +1,4 @@
+from .imgflip import Imgflip
+
+def setup(bot):
+ bot.add_cog(Imgflip(bot))
diff --git a/imgflip/imgflip.py b/imgflip/imgflip.py
new file mode 100644
index 0000000..8d788b5
--- /dev/null
+++ b/imgflip/imgflip.py
@@ -0,0 +1,103 @@
+from redbot.core import commands, checks, Config
+from random import choice
+import aiohttp
+from typing import Union
+from redbot.core.utils.chat_formatting import pagify
+
+class Imgflip(getattr(commands, "Cog", object)):
+ """
+ Generate memes from imgflip.com API
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 356889977)
+ default_global = {"username": "", "password": ""}
+ self.config.register_global(**default_global)
+ self.url = "https://api.imgflip.com/caption_image"
+ self.search = "https://api.imgflip.com/get_memes"
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+
+ async def get_meme_id(self, meme):
+ url = self.search.format(await self.config.username(), await self.config.password())
+ try:
+ async with self.session.get(self.search) as r:
+ results = await r.json()
+ for memes in results["data"]["memes"]:
+ if meme.lower() in memes["name"].lower():
+ return memes["id"]
+ except:
+ return
+
+ @commands.command(alias=["listmemes"])
+ async def getmemes(self, ctx):
+ """List memes with names that can be used"""
+ await ctx.trigger_typing()
+ await self.get_memes(ctx)
+
+ async def get_memes(self, ctx):
+ url = self.search
+ async with self.session.get(self.search) as r:
+ results = await r.json()
+ memelist = ", ".join(m["name"] for m in results["data"]["memes"])
+ memelist += "Find a meme click blank template and get the Template ID for more!"
+ for page in pagify(memelist, [","]):
+ await ctx.send(page)
+
+
+ @commands.command()
+ async def meme(self, ctx, meme_name:Union[int, str], text_1:str=" ", text_2:str=" "):
+ """
+ Create custom memes from imgflip
+
+ All arguments with spaces require \"quotation marks\" to work
+ e.g. `[p]meme \"Two Buttons\" \"Make meme in discord\" \"Make meme in paint\"`
+
+ Do `[p]getmemes` to see which meme names will work
+
+ You can get meme ID's from https://imgflip.com/memetemplates
+ click blank template and use the Template ID in place of meme_name
+ """
+ await ctx.trigger_typing()
+
+ text_1 = text_1[:20] if len(text_1) > 20 else text_1
+ text_2 = text_2[:20] if len(text_2) > 20 else text_2
+ username = await self.config.username()
+ password = await self.config.password()
+ if type(meme_name) is str:
+ meme = await self.get_meme_id(meme_name)
+ else:
+ meme = meme_name
+ if meme is None:
+ await ctx.send("{} doesn't appear to be a meme I can use".format(meme_name))
+ try:
+ params = {
+ "template_id":meme,
+ "username": await self.config.username(),
+ "password": await self.config.password(),
+ "text0":text_1,
+ "text1":text_2
+
+ }
+ async with self.session.post(self.url, params=params) as r:
+ result = await r.json()
+ if result["success"]:
+ url = result["data"]["url"]
+ await ctx.send(url)
+ if not result["success"]:
+ await ctx.send(result["error_message"])
+ except Exception as e:
+ print(e)
+ await ctx.send("That meme wasn't found!")
+
+ @commands.command(name='imgflipset', aliases=["memeset"])
+ @checks.is_owner()
+ async def imgflip_set(self, ctx, username:str, password:str):
+ """Command for setting required access information for the API"""
+ await self.config.username.set(username)
+ await self.config.password.set(password)
+ await ctx.send("Credentials set!")
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/imgflip/info.json b/imgflip/info.json
new file mode 100644
index 0000000..ea4471e
--- /dev/null
+++ b/imgflip/info.json
@@ -0,0 +1,21 @@
+{
+ "author":[
+ "Twentysix",
+ "TrustyJAID"
+ ],
+ "description":"Recreation of Red v1 meme generator",
+ "install_msg":"Recreation of Red v1 meme generator cog!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"imgflip",
+ "permissions":[],
+ "requirements":[],
+ "short":"Recreation of Red v1 meme generator",
+ "tags":[
+ "memes",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/info.json b/info.json
new file mode 100644
index 0000000..c78f60c
--- /dev/null
+++ b/info.json
@@ -0,0 +1,9 @@
+{
+ "author" : "TrustyJAID",
+ "install_msg" : "Thanks for checking out my cogs!\nFor issues, bugs, or suggestions contact me in the discord support server here: https://discord.gg/c6HQUb7\nFor more information on my cogs go to my github here: ",
+ "name" : "Trusty-cogs",
+ "short" : "Numerous utility and fun commands",
+ "requirements" : [],
+ "description" : "Contains many cogs for fun like make your own badges and beautiful images, post tweets when they are made, or grab hockey goals and statistics.",
+ "tags" : ["Fun", "Hockey", "Images", "Badges"]
+}
\ No newline at end of file
diff --git a/insult/__init__.py b/insult/__init__.py
new file mode 100644
index 0000000..0c1e191
--- /dev/null
+++ b/insult/__init__.py
@@ -0,0 +1,5 @@
+from .insult import Insult
+
+def setup(bot):
+ n = Insult(bot)
+ bot.add_cog(n)
diff --git a/insult/info.json b/insult/info.json
new file mode 100644
index 0000000..c740ea6
--- /dev/null
+++ b/insult/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "Airen",
+ "JennJenn",
+ "TrustyJAID"
+ ],
+ "description":"Insult people in a creative way",
+ "install_msg":"Usage: `[p]insult `",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Insult",
+ "permissions":[],
+ "requirements":[],
+ "short":"Insult people in a creative way",
+ "tags":[
+ "insults",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/insult/insult.py b/insult/insult.py
new file mode 100644
index 0000000..ae25d4b
--- /dev/null
+++ b/insult/insult.py
@@ -0,0 +1,33 @@
+import discord
+from redbot.core import commands
+from random import choice
+import os
+from .insults import insults
+
+
+class Insult(getattr(commands, "Cog", object)):
+
+ """Airenkun's Insult Cog"""
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command(aliases=["takeitback"])
+ async def insult(self, ctx, user : discord.Member=None):
+ """
+ Insult the user
+
+ `user` the user you would like to insult
+ """
+
+ msg = ' '
+ if user != None:
+
+ if user.id == self.bot.user.id:
+ user = ctx.message.author
+ msg = [" How original. No one else had thought of trying to get the bot to insult itself. I applaud your creativity. Yawn. Perhaps this is why you don't have friends. You don't add anything new to any conversation. You are more of a bot than me, predictable answers, and absolutely dull to have an actual conversation with.", "What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Navy Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo."]
+ await ctx.send(user.mention + choice(msg))
+
+ else:
+ await ctx.send(user.mention + msg + choice(insults))
+ else:
+ await ctx.send(ctx.message.author.mention + msg + choice(insults))
diff --git a/insult/insults.py b/insult/insults.py
new file mode 100644
index 0000000..cd5561c
--- /dev/null
+++ b/insult/insults.py
@@ -0,0 +1,186 @@
+insults = [
+ "Yo Mama so fat she sued Xbox 360 for guessing her weight.",
+ "You're so fat that when you were diagnosed with a flesh eating bacteria - the doctors gave you 87 years to live.",
+ "You're so fat you've got more chins than a Hong Kong phone book.",
+ "Yo Mama so fat she's on both sides of the family.",
+ "Yo Mama so fat that even Dora couldn't explore her.",
+ "Yo Mama so fat that she doesn't need the internet; she's already world wide.",
+ "You're so fat that when you farted you started global warming.",
+ "You're so fat the back of your neck looks like a pack of hot-dogs.",
+ "You're so fat that when you fell from your bed you fell from both sides.",
+ "You're so fat when you get on the scale it says \"To be continued.\"",
+ "You're so fat when you go swimming the whales start singing \"We Are Family\".",
+ "You're so fat when you stepped on the scale, Buzz Lightyear popped out and said \"To infinity and beyond!\"",
+ "You're so fat when you turn around, people throw you a welcome back party.",
+ "You're so fat when you were in school you sat by everybody.",
+ "You're so fat when you went to the circus the little girl asked if she could ride the elephant.",
+ "You're so fat when you go on an airplane, you have to pay baggage fees for your ass.",
+ "You're so fat whenever you go to the beach the tide comes in.",
+ "You're so fat I could slap your butt and ride the waves.",
+ "You're so fat I'd have to grease the door frame and hold a Twinkie on the other side just to get you through.",
+ "Yo Mama so dumb I told her Christmas was around the corner and she went looking for it.",
+ "You're so dumb it took you 2 hours to watch 60 minutes.",
+ "Yo Mama so dumb she bought tickets to Xbox Live.",
+ "You're so dumb that you thought The Exorcist was a workout video.",
+ "You're so ugly that you went to the salon and it took 3 hours just to get an estimate.",
+ "You're so ugly that even Scooby Doo couldn't solve that mystery.",
+ "What is the weighted center between Planet X and Planet Y? Oh it's YOU!",
+ ":eggplant: :eggplant: :eggplant:",
+ "Your birth certificate is an apology letter from the condom factory.",
+ "I wasn't born with enough middle fingers to let you know how I feel about you.",
+ "You must have been born on a highway because that's where most accidents happen.",
+ "I'm jealous of all the people that haven't met you.",
+ "I bet your brain feels as good as new, seeing that you never use it.",
+ "I'm not saying I hate you, but I would unplug your life support to charge my phone.",
+ "You're so ugly, when your mom dropped you off at school she got a fine for littering.",
+ "You bring everyone a lot of joy, when you leave the room.",
+ "What's the difference between you and eggs? Eggs get laid and you don't.",
+ "You're as bright as a black hole, and twice as dense.",
+ "I tried to see things from your perspective, but I couldn't seem to shove my head that far up my ass.",
+ "Two wrongs don't make a right, take your parents as an example.",
+ "You're the reason the gene pool needs a lifeguard.",
+ "If laughter is the best medicine, your face must be curing the world.",
+ "You're so ugly, when you popped out the doctor said \"Aww what a treasure\" and your mom said \"Yeah, lets bury it.\"",
+ "I have neither the time nor the crayons to explain this to you.",
+ "You have two brains cells, one is lost and the other is out looking for it.",
+ "How many times do I have to flush to get rid of you?",
+ "I don't exactly hate you, but if you were on fire and I had water, I'd drink it.",
+ "You shouldn't play hide and seek, no one would look for you.",
+ "Some drink from the fountain of knowledge; you only gargled.",
+ "Roses are red violets are blue, God made me pretty, what happened to you?",
+ "It's better to let someone think you are an Idiot than to open your mouth and prove it.",
+ "Somewhere out there is a tree, tirelessly producing oxygen so you can breathe. I think you owe it an apology.",
+ "The last time I saw a face like yours I fed it a banana.",
+ "The only way you'll ever get laid is if you crawl up a chicken's ass and wait.",
+ "Which sexual position produces the ugliest children? Ask your mother.",
+ "If you really want to know about mistakes, you should ask your parents.",
+ "At least when I do a handstand my stomach doesn't hit me in the face.",
+ "If I gave you a penny for your thoughts, I'd get change.",
+ "If I were to slap you, it would be considered animal abuse.",
+ "Do you know how long it takes for your mother to take a crap? Nine months.",
+ "What are you going to do for a face when the baboon wants his butt back?",
+ "Well I could agree with you, but then we'd both be wrong.",
+ "You're so fat, you could sell shade.",
+ "It looks like your face caught on fire and someone tried to put it out with a hammer.",
+ "You're not funny, but your life, now that's a joke.",
+ "You're so fat the only letters of the alphabet you know are KFC.",
+ "Oh my God, look at you. Was anyone else hurt in the accident?",
+ "What are you doing here? Did someone leave your cage open?",
+ "You're so ugly, the only dates you get are on a calendar.",
+ "I can explain it to you, but I can't understand it for you.",
+ "You are proof that God has a sense of humor.",
+ "If you spoke your mind, you'd be speechless.",
+ "Why don't you check eBay and see if they have a life for sale.",
+ "If I wanted to hear from an asshole, I'd fart.",
+ "You're so fat you need cheat codes to play Wii Fit",
+ "You're so ugly, when you got robbed, the robbers made you wear their masks.",
+ "Do you still love nature, despite what it did to you?",
+ "You are proof that evolution CAN go in reverse.",
+ "I'll never forget the first time we met, although I'll keep trying.",
+ "Your parents hated you so much your bath toys were an iron and a toaster",
+ "Don't feel sad, don't feel blue, Frankenstein was ugly too.",
+ "You're so ugly, you scared the crap out of the toilet.",
+ "It's kinda sad watching you attempt to fit your entire vocabulary into a sentence.",
+ "I fart to make you smell better.",
+ "You're so ugly you make blind kids cry.",
+ "You're a person of rare intelligence. It's rare when you show any.",
+ "You're so fat, when you wear a yellow rain coat people scream ''taxi''.",
+ "I heard you went to a haunted house and they offered you a job.",
+ "You look like a before picture.",
+ "If your brain was made of chocolate, it wouldn't fill an M&M.",
+ "Aww, it's so cute when you try to talk about things you don't understand.",
+ "I heard your parents took you to a dog show and you won.",
+ "You stare at frozen juice cans because they say, \"concentrate\".",
+ "You're so stupid you tried to wake a sleeping bag.",
+ "Am I getting smart with you? How would you know?",
+ "We all sprang from apes, but you didn't spring far enough.",
+ "I'm no proctologist, but I know an asshole when I see one.",
+ "When was the last time you could see your whole body in the mirror?",
+ "You must have a very low opinion of people if you think they are your equals.",
+ "So, a thought crossed your mind? Must have been a long and lonely journey.",
+ "You're the best at all you do - and all you do is make people hate you.",
+ "Looks like you fell off the ugly tree and hit every branch on the way down.",
+ "Looks aren't everything; in your case, they aren't anything.",
+ "You have enough fat to make another human.",
+ "You're so ugly, when you threw a boomerang it didn't come back.",
+ "You're so fat a picture of you would fall off the wall!",
+ "Your hockey team made you goalie so you'd have to wear a mask.",
+ "Ordinarily people live and learn. You just live.",
+ "Did your parents ever ask you to run away from home?",
+ "I heard you took an IQ test and they said your results were negative.",
+ "You're so ugly, you had tinted windows on your incubator.",
+ "Don't you need a license to be that ugly?",
+ "I'm not saying you're fat, but it looks like you were poured into your clothes and someone forgot to say \"when\"",
+ "I've seen people like you, but I had to pay admission!",
+ "I hear the only place you're ever invited is outside.",
+ "Keep talking, someday you'll say something intelligent!",
+ "You couldn't pour water out of a boot if the instructions were on the heel.",
+ "Even if you were twice as smart, you'd still be stupid!",
+ "You're so fat, you have to use a mattress as a maxi-pad.",
+ "I may be fat, but you're ugly, and I can lose weight.",
+ "I was pro life before I met you.",
+ "What's the difference between you and Hitler? Hitler knew when to kill himself.",
+ "You're so fat, your double chin has a double chin.",
+ "If ignorance is bliss, you must be the happiest person on earth.",
+ "You're so stupid, it takes you an hour to cook minute rice.",
+ "Is that your face? Or did your neck just throw up?",
+ "You're so ugly you have to trick or treat over the phone.",
+ "I'd hit you but we don't hit girls around here.",
+ "Dumbass.",
+ "Bitch.",
+ "I'd give you a nasty look but you've already got one.",
+ "If I wanted a bitch, I'd have bought a dog.",
+ "Scientists say the universe is made up of neutrons, protons and electrons. They forgot to mention morons.",
+ "Why is it acceptable for you to be an idiot but not for me to point it out?",
+ "Did you know they used to be called \"Jumpolines\" until your mum jumped on one?",
+ "You're not stupid; you just have bad luck when thinking.",
+ "I thought of you today. It reminded me to take the garbage out.",
+ "I'm sorry I didn't get that - I don't speak idiot.",
+ "Hey, your village called \u2013 they want their idiot back.",
+ "I just stepped in something that was smarter than you\u2026 and smelled better too.",
+ "You're so fat that at the zoo the elephants started throwing you peanuts.",
+ "You're so fat every time you turn around, it's your birthday.",
+ "You're so fat your idea of dieting is deleting the cookies from your internet cache.",
+ "You're so fat your shadow weighs 35 pounds.",
+ "You're so fat I could tell you to haul ass and you'd have to make two trips.",
+ "You're so fat I took a picture of you at Christmas and it's still printing.",
+ "You're so fat I tried to hang a picture of you on my wall, and my wall fell over.",
+ "You're so fat Mount Everest tried to climb you.",
+ "You're so fat you can't even jump to a conclusion.",
+ "You're so fat you can't fit in any timeline.",
+ "You're so fat you can't fit in this joke.",
+ "You're so fat you don't skinny dip, you chunky dunk.",
+ "You're so fat you fell in love and broke it.",
+ "You're so fat you go to KFC and lick other peoples' fingers.",
+ "You're so fat you got arrested at the airport for ten pounds of crack.",
+ "You're so fat you'd have to go to Sea World to get baptized.",
+ "You're so fat you have your own zip code.",
+ "You're so fat you have more rolls than a bakery.",
+ "You're so fat you don't have got cellulite, you've got celluheavy.",
+ "You're so fat you influence the tides.",
+ "You're so fat you jumped off the Grand Canyon and got stuck.",
+ "You're so fat that you laid on the beach and Greenpeace tried to push you back in the water.",
+ "You're so fat you leave footprints in concrete.",
+ "You're so fat you need GPS to find your asshole.",
+ "You're so fat you pull your pants down and your ass is still in them.",
+ "You're so fat you show up on radar.",
+ "If you were any less intelligent we'd have to water you three times a week..",
+ "If your IQ was 3 points higher, you'd be a rock.",
+ "I would insult you but nature did a better job.",
+ "Does your ass get jealous of all the shit that comes out of your mouth?",
+ "If I ate a bowl of alphabet soup, I could shit out a smarter sentence than any of yours.",
+ "You're not pretty enough to be this stupid.",
+ "That little voice in the back of your head, telling you you'll never be good enough? It's right.",
+ "You look like you're going to spend your life having one epiphany after another, always thinking you've finally figured out what's holding you back, and how you can finally be productive and creative and turn your life around. But nothing will ever change. That cycle of mediocrity isn't due to some obstacle. It's who you *are*. The thing standing in the way of your dreams is; that the person having them is *you*.",
+ "May your day and future be as pleasant as you are.",
+ "I would agree with you but then we would both be wrong.",
+ "I bite my thumb at you, sir.",
+ "I'd call you a tool, but that would imply you were useful in at least one way.",
+ "I hope you outlive your children.",
+ "Are you and your dick having a competition to see who can disappoint me the most?",
+ "Yo mamma is so ugly her portraits hang themselves.",
+ "Your birth certificate is an apology from the abortion clinic.",
+ "If you were anymore inbred you'd be a sandwich.",
+ "Say hello to your wife and my kids for me.",
+ "You are thick-headed bastards with a bloated bureaucracy, designed to compensate for your small and poor self-esteem, cocksuckers. You have the brains to ban the person who has come to support channel your bot, accusing him of violating the ephemeral ephemeral rules, stupid morons. By the way i have one of the biggest server(5.5k people, ~30 anytime voiceonline members), and i know something about managing, and of these rules - dont be an asshole. You are fucking asshole, maybe it is product of your life alone, or your life with your mom, anyway - you are retard and your soul is a fucking bunch of stupid self-esteems."
+]
\ No newline at end of file
diff --git a/juche/__init__.py b/juche/__init__.py
new file mode 100644
index 0000000..0ac9142
--- /dev/null
+++ b/juche/__init__.py
@@ -0,0 +1,4 @@
+from .juche import Juche
+
+def setup(bot):
+ bot.add_cog(Juche(bot))
\ No newline at end of file
diff --git a/juche/info.json b/juche/info.json
new file mode 100644
index 0000000..80492fb
--- /dev/null
+++ b/juche/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Have the bot correct the current year to the Juche Calendar",
+ "install_msg":"Various commands.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Juche",
+ "permissions":[],
+ "requirements":[],
+ "short":"General commands",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/juche/juche.py b/juche/juche.py
new file mode 100644
index 0000000..b80d630
--- /dev/null
+++ b/juche/juche.py
@@ -0,0 +1,46 @@
+import discord
+from redbot.core import commands, Config
+
+class Juche(getattr(commands, "Cog", object)):
+ """
+ Convert dates into the juche calendar
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 4563465345472)
+ default = {"correct_juche":False}
+ self.config.register_guild(**default)
+
+ async def check_date(self, message):
+ for i in range(1912, 2100):
+ if str(i) in message.split(" ") and "http" not in message:
+ message = message.replace(str(i), "Juche " + str(i-1912+1))
+ message = "I think you mean Juche " + str(i-1912+1) + "."
+ return message
+
+ return None
+
+ @commands.command()
+ async def juche(self, ctx):
+ """
+ Toggle the bot correcting dates in messages with the juche calendar
+ """
+ if await self.config.guild(ctx.guild).correct_juche():
+ await self.config.guild(ctx.guild).correct_juche.set(False)
+ await ctx.send("No longer correcting dates to the Juche calendar.")
+ else:
+ await self.config.guild(ctx.guild).correct_juche.set(True)
+ await ctx.send("Now correcting dates to the Juche calendar.")
+
+ async def on_message(self, message):
+ msg = message.content
+ if not hasattr(message, "guild"):
+ return
+ guild = message.guild
+ channel = message.channel
+
+ if await self.config.guild(guild).correct_juche():
+ juche = await self.check_date(msg)
+ if juche != None:
+ await channel.send(juche)
diff --git a/mock/__init__.py b/mock/__init__.py
new file mode 100644
index 0000000..32c144d
--- /dev/null
+++ b/mock/__init__.py
@@ -0,0 +1,4 @@
+from .mock import Mock
+
+def setup(bot):
+ bot.add_cog(Mock(bot))
diff --git a/mock/info.json b/mock/info.json
new file mode 100644
index 0000000..6731cfe
--- /dev/null
+++ b/mock/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Mock another user!",
+ "install_msg":"Type `[p]mock` to mock the last user to post.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Mock",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Mock another user!",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/mock/mock.py b/mock/mock.py
new file mode 100644
index 0000000..c202c2f
--- /dev/null
+++ b/mock/mock.py
@@ -0,0 +1,60 @@
+import discord
+import random
+from redbot.core import commands
+
+class Mock(getattr(commands, "Cog", object)):
+ """mock a user as spongebob"""
+
+ def __init__(self, bot):
+ self.bot = bot
+
+ def cap_change(self, message):
+ result = ""
+ for char in message:
+ value = random.choice([True, False])
+ if value:
+ result += char.upper()
+ else:
+ result += char.lower()
+ return result
+
+ @commands.command(pass_context=True)
+ async def mock(self, ctx, *, msg=""):
+ """
+ Mock a user with the spongebob meme
+
+ `msg` can be either custom message or message ID
+ if no `msg` is provided the command will use the last message in chat before the command
+ """
+ channel = ctx.message.channel
+ result = ""
+ user = ctx.message.author
+ if msg:
+ if msg.isdigit():
+ async for message in channel.history(limit=100):
+ if str(message.id) == msg:
+ msg = message
+ break
+ else:
+ async for message in channel.history(limit=2):
+ msg = message
+ result = self.cap_change(msg.content) if hasattr(msg, "content") else self.cap_change(msg)
+ author = msg.author if hasattr(msg, "author") else ctx.message.author
+ time = msg.created_at if hasattr(msg, "created_at") else ctx.message.created_at
+ embed = discord.Embed(description=result, timestamp=time)
+ embed.colour = author.colour if hasattr(author, "colour") else discord.Colour.default()
+ embed.set_author(name=author.display_name, icon_url=author.avatar_url)
+ embed.set_thumbnail(url="https://i.imgur.com/upItEiG.jpg")
+ embed.set_footer(text="{} mocked {}".format(
+ ctx.message.author.display_name, author.display_name), icon_url=ctx.message.author.avatar_url)
+ if hasattr(msg, "attachments") and msg.attachments != []:
+ embed.set_image(url=msg.attachments[0].url)
+ if not channel.permissions_for(ctx.me).embed_links:
+ if author != user:
+ await ctx.send(result + " - " + author.mention)
+ else:
+ await ctx.send(result)
+ else:
+ await ctx.send(embed=embed)
+ if author != user:
+ await ctx.send("- " + author.mention)
diff --git a/modlogs/__init__.py b/modlogs/__init__.py
new file mode 100644
index 0000000..3a2c164
--- /dev/null
+++ b/modlogs/__init__.py
@@ -0,0 +1,4 @@
+from .modlogs import ModLogs
+
+def setup(bot):
+ bot.add_cog(ModLogs(bot))
\ No newline at end of file
diff --git a/modlogs/info.json b/modlogs/info.json
new file mode 100644
index 0000000..5d9e69b
--- /dev/null
+++ b/modlogs/info.json
@@ -0,0 +1,20 @@
+{
+ "author":[
+ "RePulsR",
+ "TrustyJAID"
+ ],
+ "description":"Modlogs, log message deletes, edits, user activity, bans and much more",
+ "install_msg":"Thanks for adding my repo! hope you find any of my cogs cool",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Modlogs",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Modlogs, log message deletes, edits, user activity, bans and much more",
+ "tags":[]
+}
\ No newline at end of file
diff --git a/modlogs/modlogs.py b/modlogs/modlogs.py
new file mode 100644
index 0000000..aeb7ba2
--- /dev/null
+++ b/modlogs/modlogs.py
@@ -0,0 +1,633 @@
+from redbot.core import commands
+from redbot.core import checks
+from redbot.core import Config
+import datetime
+import discord
+import asyncio
+import os
+from random import choice, randint
+
+inv_settings = {"embed": False, "Channel": None, "toggleedit": False, "toggledelete": False, "toggleuser": False,
+ "toggleroles": False,
+ "togglevoice": False,
+ "toggleban": False, "togglejoin": False, "toggleleave": False, "togglechannel": False,
+ "toggleguild": False}
+
+
+class ModLogs(getattr(commands, "Cog", object)):
+ """
+ Custom modlogs with embeds
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 154457677895)
+ self.config.register_guild(**inv_settings)
+
+ @checks.admin_or_permissions(administrator=True)
+ @commands.group(name='modlogtoggle', )
+ async def modlogtoggles(self, ctx):
+ """toggle which guild activity to log"""
+ if await self.config.guild(ctx.message.guild).settings() == {}:
+ await self.config.guild(ctx.message.guild).set(inv_settings)
+ if ctx.invoked_subcommand is None:
+ guild = ctx.message.guild
+
+ try:
+ e = discord.Embed(title="Setting for {}".format(guild.name), colour=discord.Colour.blue())
+ e.description = "ModLogs channel set to {}".format(self.bot.get_channel(id=await self.config.guild(guild).Channel()).mention)
+ e.add_field(name="Delete", value=str(await self.config.guild(guild).toggledelete()))
+ e.add_field(name="Edit", value=str(await self.config.guild(guild).toggleedit()))
+ e.add_field(name="Roles", value=str(await self.config.guild(guild).toggleroles()))
+ e.add_field(name="User", value=str(await self.config.guild(guild).toggleuser()))
+ e.add_field(name="Voice", value=str(await self.config.guild(guild).togglevoice()))
+ e.add_field(name="Ban", value=str(await self.config.guild(guild).toggleban()))
+ e.add_field(name="Join", value=str(await self.config.guild(guild).togglejoin()))
+ e.add_field(name="Leave", value=str(await self.config.guild(guild).toggleleave()))
+ e.add_field(name="Channel", value=str(await self.config.guild(guild).togglechannel()))
+ e.add_field(name="guild", value=str(await self.config.guild(guild).toggleguild()))
+ e.set_thumbnail(url=guild.icon_url)
+ await ctx.send(embed=e)
+ except Exception as e:
+ print(e)
+ return
+
+ @checks.admin_or_permissions(administrator=True)
+ @commands.group()
+ async def modlogsetup(self, ctx):
+ """Change modlog settings"""
+ pass
+
+ @modlogsetup.command(name='channel')
+ async def _channel(self, ctx):
+ """Set the channel to send notifications too"""
+ guild = ctx.message.guild
+ # print(guild)
+ if ctx.message.guild.me.permissions_in(ctx.message.channel).send_messages:
+ # print(await self.config.guild(guild).Channel())
+ if await self.config.guild(guild).Channel() is not None:
+ await self.config.guild(guild).Channel.set(ctx.message.channel.id)
+ await ctx.send("Channel changed.")
+ return
+ else:
+ await self.config.guild(guild).Channel.set(ctx.message.channel.id)
+ await ctx.send("I will now send toggled modlog notifications here")
+ else:
+ return
+
+ @modlogsetup.command()
+ async def embed(self, ctx):
+ """Enables or disables embed modlog."""
+ guild = ctx.message.guild
+ if await self.config.guild(guild).embed() == False:
+ await self.config.guild(guild).embed.set(True)
+
+ await ctx.send("Enabled embed modlog.")
+ elif await self.config.guild(guild).embed() == True:
+ await self.config.guild(guild).embed.set(False)
+
+ await ctx.send("Disabled embed modlog.")
+
+ @modlogsetup.command()
+ async def disable(self, ctx):
+ """disables the modlog"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).Channel() is None:
+ await ctx.send("guild not found, use modlogsetup to set a channnel")
+ return
+ await self.config.guild(guild).Channel.set(None)
+
+ await ctx.send("I will no longer send modlog notifications here")
+
+ @modlogtoggles.command()
+ async def edit(self, ctx):
+ """toggle notifications when a member edits their message"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleedit() == False:
+ await self.config.guild(guild).toggleedit.set(True)
+
+ await ctx.send("Edit messages enabled")
+ elif await self.config.guild(guild).toggleedit() == True:
+ await self.config.guild(guild).toggleedit.set(False)
+
+ await ctx.send("Edit messages disabled")
+
+ @modlogtoggles.command()
+ async def join(self, ctx):
+ """toggles notofications when a member joins the guild."""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).togglejoin() == False:
+ await self.config.guild(guild).togglejoin.set(True)
+
+ await ctx.send("Enabled join logs.")
+ elif await self.config.guild(guild).togglejoin() == True:
+ await self.config.guild(guild).togglejoin.set(False)
+
+ await ctx.send("Disabled join logs.")
+
+ @modlogtoggles.command()
+ async def guild(self, ctx):
+ """toggles notofications when the guild updates."""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleguild() == False:
+ await self.config.guild(guild).toggleguild.set(True)
+
+ await ctx.send("Enabled guild logs.")
+ elif await self.config.guild(guild).toggleguild() == True:
+ await self.config.guild(guild).toggleguild.set(False)
+
+ await ctx.send("Disabled guild logs.")
+
+ @modlogtoggles.command()
+ async def channel(self, ctx):
+ """toggles channel update logging for the guild."""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).togglechannel() == False:
+ await self.config.guild(guild).togglechannel.set(True)
+
+ await ctx.send("Enabled channel logs.")
+ elif await self.config.guild(guild).togglechannel() == True:
+ await self.config.guild(guild).togglechannel.set(False)
+
+ await ctx.send("Disabled channel logs.")
+
+ @modlogtoggles.command()
+ async def leave(self, ctx):
+ """toggles notofications when a member leaves the guild."""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleleave() == False:
+ await self.config.guild(guild).toggleleave.set(True)
+
+ await ctx.send("Enabled leave logs.")
+ elif await self.config.guild(guild).toggleleave() == True:
+ await self.config.guild(guild).toggleleave.set(False)
+
+ await ctx.send("Disabled leave logs.")
+
+ @modlogtoggles.command()
+ async def delete(self, ctx):
+ """toggle notifications when a member delete theyre message"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggledelete() == False:
+ await self.config.guild(guild).toggledelete.set(True)
+
+ await ctx.send("Delete messages enabled")
+ elif await self.config.guild(guild).toggledelete() == True:
+ await self.config.guild(guild).toggledelete.set(False)
+
+ await ctx.send("Delete messages disabled")
+
+ @modlogtoggles.command()
+ async def user(self, ctx):
+ """toggle notifications when a user changes their profile"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleuser() == False:
+ await self.config.guild(guild).toggleuser.set(True)
+
+ await ctx.send("User messages enabled")
+ elif await self.config.guild(guild).toggleuser() == True:
+ await self.config.guild(guild).toggleuser.set(False)
+
+ await ctx.send("User messages disabled")
+
+ @modlogtoggles.command()
+ async def roles(self, ctx):
+ """toggle notifications when roles change"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleroles() == False:
+ await self.config.guild(guild).toggleroles.set(True)
+ await ctx.send("Role messages enabled")
+ elif await self.config.guild(guild).toggleroles() == True:
+ await self.config.guild(guild).toggleroles.set(False)
+ await ctx.send("Role messages disabled")
+
+ @modlogtoggles.command()
+ async def voice(self, ctx):
+ """toggle notifications when voice status change"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).togglevoice() == False:
+ await self.config.guild(guild).togglevoice.set(True)
+ await ctx.send("Voice messages enabled")
+ elif await self.config.guild(guild).togglevoice() == True:
+ await self.config.guild(guild).togglevoice.set(False)
+ await ctx.send("Voice messages disabled")
+
+ @modlogtoggles.command()
+ async def ban(self, ctx):
+ """toggle notifications when a user is banned"""
+ guild = ctx.message.guild
+
+ if await self.config.guild(guild).toggleban() == False:
+ await self.config.guild(guild).toggleban.set(True)
+
+ await ctx.send("Ban messages enabled")
+ elif await self.config.guild(guild).toggleban() == True:
+ await self.config.guild(guild).toggleban.set(False)
+
+ await ctx.send("Ban messages disabled")
+
+ async def on_message_delete(self, message):
+ guild = message.guild
+
+ if await self.config.guild(guild).Channel() is None:
+ return
+ if await self.config.guild(guild).toggledelete() == False:
+ return
+ if message.author is message.author.bot:
+ pass
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ cleanmsg = message.content
+ for i in message.mentions:
+ cleanmsg = cleanmsg.replace(i.mention, str(i))
+ fmt = '%H:%M:%S'
+ if await self.config.guild(guild).embed() == True:
+ name = message.author
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ infomessage = "A message by {}, was deleted in {}".format(message.author.mention, message.channel.mention)
+ delmessage = discord.Embed(description=infomessage, colour=discord.Color.purple(), timestamp=time)
+ delmessage.add_field(name="Message:", value=cleanmsg)
+ delmessage.set_footer(text="User ID: {}".format(message.author.id), icon_url=message.author.avatar_url)
+ delmessage.set_author(name=name + " - Deleted Message", url="http://i.imgur.com/fJpAFgN.png", icon_url=message.author.avatar_url)
+ delmessage.set_thumbnail(url="http://i.imgur.com/fJpAFgN.png")
+ try:
+ await guild.get_channel(channel).send( embed=delmessage)
+ except:
+ pass
+ else:
+ msg = ":pencil: `{}` **Channel** {} **{}'s** message has been deleted. Content: {}".format(
+ time.strftime(fmt), message.channel.mention, message.author, cleanmsg)
+ await guild.get_channel(channel).send(
+ msg)
+
+ async def on_member_join(self, member):
+ guild = member.guild
+
+ if await self.config.guild(guild).togglejoin() == False:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ users = len([e.name for e in guild.members])
+ if await self.config.guild(guild).embed() == True:
+ name = member
+ # name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ joinmsg = discord.Embed(description=member.mention, colour=discord.Color.red(), timestamp=member.joined_at)
+ # infomessage = "Total Users: {}".format(users)
+ joinmsg.add_field(name="Total Users:", value=str(users), inline=True)
+ joinmsg.set_footer(text="User ID: {}".format(member.id), icon_url=member.avatar_url)
+ joinmsg.set_author(name=name.display_name + " has joined the guild",url=member.avatar_url, icon_url=member.avatar_url)
+ joinmsg.set_thumbnail(url=member.avatar_url)
+ try:
+ await guild.get_channel(channel).send( embed=joinmsg)
+ except:
+ pass
+ if await self.config.guild(guild).embed() == False:
+ msg = ":white_check_mark: `{}` **{}** join the guild. Total users: {}.".format(time.strftime(fmt),
+ member.name, users)
+ await guild.get_channel(channel).send( msg)
+
+ async def on_member_remove(self, member):
+ guild = member.guild
+
+ if await self.config.guild(guild).toggleleave() == False:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = "%H:%M:%S"
+ users = len([e.name for e in guild.members])
+ if await self.config.guild(guild).embed() == True:
+ name = member
+ # name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ joinmsg = discord.Embed(description=member.mention, colour=discord.Color.red(), timestamp=time)
+ # infomessage = "Total Users: {}".format(users)
+ joinmsg.add_field(name="Total Users:", value=str(users), inline=True)
+ joinmsg.set_footer(text="User ID: {}".format(member.id), icon_url=member.avatar_url)
+ joinmsg.set_author(name=name.display_name + " has left the guild",url=member.avatar_url, icon_url=member.avatar_url)
+ joinmsg.set_thumbnail(url=member.avatar_url)
+ try:
+ await guild.get_channel(channel).send( embed=joinmsg)
+ except:
+ pass
+ if await self.config.guild(guild).embed() == False:
+ msg = ":x: `{}` **{}** has left the guild or was kicked. Total members {}.".format(time.strftime(fmt),
+ member.name, users)
+ await guild.get_channel(channel).send( msg)
+
+ async def on_channel_update(self, before, after):
+ guild = before.guild
+
+ if await self.config.guild(guild).togglechannel() == False:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = "%H:%M:%S"
+ msg = ""
+ if before.name != after.name:
+ if before.type == discord.ChannelType.voice:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ voice1 = discord.Embed(colour=discord.Color.blue(), timestamp=time)
+ infomessage = ":loud_sound: Voice channel name update. Before: **{}** After: **{}**.".format(
+ before.name, after.name)
+ voice1.add_field(name="Info:", value=infomessage, inline=False)
+ voice1.set_author(name=time.strftime(fmt) + " - Voice Channel Update",
+ icon_url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ voice1.set_thumbnail(
+ url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ try:
+ await guild.get_channel(channel).send( embed=voice1)
+ except:
+ pass
+ else:
+ fmt = "%H:%M:%S"
+ await guild.get_channel(channel).send(
+ ":loud_sound: `{}` Voice channel name update. Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.name, after.name))
+ if before.type == discord.ChannelType.text:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ text1 = discord.Embed(colour=discord.Color.blue(), timestamp=time)
+ infomessage = ":loud_sound: Text channel name update. Before: **{}** After: **{}**.".format(
+ before.name, after.name)
+ text1.add_field(name="Info:", value=infomessage, inline=False)
+ text1.set_author(name=time.strftime(fmt) + " - Voice Channel Update",
+ icon_url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ text1.set_thumbnail(
+ url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ await guild.get_channel(channel).send( embed=text1)
+ else:
+ fmt = "%H:%M:%S"
+ await guild.get_channel(channel).send(
+ ":page_facing_up: `{}` Text channel name update. Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.name, after.name))
+ if before.topic != after.topic:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ topic = discord.Embed(colour=discord.Colour.blue(), timestamp=time)
+ infomessage = ":page_facing_up: `{}` Channel topic has been updated.\n**Before:** {}\n**After:** {}".format(
+ time.strftime(fmt), before.topic, after.topic)
+ topic.add_field(name="Info:", value=infomessage, inline=False)
+ topic.set_author(name=time.strftime(fmt) + " - Channel Topic Update",
+ icon_url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ topic.set_thumbnail(
+ url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ try:
+ await self.send_message(guild.get_channel(channel), embed=topic)
+ except:
+ pass
+ else:
+ fmt = "%H:%M:%S"
+ await guild.get_channel(channel).send(
+ ":page_facing_up: `{}` Channel topic has been updated.\n**Before:** {}\n**After:** {}".format(
+ time.strftime(fmt), before.topic, after.topic))
+ if before.position != after.position:
+ if before.type == discord.ChannelType.voice:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ voice2 = discord.Embed(colour=discord.Colour.blue(), timestamp=time)
+ voice2.set_thumbnail(
+ url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ voice2.set_author(name=time.strftime(fmt) + " Voice Channel Position Update",
+ icon_url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ infomsg = ":loud_sound: Voice channel position update. Channel: **{}** Before: **{}** After: **{}**.".format(
+ before.name, before.position, after.position)
+ voice2.add_field(name="Info:", value=infomsg, inline=False)
+ try:
+ await guild.get_channel(channel).send( embed=voice2)
+ except:
+ pass
+ else:
+ fmt = "%H:%M:%S"
+ await guild.get_channel(channel).send(
+ ":loud_sound: `{}` Voice channel position update. Channel: **{}** Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.name, before.position, after.position))
+ if before.type == discord.ChannelType.text:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ text2 = discord.Embed(colour=discord.Colour.blue(), timestamp=time)
+ text2.set_thumbnail(
+ url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ text2.set_author(name=time.strftime(fmt) + " Text Channel Position Update",
+ icon_url="https://s-media-cache-ak0.pinimg.com/originals/27/18/77/27187782801d15f756a27156105d1233.png")
+ infomsg = ":page_facing_up: Text channel position update. Before: **{}** After: **{}**.".format(
+ before.position, after.position)
+ text2.add_field(name="Info:", value=infomsg, inline=False)
+ try:
+ await guild.get_channel(channel).send( embed=text2)
+ except:
+ pass
+ else:
+ fmt = "%H:%M:%S"
+ await guild.get_channel(channel).send(
+ ":page_facing_up: `{}` Text channel position update. Channel: **{}** Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.name, before.position, after.position))
+ if before.bitrate != after.bitrate:
+ if await self.config.guild(guild).embed() == True:
+ fmt = "%H:%M:%S"
+ bitrate = discord.Embed(colour=discord.Colour.blue(), timestamp=time)
+ bitrate.set_author(name=time.strftime(fmt) + " Voice Channel Bitrate Update",
+ icon_url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ bitrate.set_thumbnail(
+ url="http://www.hey.fr/fun/emoji/twitter/en/icon/twitter/565-emoji_twitter_speaker_with_three_sound_waves.png")
+ infomsg = ":loud_sound: Voice Channel bitrate update. Before: **{}** After: **{}**.".format(
+ before.bitrate, after.bitrate)
+ bitrate.add_field(name="Info:", value=infomsg, inline=False)
+ try:
+ await sef.bot.send_message(guild.get_channel(channel), embed=bitrate)
+ except:
+ pass
+ else:
+ await guild.get_channel(channel).send(
+ ":loud_sound: `{}` Channel bitrate update. Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.bitrate, after.bitrate))
+
+ async def on_message_edit(self, before, after):
+ guild = before.guild
+
+ if before.author.bot:
+ return
+ if await self.config.guild(guild).toggleedit() == False:
+ return
+ if before.content == after.content:
+ return
+ cleanbefore = before.content
+ for i in before.mentions:
+ cleanbefore = cleanbefore.replace(i.mention, str(i))
+ cleanafter = after.content
+ for i in after.mentions:
+ cleanafter = cleanafter.replace(i.mention, str(i))
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ if await self.config.guild(guild).embed() == True:
+ name = before.author
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+
+ infomessage = "A message by {}, was edited in {}".format(before.author.mention, before.channel.mention)
+ delmessage = discord.Embed(description=infomessage, colour=discord.Color.green(), timestamp=after.created_at)
+ delmessage.add_field(name="Before Message:", value=cleanbefore, inline=False)
+ delmessage.add_field(name="After Message:", value=cleanafter)
+ delmessage.set_footer(text="User ID: {}".format(before.author.id), icon_url=before.author.avatar_url)
+ delmessage.set_author(name=name + " - Edited Message", url="http://i.imgur.com/Q8SzUdG.png", icon_url=before.author.avatar_url)
+ delmessage.set_thumbnail(url="http://i.imgur.com/Q8SzUdG.png")
+ try:
+ await guild.get_channel(channel).send( embed=delmessage)
+ except:
+ pass
+ else:
+ msg = ":pencil: `{}` **Channel**: {} **{}'s** message has been edited.\nBefore: {}\nAfter: {}".format(
+ time.strftime(fmt), before.channel.mention, before.author, cleanbefore, cleanafter)
+ await guild.get_channel(channel).send(msg)
+
+ async def on_guild_update(self, before, after):
+ guild = before
+
+ if await self.config.guild(guild).toggleguild() == False:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ if before.name != after.name:
+ msg = ":globe_with_meridians: `{}` guild name update. Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.name, after.name)
+ if before.region != after.region:
+ msg = ":globe_with_meridians: `{}` guild region update. Before: **{}** After: **{}**.".format(
+ time.strftime(fmt), before.region, after.region)
+ await guild.get_channel(channel).send(msg)
+
+ async def on_voice_state_update(self, member, before, after):
+ try:
+ guild = before.channel.guild
+ except:
+ guild = after.channel.guild
+
+ if await self.config.guild(guild).togglevoice() == False:
+ return
+ if member.bot:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ if await self.config.guild(guild).embed() == True:
+ name = member
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ updmessage = discord.Embed(description=name, colour=discord.Color.blue(), timestamp=time)
+ infomessage = "__{}__'s voice status has changed".format(member.name)
+ updmessage.add_field(name="Info:", value=infomessage, inline=False)
+ updmessage.add_field(name="Voice Channel Before:", value=before.channel)
+ updmessage.add_field(name="Voice Channel After:", value=after.channel)
+ updmessage.set_footer(text="User ID: {}".format(member.id))
+ updmessage.set_author(name=time.strftime(fmt) + " - Voice Channel Changed",
+ url="http://i.imgur.com/8gD34rt.png")
+ updmessage.set_thumbnail(url="http://i.imgur.com/8gD34rt.png")
+ try:
+ await guild.get_channel(channel).send( embed=updmessage)
+ except:
+ pass
+ else:
+ await guild.get_channel(channel).send(
+ ":person_with_pouting_face::skin-tone-3: `{}` **{}'s** voice status has updated. **Channel**: {}\n**Local Mute:** {} **Local Deaf:** {} **guild Mute:** {} **guild Deaf:** {}".format(
+ time.strftime(fmt), after.name, after.voice_channel, after.self_mute,
+ after.self_deaf, after.mute, after.deaf))
+
+
+ async def on_member_update(self, before, after):
+ guild = before.guild
+
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ if not before.roles == after.roles and await self.config.guild(guild).toggleroles():
+ if await self.config.guild(guild).embed() == True:
+ name = after
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ role = discord.Embed(colour=discord.Color.red(), timestamp=time)
+ role.add_field(name="Roles Before:", value=" ,".join(role.name for role in before.roles), inline=False)
+ role.add_field(name="Roles After:", value=" ,".join(role.name for role in after.roles), inline=False)
+ role.set_footer(text="User ID: {}".format(after.id), icon_url=after.avatar_url)
+ role.set_author(name=name + " - Updated Roles", icon_url=after.avatar_url)
+ # role.set_thumbnail(after)
+ try:
+ await guild.get_channel(channel).send( embed=role)
+ except:
+ pass
+ if await self.config.guild(guild).embed() == False:
+ msg = ":person_with_pouting_face::skin-tone-3: `{}` **{}'s** roles have changed. Old: `{}` New: `{}`".format(
+ time.strftime(fmt), before.name, ", ".join([r.name for r in before.roles]),
+ ", ".join([r.name for r in after.roles]))
+ await guild.get_channel(channel).send(
+ msg)
+ if not before.nick == after.nick and await self.config.guild(guild).toggleuser():
+ if await self.config.guild(guild).embed() == True:
+ name = before
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+ infomessage = "{}'s nickname has changed".format(before.mention)
+ updmessage = discord.Embed(description=infomessage, colour=discord.Color.orange(), timestamp=time)
+ updmessage.add_field(name="Nickname Before:", value=before.nick)
+ updmessage.add_field(name="Nickname After:", value=after.nick)
+ updmessage.set_footer(text="User ID: {}".format(before.id), icon_url=after.avatar_url)
+ updmessage.set_author(name=name + " - Nickname Changed", icon_url=after.avatar_url)
+ # updmessage.set_thumbnail(url="http://i.imgur.com/I5q71rj.png")
+ try:
+ await guild.get_channel(channel).send( embed=updmessage)
+ except:
+ pass
+ else:
+ await guild.get_channel(channel).send(
+ ":person_with_pouting_face::skin-tone-3: `{}` **{}** changed their nickname from **{}** to **{}**".format(
+ time.strftime(fmt), before.name, before.nick, after.nick))
+
+ async def on_member_ban(self, guild, member):
+
+ if await self.config.guild(guild).toggleban() == False:
+ return
+ channel = await self.config.guild(guild).Channel()
+ if channel is None:
+ return
+ time = datetime.datetime.utcnow()
+ fmt = '%H:%M:%S'
+ if await self.config.guild(guild).embed() == True:
+ name = member
+ name = " ~ ".join((name.name, name.nick)) if name.nick else name.name
+
+ infomessage = "{} has been banned from the guild.".format(member.mention)
+ banmessage = discord.Embed(description=infomessage, colour=discord.Color.red(), timestamp=time)
+ banmessage.add_field(name="Info:", value=infomessage, inline=False)
+ banmessage.set_footer(text="User ID: {}".format(member.id), icon_url=member.avatar_url)
+ banmessage.set_author(name=name + " - Banned User", icon_url=member.avatar_url)
+ banmessage.set_thumbnail(url=member.avatar_url)
+ try:
+ await guild.get_channel(channel).send( embed=banmessage)
+ except:
+ await guild.get_channel(channel).send(
+ "How is embed modlog going to work when I don't have embed links permissions?")
+ else:
+ msg = ":hammer: `{}` {}({}) has been banned!".format(time.strftime(fmt), member, member.id)
+ await guild.get_channel(channel).send(msg)
diff --git a/notsobot/README.md b/notsobot/README.md
new file mode 100644
index 0000000..e59130f
--- /dev/null
+++ b/notsobot/README.md
@@ -0,0 +1,23 @@
+# How to install the Notsobot cog
+**Requirements for Python**
+`pip3 install python-aalib imgurpython pyfiglet numpy pillow lxml`
+`pip3 install git+https://github.com/Kareeeeem/jpglitch`
+**Note: python-aalib uses ctypes to access aalib. As a result aalib is not available on Mac OS systems and will not import. You can still use everything except the ascii art commands.**
+
+
+**Requirements for ImageMagick**
+https://imagemagick.org/script/download.php
+http://docs.wand-py.org/en/0.4.4/guide/install.html#
+
+Install the latest source in Ubuntu with:
+`sudo apt-get install libmagickwand-dev, libaa1-dev`
+https://linuxconfig.org/how-to-install-imagemagick-7-on-ubuntu-18-04-linux
+
+
+`wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
+tar xvfz ImageMagick.tar.gz
+cd ImageMagick-*
+./configure --disable-shared
+make
+sudo make install`
+
diff --git a/notsobot/__init__.py b/notsobot/__init__.py
new file mode 100644
index 0000000..482b417
--- /dev/null
+++ b/notsobot/__init__.py
@@ -0,0 +1,7 @@
+from .notsobot import NotSoBot
+from redbot.core import data_manager
+
+def setup(bot):
+ cog = NotSoBot(bot)
+ data_manager.load_bundled_data(cog, __file__)
+ bot.add_cog(cog)
\ No newline at end of file
diff --git a/notsobot/data/arial.ttf b/notsobot/data/arial.ttf
new file mode 100644
index 0000000..12cc15c
Binary files /dev/null and b/notsobot/data/arial.ttf differ
diff --git a/notsobot/info.json b/notsobot/info.json
new file mode 100644
index 0000000..44ee06d
--- /dev/null
+++ b/notsobot/info.json
@@ -0,0 +1,32 @@
+{
+ "author":[
+ "NotSoSuper",
+ "TrustyJAID"
+ ],
+ "description":"Some working, some not working NotSoBot commands",
+ "install_msg":"Please, read the README.md to understand how to install. `sudo apt-get install libmagickwand-dev libaa1-dev` and install all other requirements.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Modlogs",
+ "permissions":[
+ "attach_files"
+ ],
+ "requirements":[
+ "python-aalib",
+ "imgurpython",
+ "pyfiglet",
+ "numpy",
+ "pillow",
+ "lxml",
+ "git+https://github.com/Kareeeeem/jpglitch",
+ "wand",
+ "git+https://github.com/rickyhan/macintoshplus"
+ ],
+ "short":"Some working commands from NotSoBot",
+ "tags":[
+ "Fun"
+ ]
+}
\ No newline at end of file
diff --git a/notsobot/notsobot.py b/notsobot/notsobot.py
new file mode 100644
index 0000000..cbc0c85
--- /dev/null
+++ b/notsobot/notsobot.py
@@ -0,0 +1,1700 @@
+# https://github.com/NotSoSuper/NotSoBot
+
+import asyncio, aiohttp, discord
+import os, sys, linecache, traceback, glob
+import re, json, random, math, html
+import wand, wand.color, wand.drawing
+import PIL, PIL.Image, PIL.ImageFont, PIL.ImageOps, PIL.ImageDraw
+import numpy as np
+import jpglitch
+import hashlib, base64
+from .pixelsort import sorter, sorting, interval
+from .pixelsort import util as ps_util
+from .vw import macintoshplus
+from urllib.parse import parse_qs
+from lxml import etree
+from imgurpython import ImgurClient
+from io import BytesIO, StringIO
+from redbot.core import commands
+from redbot.core import checks
+from pyfiglet import figlet_format
+from string import ascii_lowercase as alphabet
+from urllib.parse import quote
+from concurrent.futures._base import CancelledError
+import random, uuid
+
+from redbot.core.data_manager import bundled_data_path
+
+try:
+ import aalib
+ AALIB_INSTALLED = True
+except:
+ AALIB_INSTALLED = False
+
+code = "```py\n{0}\n```"
+
+#http://stackoverflow.com/a/34084933
+#for google_scrap
+def get_deep_text(element):
+ try:
+ text = element.text or ''
+ for subelement in element:
+ text += get_deep_text(subelement)
+ text += element.tail or ''
+ return text
+ except:
+ return ''
+
+def posnum(num):
+ if num < 0 :
+ return - (num)
+ else:
+ return num
+
+def find_coeffs(pa, pb):
+ matrix = []
+ for p1, p2 in zip(pa, pb):
+ matrix.append([p1[0], p1[1], 1, 0, 0, 0, -p2[0]*p1[0], -p2[0]*p1[1]])
+ matrix.append([0, 0, 0, p1[0], p1[1], 1, -p2[1]*p1[0], -p2[1]*p1[1]])
+ A = np.matrix(matrix, dtype=np.float)
+ B = np.array(pb).reshape(8)
+ res = np.dot(np.linalg.inv(A.T*A)*A.T, B)
+ return np.array(res).reshape(8)
+
+class DataProtocol(asyncio.SubprocessProtocol):
+ def __init__(self, exit_future):
+ self.exit_future = exit_future
+ self.output = bytearray()
+
+ def pipe_data_received(self, fd, data):
+ self.output.extend(data)
+
+ def process_exited(self):
+ try:
+ self.exit_future.set_result(True)
+ except:
+ pass
+
+ def pipe_connection_lost(self, fd, exc):
+ try:
+ self.exit_future.set_result(True)
+ except:
+ pass
+ def connection_made(self, transport):
+ self.transport = transport
+
+ def connection_lost(self, exc):
+ try:
+ self.exit_future.set_result(True)
+ except:
+ pass
+
+class NotSoBot(getattr(commands, "Cog", object)):
+ """
+ Rewrite of many NotSoBot commands to work on RedBot V3
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ try:
+ self.imgur_client = ImgurClient("", "")
+ except:
+ bot.remove_command('imgur')
+ self.image_cache = {}
+ self.search_cache = {}
+ self.youtube_cache = {}
+ self.twitch_cache = []
+ self.api_count = 0
+ self.emojis = {"soccer": "⚽", "basketball": "🏀", "football": "🏈", "baseball": "⚾", "tennis": "🎾", "volleyball": "🏐", "rugby_football": "🏉", "8ball": "🎱", "golf": "⛳", "golfer": "🏌", "ping_pong": "🏓", "badminton": "🏸", "hockey": "🏒", "field_hockey": "🏑", "cricket": "🏏", "ski": "🎿", "skier": "⛷", "snowboarder": "🏂", "ice_skate": "⛸", "bow_and_arrow": "🏹", "fishing_pole_and_fish": "🎣", "rowboat": "🚣", "swimmer": "🏊", "surfer": "🏄", "bath": "🛀", "basketball_player": "⛹", "lifter": "🏋", "bicyclist": "🚴", "mountain_bicyclist": "🚵", "horse_racing": "🏇", "levitate": "🕴", "trophy": "🏆", "running_shirt_with_sash": "🎽", "medal": "🏅", "military_medal": "🎖", "reminder_ribbon": "🎗", "rosette": "🏵", "ticket": "🎫", "tickets": "🎟", "performing_arts": "🎭", "art": "🎨", "circus_tent": "🎪", "microphone": "🎤", "headphones": "🎧", "musical_score": "🎼", "musical_keyboard": "🎹", "saxophone": "🎷", "trumpet": "🎺", "guitar": "🎸", "violin": "🎻", "clapper": "🎬", "video_game": "🎮", "space_invader": "👾", "dart": "🎯", "game_die": "🎲", "slot_machine": "🎰", "bowling": "🎳", "♡": "heart", "green_apple": "🍏", "apple": "🍎", "pear": "🍐", "tangerine": "🍊", "lemon": "🍋", "banana": "🍌", "watermelon": "🍉", "grapes": "🍇", "strawberry": "🍓", "melon": "🍈", "cherries": "🍒", "peach": "🍑", "pineapple": "🍍", "tomato": "🍅", "eggplant": "🍆", "hot_pepper": "🌶", "corn": "🌽", "sweet_potato": "🍠", "honey_pot": "🍯", "bread": "🍞", "cheese": "🧀", "poultry_leg": "🍗", "meat_on_bone": "🍖", "fried_shrimp": "🍤", "egg": "🍳", "cooking": "🍳", "hamburger": "🍔", "fries": "🍟", "hotdog": "🌭", "pizza": "🍕", "spaghetti": "🍝", "taco": "🌮", "burrito": "🌯", "ramen": "🍜", "stew": "🍲", "fish_cake": "🍥", "sushi": "🍣", "bento": "🍱", "curry": "🍛", "rice_ball": "🍙", "rice": "🍚", "rice_cracker": "🍘", "oden": "🍢", "dango": "🍡", "shaved_ice": "🍧", "ice_cream": "🍨", "icecream": "🍦", "cake": "🍰", "birthday": "🎂", "custard": "🍮", "candy": "🍬", "lollipop": "🍭", "chocolate_bar": "🍫", "popcorn": "🍿", "doughnut": "🍩", "cookie": "🍪", "beer": "🍺", "beers": "🍻", "wine_glass": "🍷", "cocktail": "🍸", "tropical_drink": "🍹", "champagne": "🍾", "sake": "🍶", "tea": "🍵", "coffee": "☕", "baby_bottle": "🍼", "fork_and_knife": "🍴", "fork_knife_plate": "🍽", "dog": "🐶", "cat": "🐱", "mouse": "🐭", "hamster": "🐹", "rabbit": "🐰", "bear": "🐻", "panda_face": "🐼", "koala": "🐨", "tiger": "🐯", "lion_face": "🦁", "cow": "🐮", "pig": "🐷", "pig_nose": "🐽", "frog": "🐸", "octopus": "🐙", "monkey_face": "🐵", "see_no_evil": "🙈", "hear_no_evil": "🙉", "speak_no_evil": "🙊", "monkey": "🐒", "chicken": "🐔", "penguin": "🐧", "bird": "🐦", "baby_chick": "🐤", "hatching_chick": "🐣", "hatched_chick": "🐥", "wolf": "🐺", "boar": "🐗", "horse": "🐴", "unicorn": "🦄", "bee": "🐝", "honeybee": "🐝", "bug": "🐛", "snail": "🐌", "beetle": "🐞", "ant": "🐜", "spider": "🕷", "scorpion": "🦂", "crab": "🦀", "snake": "🐍", "turtle": "🐢", "tropical_fish": "🐠", "fish": "🐟", "blowfish": "🐡", "dolphin": "🐬", "flipper": "🐬", "whale": "🐳", "whale2": "🐋", "crocodile": "🐊", "leopard": "🐆", "tiger2": "🐅", "water_buffalo": "🐃", "ox": "🐂", "cow2": "🐄", "dromedary_camel": "🐪", "camel": "🐫", "elephant": "🐘", "goat": "🐐", "ram": "🐏", "sheep": "🐑", "racehorse": "🐎", "pig2": "🐖", "rat": "🐀", "mouse2": "🐁", "rooster": "🐓", "turkey": "🦃", "dove": "🕊", "dog2": "🐕", "poodle": "🐩", "cat2": "🐈", "rabbit2": "🐇", "chipmunk": "🐿", "feet": "🐾", "paw_prints": "🐾", "dragon": "🐉", "dragon_face": "🐲", "cactus": "🌵", "christmas_tree": "🎄", "evergreen_tree": "🌲", "deciduous_tree": "🌳", "palm_tree": "🌴", "seedling": "🌱", "herb": "🌿", "shamrock": "☘", "four_leaf_clover": "🍀", "bamboo": "🎍", "tanabata_tree": "🎋", "leaves": "🍃", "fallen_leaf": "🍂", "maple_leaf": "🍁", "ear_of_rice": "🌾", "hibiscus": "🌺", "sunflower": "🌻", "rose": "🌹", "tulip": "🌷", "blossom": "🌼", "cherry_blossom": "🌸", "bouquet": "💐", "mushroom": "🍄", "chestnut": "🌰", "jack_o_lantern": "🎃", "shell": "🐚", "spider_web": "🕸", "earth_americas": "🌎", "earth_africa": "🌍", "earth_asia": "🌏", "full_moon": "🌕", "waning_gibbous_moon": "🌖", "last_quarter_moon": "🌗", "waning_crescent_moon": "🌘", "new_moon": "🌑", "waxing_crescent_moon": "🌒", "first_quarter_moon": "🌓", "waxing_gibbous_moon": "🌔", "moon": "🌔", "new_moon_with_face": "🌚", "full_moon_with_face": "🌝", "first_quarter_moon_with_face": "🌛", "last_quarter_moon_with_face": "🌜", "sun_with_face": "🌞", "crescent_moon": "🌙", "star": "⭐", "star2": "🌟", "dizzy": "💫", "sparkles": "✨", "comet": "☄", "sunny": "☀", "white_sun_small_cloud": "🌤", "partly_sunny": "⛅", "white_sun_cloud": "🌥", "white_sun_rain_cloud": "🌦", "cloud": "☁", "cloud_rain": "🌧", "thunder_cloud_rain": "⛈", "cloud_lightning": "🌩", "zap": "⚡", "fire": "🔥", "boom": "💥", "collision": "💥", "snowflake": "❄", "cloud_snow": "🌨", "snowman2": "☃", "snowman": "⛄", "wind_blowing_face": "🌬", "dash": "💨", "cloud_tornado": "🌪", "fog": "🌫", "umbrella2": "☂", "umbrella": "☔", "droplet": "💧", "sweat_drops": "💦", "ocean": "🌊", "watch": "⌚", "iphone": "📱", "calling": "📲", "computer": "💻", "keyboard": "⌨", "desktop": "🖥", "printer": "🖨", "mouse_three_button": "🖱", "trackball": "🖲", "joystick": "🕹", "compression": "🗜", "minidisc": "💽", "floppy_disk": "💾", "cd": "💿", "dvd": "📀", "vhs": "📼", "camera": "📷", "camera_with_flash": "📸", "video_camera": "📹", "movie_camera": "🎥", "projector": "📽", "film_frames": "🎞", "telephone_receiver": "📞", "telephone": "☎", "phone": "☎", "pager": "📟", "fax": "📠", "tv": "📺", "radio": "📻", "microphone2": "🎙", "level_slider": "🎚", "control_knobs": "🎛", "stopwatch": "⏱", "timer": "⏲", "alarm_clock": "⏰", "clock": "🕰", "hourglass_flowing_sand": "⏳", "hourglass": "⌛", "satellite": "📡", "battery": "🔋", "electric_plug": "🔌", "bulb": "💡", "flashlight": "🔦", "candle": "🕯", "wastebasket": "🗑", "oil": "🛢", "money_with_wings": "💸", "dollar": "💵", "yen": "💴", "euro": "💶", "pound": "💷", "moneybag": "💰", "credit_card": "💳", "gem": "💎", "scales": "⚖", "wrench": "🔧", "hammer": "🔨", "hammer_pick": "⚒", "tools": "🛠", "pick": "⛏", "nut_and_bolt": "🔩", "gear": "⚙", "chains": "⛓", "gun": "🔫", "bomb": "💣", "knife": "🔪", "hocho": "🔪", "dagger": "🗡", "crossed_swords": "⚔", "shield": "🛡", "smoking": "🚬", "skull_crossbones": "☠", "coffin": "⚰", "urn": "⚱", "amphora": "🏺", "crystal_ball": "🔮", "prayer_beads": "📿", "barber": "💈", "alembic": "⚗", "telescope": "🔭", "microscope": "🔬", "hole": "🕳", "pill": "💊", "syringe": "💉", "thermometer": "🌡", "label": "🏷", "bookmark": "🔖", "toilet": "🚽", "shower": "🚿", "bathtub": "🛁", "key": "🔑", "key2": "🗝", "couch": "🛋", "sleeping_accommodation": "🛌", "bed": "🛏", "door": "🚪", "bellhop": "🛎", "frame_photo": "🖼", "map": "🗺", "beach_umbrella": "⛱", "moyai": "🗿", "shopping_bags": "🛍", "balloon": "🎈", "flags": "🎏", "ribbon": "🎀", "gift": "🎁", "confetti_ball": "🎊", "tada": "🎉", "dolls": "🎎", "wind_chime": "🎐", "crossed_flags": "🎌", "izakaya_lantern": "🏮", "lantern": "🏮", "envelope": "✉", "email": "📧", "envelope_with_arrow": "📩", "incoming_envelope": "📨", "love_letter": "💌", "postbox": "📮", "mailbox_closed": "📪", "mailbox": "📫", "mailbox_with_mail": "📬", "mailbox_with_no_mail": "📭", "package": "📦", "postal_horn": "📯", "inbox_tray": "📥", "outbox_tray": "📤", "scroll": "📜", "page_with_curl": "📃", "bookmark_tabs": "📑", "bar_chart": "📊", "chart_with_upwards_trend": "📈", "chart_with_downwards_trend": "📉", "page_facing_up": "📄", "date": "📅", "calendar": "📆", "calendar_spiral": "🗓", "card_index": "📇", "card_box": "🗃", "ballot_box": "🗳", "file_cabinet": "🗄", "clipboard": "📋", "notepad_spiral": "🗒", "file_folder": "📁", "open_file_folder": "📂", "dividers": "🗂", "newspaper2": "🗞", "newspaper": "📰", "notebook": "📓", "closed_book": "📕", "green_book": "📗", "blue_book": "📘", "orange_book": "📙", "notebook_with_decorative_cover": "📔", "ledger": "📒", "books": "📚", "book": "📖", "open_book": "📖", "link": "🔗", "paperclip": "📎", "paperclips": "🖇", "scissors": "✂", "triangular_ruler": "📐", "straight_ruler": "📏", "pushpin": "📌", "round_pushpin": "📍", "triangular_flag_on_post": "🚩", "flag_white": "🏳", "flag_black": "🏴", "closed_lock_with_key": "🔐", "lock": "🔒", "unlock": "🔓", "lock_with_ink_pen": "🔏", "pen_ballpoint": "🖊", "pen_fountain": "🖋", "black_nib": "✒", "pencil": "📝", "memo": "📝", "pencil2": "✏", "crayon": "🖍", "paintbrush": "🖌", "mag": "🔍", "mag_right": "🔎", "grinning": "😀", "grimacing": "😬", "grin": "😁", "joy": "😂", "smiley": "😃", "smile": "😄", "sweat_smile": "😅", "laughing": "😆", "satisfied": "😆", "innocent": "😇", "wink": "😉", "blush": "😊", "slight_smile": "🙂", "upside_down": "🙃", "relaxed": "☺", "yum": "😋", "relieved": "😌", "heart_eyes": "😍", "kissing_heart": "😘", "kissing": "😗", "kissing_smiling_eyes": "😙", "kissing_closed_eyes": "😚", "stuck_out_tongue_winking_eye": "😜", "stuck_out_tongue_closed_eyes": "😝", "stuck_out_tongue": "😛", "money_mouth": "🤑", "nerd": "🤓", "sunglasses": "😎", "hugging": "🤗", "smirk": "😏", "no_mouth": "😶", "neutral_face": "😐", "expressionless": "😑", "unamused": "😒", "rolling_eyes": "🙄", "thinking": "🤔", "flushed": "😳", "disappointed": "😞", "worried": "😟", "angry": "😠", "rage": "😡", "pensive": "😔", "confused": "😕", "slight_frown": "🙁", "frowning2": "☹", "persevere": "😣", "confounded": "😖", "tired_face": "😫", "weary": "😩", "triumph": "😤", "open_mouth": "😮", "scream": "😱", "fearful": "😨", "cold_sweat": "😰", "hushed": "😯", "frowning": "😦", "anguished": "😧", "cry": "😢", "disappointed_relieved": "😥", "sleepy": "😪", "sweat": "😓", "sob": "😭", "dizzy_face": "😵", "astonished": "😲", "zipper_mouth": "🤐", "mask": "😷", "thermometer_face": "🤒", "head_bandage": "🤕", "sleeping": "😴", "zzz": "💤", "poop": "💩", "shit": "💩", "smiling_imp": "😈", "imp": "👿", "japanese_ogre": "👹", "japanese_goblin": "👺", "skull": "💀", "ghost": "👻", "alien": "👽", "robot": "🤖", "smiley_cat": "😺", "smile_cat": "😸", "joy_cat": "😹", "heart_eyes_cat": "😻", "smirk_cat": "😼", "kissing_cat": "😽", "scream_cat": "🙀", "crying_cat_face": "😿", "pouting_cat": "😾", "raised_hands": "🙌", "clap": "👏", "wave": "👋", "thumbsup": "👍", "+1": "👍", "thumbsdown": "👎", "-1": "👎", "punch": "👊", "facepunch": "👊", "fist": "✊", "v": "✌", "ok_hand": "👌", "raised_hand": "✋", "hand": "✋", "open_hands": "👐", "muscle": "💪", "pray": "🙏", "point_up": "☝", "point_up_2": "👆", "point_down": "👇", "point_left": "👈", "point_right": "👉", "middle_finger": "🖕", "hand_splayed": "🖐", "metal": "🤘", "vulcan": "🖖", "writing_hand": "✍", "nail_care": "💅", "lips": "👄", "tongue": "👅", "ear": "👂", "nose": "👃", "eye": "👁", "eyes": "👀", "bust_in_silhouette": "👤", "busts_in_silhouette": "👥", "speaking_head": "🗣", "baby": "👶", "boy": "👦", "girl": "👧", "man": "👨", "woman": "👩", "person_with_blond_hair": "👱", "older_man": "👴", "older_woman": "👵", "man_with_gua_pi_mao": "👲", "man_with_turban": "👳", "cop": "👮", "construction_worker": "👷", "guardsman": "💂", "spy": "🕵", "santa": "🎅", "angel": "👼", "princess": "👸", "bride_with_veil": "👰", "walking": "🚶", "runner": "🏃", "running": "🏃", "dancer": "💃", "dancers": "👯", "couple": "👫", "two_men_holding_hands": "👬", "two_women_holding_hands": "👭", "bow": "🙇", "information_desk_person": "💁", "no_good": "🙅", "ok_woman": "🙆", "raising_hand": "🙋", "person_with_pouting_face": "🙎", "person_frowning": "🙍", "haircut": "💇", "massage": "💆", "couple_with_heart": "💑", "couple_ww": "👩❤️👩", "couple_mm": "👨❤️👨", "couplekiss": "💏", "kiss_ww": "👩❤️💋👩", "kiss_mm": "👨❤️💋👨", "family": "👪", "family_mwg": "👨👩👧", "family_mwgb": "👨👩👧👦", "family_mwbb": "👨👩👦👦", "family_mwgg": "👨👩👧👧", "family_wwb": "👩👩👦", "family_wwg": "👩👩👧", "family_wwgb": "👩👩👧👦", "family_wwbb": "👩👩👦👦", "family_wwgg": "👩👩👧👧", "family_mmb": "👨👨👦", "family_mmg": "👨👨👧", "family_mmgb": "👨👨👧👦", "family_mmbb": "👨👨👦👦", "family_mmgg": "👨👨👧👧", "womans_clothes": "👚", "shirt": "👕", "tshirt": "👕", "jeans": "👖", "necktie": "👔", "dress": "👗", "bikini": "👙", "kimono": "👘", "lipstick": "💄", "kiss": "💋", "footprints": "👣", "high_heel": "👠", "sandal": "👡", "boot": "👢", "mans_shoe": "👞", "shoe": "👞", "athletic_shoe": "👟", "womans_hat": "👒", "tophat": "🎩", "helmet_with_cross": "⛑", "mortar_board": "🎓", "crown": "👑", "school_satchel": "🎒", "pouch": "👝", "purse": "👛", "handbag": "👜", "briefcase": "💼", "eyeglasses": "👓", "dark_sunglasses": "🕶", "ring": "💍", "closed_umbrella": "🌂", "100": "💯", "1234": "🔢", "heart": "❤", "yellow_heart": "💛", "green_heart": "💚", "blue_heart": "💙", "purple_heart": "💜", "broken_heart": "💔", "heart_exclamation": "❣", "two_hearts": "💕", "revolving_hearts": "💞", "heartbeat": "💓", "heartpulse": "💗", "sparkling_heart": "💖", "cupid": "💘", "gift_heart": "💝", "heart_decoration": "💟", "peace": "☮", "cross": "✝", "star_and_crescent": "☪", "om_symbol": "🕉", "wheel_of_dharma": "☸", "star_of_david": "✡", "six_pointed_star": "🔯", "menorah": "🕎", "yin_yang": "☯", "orthodox_cross": "☦", "place_of_worship": "🛐", "ophiuchus": "⛎", "aries": "♈", "taurus": "♉", "gemini": "♊", "cancer": "♋", "leo": "♌", "virgo": "♍", "libra": "♎", "scorpius": "♏", "sagittarius": "♐", "capricorn": "♑", "aquarius": "♒", "pisces": "♓", "id": "🆔", "atom": "⚛", "u7a7a": "🈳", "u5272": "🈹", "radioactive": "☢", "biohazard": "☣", "mobile_phone_off": "📴", "vibration_mode": "📳", "u6709": "🈶", "u7121": "🈚", "u7533": "🈸", "u55b6": "🈺", "u6708": "🈷", "eight_pointed_black_star": "✴", "vs": "🆚", "accept": "🉑", "white_flower": "💮", "ideograph_advantage": "🉐", "secret": "㊙", "congratulations": "㊗", "u5408": "🈴", "u6e80": "🈵", "u7981": "🈲", "a": "🅰", "b": "🅱", "ab": "🆎", "cl": "🆑", "o2": "🅾", "sos": "🆘", "no_entry": "⛔", "name_badge": "📛", "no_entry_sign": "🚫", "x": "❌", "o": "⭕", "anger": "💢", "hotsprings": "♨", "no_pedestrians": "🚷", "do_not_litter": "🚯", "no_bicycles": "🚳", "non_potable_water": "🚱", "underage": "🔞", "no_mobile_phones": "📵", "exclamation": "❗", "heavy_exclamation_mark": "❗", "grey_exclamation": "❕", "question": "❓", "grey_question": "❔", "bangbang": "‼", "interrobang": "⁉", "low_brightness": "🔅", "high_brightness": "🔆", "trident": "🔱", "fleur_de_lis": "⚜", "part_alternation_mark": "〽", "warning": "⚠", "children_crossing": "🚸", "beginner": "🔰", "recycle": "♻", "u6307": "🈯", "chart": "💹", "sparkle": "❇", "eight_spoked_asterisk": "✳", "negative_squared_cross_mark": "❎", "white_check_mark": "✅", "diamond_shape_with_a_dot_inside": "💠", "cyclone": "🌀", "loop": "➿", "globe_with_meridians": "🌐", "m": "Ⓜ", "atm": "🏧", "sa": "🈂", "passport_control": "🛂", "customs": "🛃", "baggage_claim": "🛄", "left_luggage": "🛅", "wheelchair": "♿", "no_smoking": "🚭", "wc": "🚾", "parking": "🅿", "potable_water": "🚰", "mens": "🚹", "womens": "🚺", "baby_symbol": "🚼", "restroom": "🚻", "put_litter_in_its_place": "🚮", "cinema": "🎦", "signal_strength": "📶", "koko": "🈁", "ng": "🆖", "ok": "🆗", "up": "🆙", "cool": "🆒", "new": "🆕", "free": "🆓", "zero": "0⃣", "one": "1⃣", "two": "2⃣", "three": "3⃣", "four": "4⃣", "five": "5⃣", "six": "6⃣", "seven": "7⃣", "eight": "8⃣", "nine": "9⃣", "ten": "🔟","zero": "0⃣", "1": "1⃣", "2": "2⃣", "3": "3⃣", "4": "4⃣", "5": "5⃣", "6": "6⃣", "7": "7⃣", "8": "8⃣", "9": "9⃣", "10": "🔟", "keycap_ten": "🔟", "arrow_forward": "▶", "pause_button": "⏸", "play_pause": "⏯", "stop_button": "⏹", "record_button": "⏺", "track_next": "⏭", "track_previous": "⏮", "fast_forward": "⏩", "rewind": "⏪", "twisted_rightwards_arrows": "🔀", "repeat": "🔁", "repeat_one": "🔂", "arrow_backward": "◀", "arrow_up_small": "🔼", "arrow_down_small": "🔽", "arrow_double_up": "⏫", "arrow_double_down": "⏬", "arrow_right": "➡", "arrow_left": "⬅", "arrow_up": "⬆", "arrow_down": "⬇", "arrow_upper_right": "↗", "arrow_lower_right": "↘", "arrow_lower_left": "↙", "arrow_upper_left": "↖", "arrow_up_down": "↕", "left_right_arrow": "↔", "arrows_counterclockwise": "🔄", "arrow_right_hook": "↪", "leftwards_arrow_with_hook": "↩", "arrow_heading_up": "⤴", "arrow_heading_down": "⤵", "hash": "#⃣", "asterisk": "*⃣", "information_source": "ℹ", "abc": "🔤", "abcd": "🔡", "capital_abcd": "🔠", "symbols": "🔣", "musical_note": "🎵", "notes": "🎶", "wavy_dash": "〰", "curly_loop": "➰", "heavy_check_mark": "✔", "arrows_clockwise": "🔃", "heavy_plus_sign": "➕", "heavy_minus_sign": "➖", "heavy_division_sign": "➗", "heavy_multiplication_x": "✖", "heavy_dollar_sign": "💲", "currency_exchange": "💱", "copyright": "©", "registered": "®", "tm": "™", "end": "🔚", "back": "🔙", "on": "🔛", "top": "🔝", "soon": "🔜", "ballot_box_with_check": "☑", "radio_button": "🔘", "white_circle": "⚪", "black_circle": "⚫", "red_circle": "🔴", "large_blue_circle": "🔵", "small_orange_diamond": "🔸", "small_blue_diamond": "🔹", "large_orange_diamond": "🔶", "large_blue_diamond": "🔷", "small_red_triangle": "🔺", "black_small_square": "▪", "white_small_square": "▫", "black_large_square": "⬛", "white_large_square": "⬜", "small_red_triangle_down": "🔻", "black_medium_square": "◼", "white_medium_square": "◻", "black_medium_small_square": "◾", "white_medium_small_square": "◽", "black_square_button": "🔲", "white_square_button": "🔳", "speaker": "🔈", "sound": "🔉", "loud_sound": "🔊", "mute": "🔇", "mega": "📣", "loudspeaker": "📢", "bell": "🔔", "no_bell": "🔕", "black_joker": "🃏", "mahjong": "🀄", "spades": "♠", "clubs": "♣", "hearts": "♥", "diamonds": "♦", "flower_playing_cards": "🎴", "thought_balloon": "💭", "anger_right": "🗯", "speech_balloon": "💬", "clock1": "🕐", "clock2": "🕑", "clock3": "🕒", "clock4": "🕓", "clock5": "🕔", "clock6": "🕕", "clock7": "🕖", "clock8": "🕗", "clock9": "🕘", "clock10": "🕙", "clock11": "🕚", "clock12": "🕛", "clock130": "🕜", "clock230": "🕝", "clock330": "🕞", "clock430": "🕟", "clock530": "🕠", "clock630": "🕡", "clock730": "🕢", "clock830": "🕣", "clock930": "🕤", "clock1030": "🕥", "clock1130": "🕦", "clock1230": "🕧", "eye_in_speech_bubble": "👁🗨", "speech_left": "🗨", "eject": "⏏", "red_car": "🚗", "car": "🚗", "taxi": "🚕", "blue_car": "🚙", "bus": "🚌", "trolleybus": "🚎", "race_car": "🏎", "police_car": "🚓", "ambulance": "🚑", "fire_engine": "🚒", "minibus": "🚐", "truck": "🚚", "articulated_lorry": "🚛", "tractor": "🚜", "motorcycle": "🏍", "bike": "🚲", "rotating_light": "🚨", "oncoming_police_car": "🚔", "oncoming_bus": "🚍", "oncoming_automobile": "🚘", "oncoming_taxi": "🚖", "aerial_tramway": "🚡", "mountain_cableway": "🚠", "suspension_railway": "🚟", "railway_car": "🚃", "train": "🚋", "monorail": "🚝", "bullettrain_side": "🚄", "bullettrain_front": "🚅", "light_rail": "🚈", "mountain_railway": "🚞", "steam_locomotive": "🚂", "train2": "🚆", "metro": "🚇", "tram": "🚊", "station": "🚉", "helicopter": "🚁", "airplane_small": "🛩", "airplane": "✈", "airplane_departure": "🛫", "airplane_arriving": "🛬", "sailboat": "⛵", "boat": "⛵", "motorboat": "🛥", "speedboat": "🚤", "ferry": "⛴", "cruise_ship": "🛳", "rocket": "🚀", "satellite_orbital": "🛰", "seat": "💺", "anchor": "⚓", "construction": "🚧", "fuelpump": "⛽", "busstop": "🚏", "vertical_traffic_light": "🚦", "traffic_light": "🚥", "checkered_flag": "🏁", "ship": "🚢", "ferris_wheel": "🎡", "roller_coaster": "🎢", "carousel_horse": "🎠", "construction_site": "🏗", "foggy": "🌁", "tokyo_tower": "🗼", "factory": "🏭", "fountain": "⛲", "rice_scene": "🎑", "mountain": "⛰", "mountain_snow": "🏔", "mount_fuji": "🗻", "volcano": "🌋", "japan": "🗾", "camping": "🏕", "tent": "⛺", "park": "🏞", "motorway": "🛣", "railway_track": "🛤", "sunrise": "🌅", "sunrise_over_mountains": "🌄", "desert": "🏜", "beach": "🏖", "island": "🏝", "city_sunset": "🌇", "city_sunrise": "🌇", "city_dusk": "🌆", "cityscape": "🏙", "night_with_stars": "🌃", "bridge_at_night": "🌉", "milky_way": "🌌", "stars": "🌠", "sparkler": "🎇", "fireworks": "🎆", "rainbow": "🌈", "homes": "🏘", "european_castle": "🏰", "japanese_castle": "🏯", "stadium": "🏟", "statue_of_liberty": "🗽", "house": "🏠", "house_with_garden": "🏡", "house_abandoned": "🏚", "office": "🏢", "department_store": "🏬", "post_office": "🏣", "european_post_office": "🏤", "hospital": "🏥", "bank": "🏦", "hotel": "🏨", "convenience_store": "🏪", "school": "🏫", "love_hotel": "🏩", "wedding": "💒", "classical_building": "🏛", "church": "⛪", "mosque": "🕌", "synagogue": "🕍", "kaaba": "🕋", "shinto_shrine": "⛩"}
+ self.emoji_map = {"a": "", "b": "", "c": "©", "d": "↩", "e": "", "f": "", "g": "⛽", "h": "♓", "i": "ℹ", "j": "" or "", "k": "", "l": "", "m": "Ⓜ", "n": "♑", "o": "⭕" or "", "p": "", "q": "", "r": "®", "s": "" or "⚡", "t": "", "u": "⛎", "v": "" or "♈", "w": "〰" or "", "x": "❌" or "⚔", "y": "✌", "z": "Ⓩ", "1": "1⃣", "2": "2⃣", "3": "3⃣", "4": "4⃣", "5": "5⃣", "6": "6⃣", "7": "7⃣", "8": "8⃣", "9": "9⃣", "0": "0⃣", "$": "", "!": "❗", "?": "❓", " ": " "}
+ self.regional_map = {"z": "🇿", "y": "🇾", "x": "🇽", "w": "🇼", "v": "🇻", "u": "🇺", "t": "🇹", "s": "🇸", "r": "🇷", "q": "🇶", "p": "🇵", "o": "🇴", "n": "🇳", "m": "🇲", "l": "🇱", "k": "🇰", "j": "🇯", "i": "🇮", "h": "🇭", "g": "🇬", "f": "🇫", "e": "🇪", "d": "🇩", "c": "🇨", "b": "🇧", "a": "🇦"}
+ self.emote_regex = re.compile(r'<:.*:(?P\d*)>')
+ self.retro_regex = re.compile(r"((https)(\:\/\/|)?u2\.photofunia\.com\/.\/results\/.\/.\/.*(\.jpg\?download))")
+ self.voice_list = ['`Allison - English/US (Expressive)`', '`Michael - English/US`', '`Lisa - English/US`', '`Kate - English/UK`', '`Renee - French/FR`', '`Birgit - German/DE`', '`Dieter - German/DE`', '`Francesca - Italian/IT`', '`Emi - Japanese/JP`', '`Isabela - Portuguese/BR`', '`Enrique - Spanish`', '`Laura - Spanish`', '`Sofia - Spanish/NA`']
+ self.scrap_regex = re.compile(",\"ou\":\"([^`]*?)\"")
+ # self.google_keys = bot.google_keys
+ self.interval_functions = {"random": interval.random, "threshold": interval.threshold, "edges": interval.edge, "waves": interval.waves, "file": interval.file_mask, "file-edges": interval.file_edges, "none": interval.none}
+ self.s_functions = {"lightness": sorting.lightness, "intensity": sorting.intensity, "maximum": sorting.maximum, "minimum": sorting.minimum}
+ self.webmd_responses = ['redacted']
+ self.webmd_count = random.randint(0, len(self.webmd_responses)-1)
+ self.color_combinations = [[150, 50, -25], [135, 30, -10], [100, 50, -15], [75, 25, -15], [35, 20, -25], [0, 20, 0], [-25, 45, 35], [-25, 45, 65], [-45, 70, 75], [-65, 100, 135], [-45, 90, 100], [-10, 40, 70], [25, 25, 50], [65, 10, 10], [100, 25, 0], [135, 35, -10]]
+ # self.fp_dir = os.listdir(str(bundled_data_path(self)/'fp/'))
+ self.more_cache = {}
+ self.mention_regex = re.compile(r"<@!?(?P\d+)>")
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.image_mimes = ['image/png', 'image/pjpeg', 'image/jpeg', 'image/x-icon']
+
+ async def is_nsfw(self, message):
+ channel = message.channel
+ if channel.is_private:
+ return True
+ name = channel.name.lower()
+ if name == 'nsfw' or name == '[nsfw]':
+ return True
+ elif name == 'no-nsfw' or name == 'sfw':
+ return False
+ split = name.split()
+ if 'nsfw' in name:
+ try:
+ i = split.index('nsfw')
+ except:
+ i = None
+ if len(split) > 1 and i != None and split[i-1] != 'no':
+ return True
+ elif i is None:
+ split = name.split('-')
+ try:
+ i = split.index('nsfw')
+ except:
+ i = None
+ if len(split) > 1 and i != None and split[i-1] != 'no':
+ return True
+ if channel.topic != None:
+ topic = channel.topic.lower()
+ split = topic.split()
+ if '{nsfw}' in topic or '[nsfw]' in topic or topic == 'nsfw':
+ return True
+ elif 'nsfw' in topic and 'sfw' not in split:
+ try:
+ i = split.index('nsfw')
+ except:
+ i = None
+ if len(split) > 1 and i != None and split[i-1] != 'no':
+ return True
+ elif i is None:
+ split = topic.split('-')
+ try:
+ i = split.index('nsfw')
+ except:
+ i = None
+ if len(split) > 1 and i != None and split[i-1] != 'no':
+ return True
+ return False
+
+ def random(self, image=False, ext:str=False):
+ h = str(uuid.uuid4().hex)
+ if image:
+ return '{0}.{1}'.format(h, ext) if ext else h+'.png'
+ return h
+
+ async def get_text(self, url:str):
+ try:
+ async with self.session.get(url) as resp:
+ try:
+ text = await resp.text()
+ return text
+ except:
+ return False
+ except asyncio.TimeoutError:
+ return False
+
+ async def replace_mentions(self, txt:str):
+ match = self.mention_regex.findall(txt)
+ if match:
+ for i in match:
+ user = discord.utils.get(self.bot.get_all_members(), id=str(i))
+ if user is None:
+ user = await self.bot.get_user_info(i)
+ txt = re.sub(re.compile('(<@\!?{0}>)'.format(user.id)), '@{0}'.format(user), txt)
+ return txt
+
+ async def get_attachment_images(self, ctx, check_func):
+ last_attachment = None
+ img_urls = []
+ async for m in ctx.channel.history(before=ctx.message, limit=25):
+ check = False
+ if m.attachments:
+ last_attachment = m.attachments[0].url
+ check = await check_func(last_attachment)
+ elif m.embeds:
+ last_attachment = m.embeds[0].url
+ check = await check_func(last_attachment)
+ if check:
+ img_urls.append(last_attachment)
+ break
+ return img_urls
+
+ def find_member(self, guild, name, steps=2):
+ member = None
+ match = self.mention_regex.search(name)
+ if match:
+ member = guild.get_member(match.group('id'))
+ if not member:
+ name = name.lower()
+ checks = [lambda m: m.name.lower() == name or m.display_name.lower() == name, lambda m: m.name.lower().startswith(name) or m.display_name.lower().startswith(name) or m.id == name, lambda m: name in m.display_name.lower() or name in m.name.lower()]
+ for i in range(steps if steps <= len(checks) else len(checks)):
+ if i == 3:
+ member = discord.utils.find(checks[1], self.bot.get_all_members())
+ else:
+ member = discord.utils.find(checks[i], guild.members)
+ if member:
+ break
+ return member
+
+ async def get_images(self, ctx, **kwargs):
+ try:
+ message = ctx.message
+ channel = ctx.message.channel
+ attachments = ctx.message.attachments
+ mentions = ctx.message.mentions
+ limit = kwargs.pop('limit', 8)
+ urls = kwargs.pop('urls', [])
+ gif = kwargs.pop('gif', False)
+ msg = kwargs.pop('msg', True)
+ if gif:
+ check_func = self.isgif
+ else:
+ check_func = self.isimage
+ if urls is None:
+ urls = []
+ elif type(urls) != tuple:
+ urls = [urls]
+ else:
+ urls = list(urls)
+ scale = kwargs.pop('scale', None)
+ scale_msg = None
+ int_scale = None
+ if gif is False:
+ for user in mentions:
+ if user.avatar:
+ urls.append(user.avatar_url_as(static_format="png"))
+ else:
+ urls.append(user.default_avatar_url)
+ limit += 1
+ for attachment in attachments:
+ urls.append(attachment.url)
+ if scale:
+ scale_limit = scale
+ limit += 1
+ if urls and len(urls) > limit:
+ await channel.send(':no_entry: `Max image limit (<= {0})`'.format(limit))
+ ctx.command.reset_cooldown(ctx)
+ return False
+ img_urls = []
+ count = 1
+ for url in urls:
+ user = None
+ if url.startswith('<@'):
+ continue
+ if not url.startswith('http'):
+ url = 'http://'+url
+ try:
+ if scale:
+ s_url = url[8:] if url.startswith('https://') else url[7:]
+ if str(math.floor(float(s_url))).isdigit():
+ int_scale = int(math.floor(float(s_url)))
+ scale_msg = '`Scale: {0}`\n'.format(int_scale)
+ if int_scale > scale_limit and await ctx.bot.is_owner(ctx.author):
+ int_scale = scale_limit
+ scale_msg = '`Scale: {0} (Limit: <= {1})`\n'.format(int_scale, scale_limit)
+ continue
+ except Exception as e:
+ pass
+ check = await check_func(url)
+ if check is False and gif is False:
+ check = await self.isgif(url)
+ if check:
+ if msg:
+ await channel.send(":warning: This command is for images, not gifs (use `gmagik` or `gascii`)!")
+ ctx.command.reset_cooldown(ctx)
+ return False
+ elif len(img_urls) == 0:
+ name = url[8:] if url.startswith('https://') else url[7:]
+ member = self.find_member(message.guild, name, 2)
+ if member:
+ img_urls.append(member.avatar_url_as(static_format="png") if member.avatar else member.default_avatar_url)
+ count += 1
+ continue
+ if msg:
+ await channel.send(':warning: Unable to download or verify URL is valid.')
+ ctx.command.reset_cooldown(ctx)
+ return False
+ else:
+ if msg:
+ await channel.send(':warning: Image `{0}` is Invalid!'.format(count))
+ continue
+ elif gif and check is False:
+ check = await self.isimage(url)
+ if check:
+ if msg:
+ await channel.send(":warning: This command is for gifs, not images (use `magik`)!")
+ ctx.command.reset_cooldown(ctx)
+ return False
+ elif len(img_urls) == 0:
+ name = url[8:] if url.startswith('https://') else url[7:]
+ member = self.find_member(message.guild, name, 2)
+ if member:
+ img_urls.append(member.avatar_url_as(static_format="png") if member.avatar else member.default_avatar_url)
+ count += 1
+ continue
+ if msg:
+ await channel.send(':warning: Unable to download or verify URL is valid.')
+ ctx.command.reset_cooldown(ctx)
+ return False
+ else:
+ if msg:
+ await channel.send(':warning: Gif `{0}` is Invalid!'.format(count))
+ continue
+ img_urls.append(url)
+ count += 1
+ else:
+ if len(img_urls) == 0:
+ attachment_images = await self.get_attachment_images(ctx, check_func)
+ if attachment_images:
+ img_urls.extend([*attachment_images])
+ else:
+ if msg:
+ await channel.send(":no_entry: Please input url(s){0}or attachment(s).".format(', mention(s) ' if not gif else ' '))
+ ctx.command.reset_cooldown(ctx)
+ return False
+ if scale:
+ if len(img_urls) == 0:
+ attachment_images = await self.get_attachment_images(ctx, check_func)
+ if attachment_images:
+ img_urls.extend([*attachment_images])
+ else:
+ if msg:
+ await channel.send(":no_entry: Please input url(s){0}or attachment(s).".format(', mention(s) ' if not gif else ' '))
+ ctx.command.reset_cooldown(ctx)
+ return False
+ return img_urls, int_scale, scale_msg
+ if img_urls:
+ return img_urls
+ return False
+ except Exception as e:
+ print(e)
+
+ async def truncate(self, channel, msg):
+ if len(msg) == 0:
+ return
+ split = [msg[i:i + 1999] for i in range(0, len(msg), 1999)]
+ try:
+ for s in split:
+ await channel.send(s)
+ await asyncio.sleep(0.21)
+ except Exception as e:
+ await channel.send(e)
+
+ async def get_json(self, url:str):
+ try:
+ async with self.session.get(url) as resp:
+ try:
+ load = await resp.json()
+ return load
+ except:
+ return {}
+ except asyncio.TimeoutError:
+ return {}
+
+ async def isimage(self, url:str):
+ try:
+ async with self.session.head(url) as resp:
+ if resp.status == 200:
+ mime = resp.headers.get('Content-type', '').lower()
+ if any([mime == x for x in self.image_mimes]):
+ return True
+ else:
+ return False
+ except:
+ return False
+
+ async def isgif(self, url:str):
+ try:
+ async with self.session.head(url) as resp:
+ if resp.status == 200:
+ mime = resp.headers.get('Content-type', '').lower()
+ if mime == "image/gif":
+ return True
+ else:
+ return False
+ except:
+ return False
+
+ async def download(self, url:str, path:str):
+ try:
+ async with self.session.get(url) as resp:
+ data = await resp.read()
+ with open(path, "wb") as f:
+ f.write(data)
+ except asyncio.TimeoutError:
+ return False
+
+ async def bytes_download(self, url:str):
+ try:
+ async with self.session.get(url) as resp:
+ data = await resp.read()
+ b = BytesIO(data)
+ b.seek(0)
+ return b
+ except asyncio.TimeoutError:
+ return False
+ except Exception as e:
+ print(e)
+ return False
+
+ async def run_process(self, code, response=False):
+ try:
+ loop = self.bot.loop
+ exit_future = asyncio.Future(loop=loop)
+ create = loop.subprocess_exec(lambda: DataProtocol(exit_future),
+ *code, stdin=None, stderr=None)
+ transport, protocol = await asyncio.wait_for(create, timeout=30)
+ await exit_future
+ if response:
+ data = bytes(protocol.output)
+ return data.decode('ascii').rstrip()
+ return True
+ except asyncio.TimeoutError:
+ return False
+ except Exception as e:
+ print(e)
+ finally:
+ transport.close()
+
+ async def gist(self, ctx, idk, content:str):
+ payload = {
+ 'name': 'NotSoBot - By: {0}.'.format(ctx.message.author),
+ 'title': 'ASCII for text: "{0}"'.format(idk),
+ 'text': content,
+ 'private': '1',
+ 'lang': 'python',
+ 'expire': '0'
+ }
+ with aiohttp.ClientSession() as session:
+ async with session.post('https://spit.mixtape.moe/api/create', data=payload) as r:
+ url = await r.text()
+ await ctx.send('Uploaded to paste, URL: <{0}>'.format(url))
+
+ def do_magik(self, scale, *imgs):
+ try:
+ list_imgs = []
+ exif = {}
+ exif_msg = ''
+ count = 0
+ for img in imgs:
+ i = wand.image.Image(file=img)
+ i.format = 'jpg'
+ i.alpha_channel = True
+ if i.size >= (3000, 3000):
+ return ':warning: `Image exceeds maximum resolution >= (3000, 3000).`', None
+ exif.update({count:(k[5:], v) for k, v in i.metadata.items() if k.startswith('exif:')})
+ count += 1
+ i.transform(resize='800x800>')
+ i.liquid_rescale(width=int(i.width * 0.5), height=int(i.height * 0.5), delta_x=int(0.5 * scale) if scale else 1, rigidity=0)
+ i.liquid_rescale(width=int(i.width * 1.5), height=int(i.height * 1.5), delta_x=scale if scale else 2, rigidity=0)
+ magikd = BytesIO()
+ i.save(file=magikd)
+ magikd.seek(0)
+ list_imgs.append(magikd)
+ if len(list_imgs) > 1:
+ imgs = [PIL.Image.open(i).convert('RGBA') for i in list_imgs]
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.hstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ ya = BytesIO()
+ imgs_comb.save(ya, 'png')
+ ya.seek(0)
+ elif not len(list_imgs):
+ return ':warning: **Command download function failed...**', None
+ else:
+ ya = list_imgs[0]
+ for x in exif:
+ if len(exif[x]) >= 2000:
+ continue
+ exif_msg += '**Exif data for image #{0}**\n'.format(str(x+1))+code.format(exif[x])
+ else:
+ if len(exif_msg) == 0:
+ exif_msg = None
+ return ya, exif_msg
+ except Exception as e:
+ return str(e), None
+
+ @commands.command(pass_context=True, aliases=['imagemagic', 'imagemagick', 'magic', 'magick', 'cas', 'liquid'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def magik(self, ctx, *urls:str):
+ """Apply magik to Image(s)\n .magik image_url or .magik image_url image_url_2"""
+ try:
+ get_images = await self.get_images(ctx, urls=urls, limit=6, scale=5)
+ if not get_images:
+ return
+ img_urls = get_images[0]
+ scale = get_images[1]
+ scale_msg = get_images[2]
+ if scale_msg is None:
+ scale_msg = ''
+ msg = await ctx.message.channel.send( "ok, processing")
+ list_imgs = []
+ for url in img_urls:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(img_urls) > 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ list_imgs.append(b)
+ final, content_msg = await self.bot.loop.run_in_executor(None, self.do_magik, scale, *list_imgs)
+ if type(final) == str:
+ await ctx.send(final)
+ return
+ if content_msg is None:
+ content_msg = scale_msg
+ else:
+ content_msg = scale_msg+content_msg
+ await msg.delete()
+ file = discord.File(final, filename='magik.png')
+ await ctx.send(content_msg, file=file)
+ except discord.errors.Forbidden:
+ await ctx.send(":warning: **I do not have permission to send files!**")
+ except Exception as e:
+ await ctx.send(e)
+
+ def do_gmagik(self, is_owner, gif, gif_dir, rand):
+ try:
+ try:
+ frame = PIL.Image.open(gif)
+ except:
+ return ':warning: Invalid Gif.'
+ if frame.size >= (3000, 3000):
+ os.remove(gif)
+ return ':warning: `GIF resolution exceeds maximum >= (3000, 3000).`'
+ nframes = 0
+ while frame:
+ frame.save('{0}/{1}_{2}.png'.format(gif_dir, nframes, rand), 'GIF')
+ nframes += 1
+ try:
+ frame.seek(nframes)
+ except EOFError:
+ break
+ imgs = glob.glob(gif_dir+"*_{0}.png".format(rand))
+ if (len(imgs) > 150) and not is_owner:
+ for image in imgs:
+ os.remove(image)
+ os.remove(gif)
+ return ":warning: `GIF has too many frames (>= 150 Frames).`"
+ for image in imgs:
+ try:
+ im = wand.image.Image(filename=image)
+ except Exception as e:
+ print(e)
+ continue
+ i = im.clone()
+ i.transform(resize='800x800>')
+ i.liquid_rescale(width=int(i.width*0.5), height=int(i.height*0.5), delta_x=1, rigidity=0)
+ i.liquid_rescale(width=int(i.width*1.5), height=int(i.height*1.5), delta_x=2, rigidity=0)
+ i.resize(i.width, i.height)
+ i.save(filename=image)
+ return True
+ except Exception as e:
+ exc_type, exc_obj, tb = sys.exc_info()
+ f = tb.tb_frame
+ lineno = tb.tb_lineno
+ filename = f.f_code.co_filename
+ linecache.checkcache(filename)
+ line = linecache.getline(filename, lineno, f.f_globals)
+ print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
+
+ @commands.command(pass_context=True)
+ @commands.cooldown(1, 20, commands.BucketType.guild)
+ async def gmagik(self, ctx, url:str=None, framerate:str=None):
+ try:
+ url = await self.get_images(ctx, urls=url, gif=True, limit=2)
+ if url:
+ url = url[0]
+ else:
+ return
+ gif_dir = str(bundled_data_path(self))+'/gif/'
+ if not os.path.exists(gif_dir):
+ os.makedirs(gif_dir)
+ check = await self.isgif(url)
+ if check is False:
+ await ctx.send("Invalid or Non-GIF!")
+ ctx.command.reset_cooldown(ctx)
+ return
+ x = await ctx.message.channel.send( "ok, processing (this might take a while for big gifs)")
+ rand = self.random()
+ gifin = gif_dir+'1_{0}.gif'.format(rand)
+ gifout = gif_dir+'2_{0}.gif'.format(rand)
+ print(url)
+ await self.download(url, gifin)
+ is_owner = await ctx.bot.is_owner(ctx.author)
+ if os.path.getsize(gifin) > 5000000 and not is_owner:
+ await ctx.send(":no_entry: `GIF Too Large (>= 5 mb).`")
+ os.remove(gifin)
+ return
+ try:
+ result = await self.bot.loop.run_in_executor(None, self.do_gmagik, is_owner, gifin, gif_dir, rand)
+ except Exception as e:
+ print("Failing here")
+ print(e)
+ await ctx.send(':warning: Gmagik failed...')
+ return
+ if type(result) == str:
+ await ctx.send(result)
+ return
+ try:
+ if framerate != None:
+ args = ['ffmpeg', '-y', '-nostats', '-loglevel', '0', '-i', gif_dir+'%d_{0}.png'.format(rand), '-r', framerate, gifout]
+ else:
+ args = ['ffmpeg', '-y', '-nostats', '-loglevel', '0', '-i', gif_dir+'%d_{0}.png'.format(rand), gifout]
+ except Exception as e:
+ print("Some error has occured:"+e)
+ print(gifout)
+ await self.run_process(args, True)
+ file = discord.File(gifout, filename='gmagik.gif')
+ await ctx.send(file=file)
+ for image in glob.glob(gif_dir+"*_{0}.png".format(rand)):
+ os.remove(image)
+ os.remove(gifin)
+ os.remove(gifout)
+ await x.delete()
+ except Exception as e:
+ print(e)
+
+ @commands.command(pass_context=True)
+ async def caption(self, ctx, url:str=None, text:str=None, color=None, size=None, x:int=None, y:int=None):
+ """Add caption to an image\n .caption text image_url"""
+ try:
+ if url is None:
+ await ctx.send("Error: Invalid Syntax\n`.caption ** * * * *`\n`* = Optional`\n`** = Wrap text in quotes`")
+ return
+ check = await self.isimage(url)
+ if check == False:
+ await ctx.send("Invalid or Non-Image!")
+ return
+ xx = await ctx.message.channel.send( "ok, processing")
+ b = await self.bytes_download(url)
+ img = wand.image.Image(file=b)
+ i = img.clone()
+ font_path = str(bundled_data_path(self))+'/arial.ttf'
+ if size != None:
+ color = wand.color.Color('{0}'.format(color))
+ font = wand.font.Font(path=font_path, size=int(size), color=color)
+ elif color != None:
+ color = wand.color.Color('{0}'.format(color))
+ font = wand.font.Font(path=font_path, size=40, color=color)
+ else:
+ color = wand.color.Color('red')
+ font = wand.font.Font(path=font_path, size=40, color=color)
+ if x is None:
+ x = None
+ y = int(i.height/10)
+ if x != None and x > 250:
+ x = x/2
+ if y != None and y > 250:
+ y = y/2
+ if x != None and x > 500:
+ x = x/4
+ if y != None and y > 500:
+ y = y/4
+ if x != None:
+ i.caption(str(text), left=x, top=y, font=font, gravity='center')
+ else:
+ i.caption(str(text), top=y, font=font, gravity='center')
+ final = BytesIO()
+ i.save(file=final)
+ final.seek(0)
+ await xx.delete()
+ file = discord.File(final, filename='caption.png')
+ await ctx.send(file=file)
+ except Exception as e:
+ await ctx.send("Error: Invalid Syntax\n `.caption ** * * * *`\n`* = Optional`\n`** = Wrap text in quotes`")
+ print(e)
+
+ @commands.command(pass_context=True)
+ @commands.cooldown(1, 5)
+ async def triggered(self, ctx, user:str=None):
+ """Generate a Triggered Gif for a User or Image"""
+ try:
+ url = None
+ if user is None:
+ user = ctx.message.author
+ elif len(ctx.message.mentions):
+ user = ctx.message.mentions[0]
+ else:
+ url = user
+ if type(user) == discord.User or type(user) == discord.Member:
+ if user.avatar:
+ avatar = user.avatar_url_as(static_format="png")
+ else:
+ avatar = user.default_avatar_url
+ if url:
+ get_images = await self.get_images(ctx, urls=url, limit=1)
+ if not get_images:
+ return
+ avatar = get_images[0]
+ path = str(bundled_data_path(self))+"/"+self.random(True)
+ path2 = path[:-3]+'gif'
+ await self.download(avatar, path)
+ t_path = await self.bytes_download("https://i.imgur.com/zDAY2yo.jpg")
+ print(t_path)
+ await self.run_process(['convert',
+ 'canvas:none',
+ '-size', '512x680!',
+ '-resize', '512x680!',
+ '-draw', 'image over -60,-60 640,640 "{0}"'.format(path),
+ '-draw', 'image over 0,586 0,0 "{0}"'.format(t_path),
+ '(',
+ 'canvas:none',
+ '-size', '512x680!',
+ '-draw', 'image over -45,-50 640,640 "{0}"'.format(path),
+ '-draw', 'image over 0,586 0,0 "{0}"'.format(t_path),
+ ')',
+ '(',
+ 'canvas:none',
+ '-size', '512x680!',
+ '-draw', 'image over -50,-45 640,640 "{0}"'.format(path),
+ '-draw', 'image over 0,586 0,0 "{0}"'.format(t_path),
+ ')',
+ '(',
+ 'canvas:none',
+ '-size', '512x680!',
+ '-draw', 'image over -45,-65 640,640 "{0}"'.format(path),
+ '-draw', 'image over 0,586 0,0 "{0}"'.format(t_path),
+ ')',
+ '-layers', 'Optimize',
+ '-set', 'delay', '2',
+ path2])
+ file = discord.File(path2, filename='/triggered.gif')
+ await ctx.send(file=file)
+ os.remove(path)
+ os.remove(path2)
+ except Exception as e:
+ await ctx.send(e)
+ try:
+ os.remove(path)
+ os.remove(path2)
+ except:
+ pass
+
+ async def do_triggered(self, ctx, user, url, t_path):
+ try:
+ if user is None:
+ user = ctx.message.author
+ elif len(ctx.message.mentions):
+ user = ctx.message.mentions[0]
+ else:
+ url = user
+ if type(user) == discord.User or type(user) == discord.Member:
+ if user.avatar:
+ avatar = user.avatar_url_as(static_format="png")
+ else:
+ avatar = user.default_avatar_url
+ if url:
+ get_images = await self.get_images(ctx, urls=url, limit=1)
+ if not get_images:
+ return
+ avatar = get_images[0]
+ path = str(bundled_data_path(self))+"/"+self.random(True)
+ await self.download(avatar, path)
+ await self.run_process(['convert',
+ '(',
+ path,
+ '-resize', '256',
+ ')',
+ t_path,
+ '-append', path
+ ])
+ return path
+ except Exception as e:
+ print(e)
+ return False
+
+ @commands.command(pass_context=True)
+ @commands.cooldown(1, 5)
+ async def triggered2(self, ctx, user:str=None, url:str=None):
+ """Generate a Triggered Image for a User or Image"""
+ t_path = await self.bytes_download("https://i.imgur.com/zDAY2yo.jpg")
+ path = await self.do_triggered(ctx, user, url, t_path)
+ if path is False:
+ await ctx.send(':warning: **Command Failed.**')
+ try:
+ os.remove(path)
+ except:
+ pass
+ return
+ file = discord.File(path, filename='triggered3.png')
+ await ctx.send(file=file)
+ os.remove(path)
+
+ @commands.command(pass_context=True, aliases=['aes'])
+ async def aesthetics(self, ctx, *, text:str):
+ """Returns inputed text in aesthetics"""
+ final = ""
+ pre = ' '.join(text)
+ for char in pre:
+ if not ord(char) in range(33, 127):
+ final += char
+ continue
+ final += chr(ord(char) + 65248)
+ await self.truncate(ctx.message.channel, final)
+
+ def do_ascii(self, text):
+ try:
+ i = PIL.Image.new('RGB', (2000, 1000))
+ img = PIL.ImageDraw.Draw(i)
+ txt = figlet_format(text, font='starwars')
+ img.text((20, 20), figlet_format(text, font='starwars'), fill=(0, 255, 0))
+ text_width, text_height = img.textsize(figlet_format(text, font='starwars'))
+ imgs = PIL.Image.new('RGB', (text_width + 30, text_height))
+ ii = PIL.ImageDraw.Draw(imgs)
+ ii.text((20, 20), figlet_format(text, font='starwars'), fill=(0, 255, 0))
+ text_width, text_height = ii.textsize(figlet_format(text, font='starwars'))
+ final = BytesIO()
+ imgs.save(final, 'png')
+ final.seek(0)
+ return final, txt
+ except:
+ return False, False
+
+ @commands.command(pass_context=True, aliases=['expand'])
+ @commands.cooldown(1, 5)
+ async def ascii(self, ctx, *, text:str):
+ """Convert text into ASCII"""
+ if len(text) > 1000:
+ await ctx.send("Text is too long!")
+ return
+ if text == 'donger' or text == 'dong':
+ text = "8====D"
+ final, txt = await self.bot.loop.run_in_executor(None, self.do_ascii, text)
+ if final is False:
+ await ctx.send(':no_entry: go away with your invalid characters.')
+ return
+ if len(txt) >= 1999:
+ await self.gist(ctx, text, txt)
+ msg = None
+ elif len(txt) <= 600:
+ msg = "```fix\n{0}```".format(txt)
+ else:
+ msg = None
+ file = discord.File(final, filename='ascii.png')
+ await ctx.send(msg, file=file)
+
+ def generate_ascii(self, image):
+ font = PIL.ImageFont.truetype(str(bundled_data_path(self))+'/arial.ttf', 15, encoding="unic")
+ image_width, image_height = image.size
+ aalib_screen_width= int(image_width/24.9)*10
+ aalib_screen_height= int(image_height/41.39)*10
+ screen = aalib.AsciiScreen(width=aalib_screen_width, height=aalib_screen_height)
+ im = image.convert("L").resize(screen.virtual_size)
+ screen.put_image((0,0), im)
+ y = 0
+ how_many_rows = len(screen.render().splitlines())
+ new_img_width, font_size = font.getsize(screen.render().splitlines()[0])
+ img = PIL.Image.new("RGBA", (new_img_width, how_many_rows*15), (255,255,255))
+ draw = PIL.ImageDraw.Draw(img)
+ for lines in screen.render().splitlines():
+ draw.text((0,y), lines, (0,0,0), font=font)
+ y = y + 15
+ imagefit = PIL.ImageOps.fit(img, (image_width, image_height), PIL.Image.ANTIALIAS)
+ return imagefit
+
+ @commands.command(pass_context=True)
+ @commands.cooldown(1, 5, commands.BucketType.user)
+ async def iascii(self, ctx, url:str=None):
+ if not AALIB_INSTALLED:
+ await ctx.send("aalib couldn't be found on this machine!")
+ return
+ try:
+ get_images = await self.get_images(ctx, urls=url, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ x = await ctx.send("ok, processing")
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ im = PIL.Image.open(b)
+ img = await self.bot.loop.run_in_executor(None, self.generate_ascii, im)
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ await x.delete()
+ file = discord.File(final, filename='iascii.png')
+ await ctx.send(file=file)
+ except Exception as e:
+ await ctx.send(e)
+
+ def do_gascii(self, b, rand, gif_dir):
+ try:
+ try:
+ im = PIL.Image.open(b)
+ except IOError:
+ return ':warning: Cannot load gif.'
+ count = 0
+ mypalette = im.getpalette()
+ try:
+ while True:
+ im.putpalette(mypalette)
+ new_im = PIL.Image.new("RGBA", im.size)
+ new_im.paste(im)
+ new_im = self.generate_ascii(new_im)
+ new_im.save('{0}/{1}_{2}.png'.format(gif_dir, count, rand))
+ count += 1
+ im.seek(im.tell() + 1)
+ return True
+ except EOFError:
+ pass
+ except Exception as e:
+ print(e)
+
+ @commands.command(pass_context=True)
+ @commands.cooldown(1, 10, commands.BucketType.guild)
+ async def gascii(self, ctx, url:str=None):
+ """Gif to ASCII"""
+ if not AALIB_INSTALLED:
+ await ctx.send("aalib couldn't be found on this machine!")
+ return
+ try:
+ get_images = await self.get_images(ctx, urls=url, gif=True, limit=2)
+ if not get_images:
+ await ctx.send("Error: Invalid Syntax\n`.gascii *`\n`* = Optional`")
+ return
+ for url in get_images:
+ rand = self.random()
+ gif_dir = str(bundled_data_path(self)) + '/gascii/'
+ if not os.path.os.path.exists(gif_dir):
+ os.makedirs(gif_dir)
+ location = gif_dir+'1_{0}.gif'.format(rand)
+ location2 = gif_dir+'2_{0}.gif'.format(rand)
+ x = await ctx.message.channel.send( "ok, processing")
+ await self.download(url, location)
+ if os.path.getsize(location) > 3000000 and await ctx.bot.is_owner(ctx.author):
+ await ctx.send("Sorry, GIF Too Large!")
+ os.remove(location)
+ return
+ result = await self.bot.loop.run_in_executor(None, self.do_gascii, location, rand, gif_dir)
+ if type(result) == str:
+ await ctx.send(result)
+ return
+ list_imgs = glob.glob(gif_dir+"*_{0}.png".format(rand))
+ if len(list_imgs) > 120 and await ctx.bot.is_owner(ctx.author):
+ await ctx.send("Sorry, GIF has too many frames!")
+ for image in list_imgs:
+ os.remove(image)
+ os.remove(location)
+ return
+ await self.run_process(['ffmpeg', '-y', '-nostats', '-loglevel', '0', '-i', gif_dir+'%d_{0}.png'.format(rand), location2])
+ await x.delete()
+ print("it gets here")
+ file = discord.File(location2, filename='gascii.gif')
+ await ctx.send(file=file)
+ for image in list_imgs:
+ os.remove(image)
+ os.remove(location)
+ os.remove(location2)
+ except Exception as e:
+ print(e)
+ await ctx.send("Whoops something went wrong!")
+
+ @commands.command(pass_context=True)
+ async def rip(self, ctx, name:str=None, *, text:str=None):
+ if name is None:
+ name = ctx.message.author.name
+ if len(ctx.message.mentions) >= 1:
+ name = ctx.message.mentions[0].name
+ if text != None:
+ if len(text) > 22:
+ one = text[:22]
+ two = text[22:]
+ url = "http://www.tombstonebuilder.com/generate.php?top1=R.I.P&top3={0}&top4={1}&top5={2}".format(name, one, two).replace(" ", "%20")
+ else:
+ url = "http://www.tombstonebuilder.com/generate.php?top1=R.I.P&top3={0}&top4={1}".format(name, text).replace(" ", "%20")
+ else:
+ if name[-1].lower() != 's':
+ name += "'s"
+ url = "http://www.tombstonebuilder.com/generate.php?top1=R.I.P&top3={0}&top4=Hopes and Dreams".format(name).replace(" ", "%20")
+ b = await self.bytes_download(url)
+ file = discord.File(b, filename='rip.png')
+ await ctx.send(file=file)
+
+ async def add_cache(self, search, result, t=0, level=1):
+ try:
+ try:
+ if result['error']:
+ return
+ except KeyError:
+ pass
+ if t == 0:
+ self.image_cache[search] = [result, level]
+ elif t == 1:
+ self.search_cache[search] = [result, level]
+ elif t == 2:
+ self.youtube_cache[search] = [result, level]
+ except Exception as e:
+ print(e)
+
+ async def google_scrap(self, search:str, safe=True, image=False):
+ headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:43.0) Gecko/20100101 Firefox/43.0'}
+ search = quote(search)
+ try:
+ if image:
+ api = 'https://www.google.com/search?tbm=isch&gs_l=img&safe={0}&q={1}'.format('on' if safe else 'off', search)
+ with aiohttp.ClientSession() as session:
+ async with session.get(api, headers=headers) as r:
+ assert r.status == 200
+ txt = await r.text()
+ match = self.scrap_regex.findall(txt)
+ assert match
+ image = random.choice(match[:10])
+ check = await self.isimage(image)
+ i = 0
+ if not check:
+ while not check and i != 10:
+ image = match[:10][i]
+ check = await self.isimage(image)
+ i += 1
+ assert check
+ return image
+ else:
+ api = 'https://www.google.com/search?safe={0}&q={1}'.format('on' if safe else 'off', search)
+ #why are you so good danny, my old method was using regex so, not so good.....
+ entries = {}
+ with aiohttp.ClientSession() as session:
+ async with session.get(api, headers=headers) as r:
+ assert r.status == 200
+ txt = await r.text()
+ root = etree.fromstring(txt, etree.HTMLParser())
+ search_nodes = root.findall(".//div[@class='g']")
+ result = False
+ for node in search_nodes:
+ if result != False:
+ break
+ try:
+ url_node = node.find('.//h3/a')
+ if url_node is None:
+ continue
+ desc = get_deep_text(node.find(".//div[@class='s']/div/span[@class='st']"))
+ title = get_deep_text(node.find(".//h3[@class='r']"))
+ url = url_node.attrib['href']
+ if url.startswith('/url?'):
+ url = parse_qs(url[5:])['q'][0]
+ result = [title, desc, url]
+ except:
+ continue
+ return result
+ except AssertionError:
+ return False
+ except Exception as e:
+ print(e)
+ return False
+
+ @commands.group(pass_context=True, invoke_without_command=True)
+ @commands.cooldown(1, 5)
+ async def merge(self, ctx, *urls:str):
+ """Merge/Combine Two Photos"""
+ try:
+ if urls and 'vertical' in urls:
+ vertical = True
+ else:
+ vertical = False
+ get_images = await self.get_images(ctx, urls=urls, limit=20)
+ if get_images and len(get_images) == 1:
+ await ctx.send('You gonna merge one image?')
+ return
+ elif not get_images:
+ return
+ xx = await ctx.message.channel.send( "ok, processing")
+ count = 0
+ list_im = []
+ for url in get_images:
+ count += 1
+ b = await self.bytes_download(url)
+ if sys.getsizeof(b) == 215:
+ await ctx.send(":no_entry: Image `{0}` is invalid!".format(str(count)))
+ continue
+ list_im.append(b)
+ imgs = [PIL.Image.open(i).convert('RGBA') for i in list_im]
+ if vertical:
+ max_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[1][1]
+ imgs_comb = np.vstack((np.asarray(i.resize(max_shape)) for i in imgs))
+ else:
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.hstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ final = BytesIO()
+ imgs_comb.save(final, 'png')
+ final.seek(0)
+ await xx.delete()
+ file = discord.File(final, filename='merge.png')
+ await ctx.send(file=file)
+ except Exception as e:
+ await ctx.send(code.format(e))
+
+ @commands.command(pass_context=True, aliases=['cancerify', 'em'])
+ async def emojify(self, ctx, *, txt:str):
+ txt = txt.lower()
+ msg = ""
+ for s in txt:
+ if s in self.emoji_map:
+ msg += "{0}".format(self.emoji_map[s])
+ else:
+ msg += s
+ await ctx.send(msg)
+
+ @commands.command(pass_context=True, aliases=['toe', 'analyze'])
+ async def tone(self, ctx, *, text:str):
+ """Analyze Tone in Text"""
+ payload = {'text':text}
+ headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0.2 Waterfox/46.0.2'}
+ async with self.session.post('https://tone-analyzer-demo.ng.bluemix.net/api/tone', data=payload, headers=headers) as r:
+ load = await r.json()
+ emotions_msg = "\n".join("{}: {}".format(t["tone_name"], t["score"]) for t in load["document_tone"]["tones"])
+ sentence_msg = ""
+ if "sentences_msg" in load:
+ for sentence in load["sentences_tone"]:
+ sentence_msg += "".join("# Sentence {}\n{}: {}\n"
+ .format(sentence["sentence_id"]+1, t["tone_name"], t["score"]) for t in sentence["tones"])
+ try:
+ em = discord.Embed(colour=await self.bot.db.color())
+ em.add_field(name="Emotions", value=emotions_msg)
+ if sentence_msg != "":
+ em.add_field(name="Sentences", value=sentence_msg)
+ await ctx.send(embed=em)
+ except:
+ full_msg = "\n**Emotions**"+code.format(emotions_msg)
+ if sentence_msg != "":
+ full_msg += "**Sentence Style**"+code.format(sentence_msg)
+ await ctx.send(full_msg)
+
+ @commands.command(pass_context=True, aliases=['text2img', 'texttoimage', 'text2image'])
+ async def tti(self, ctx, *, txt:str):
+ api = 'http://api.img4me.com/?font=arial&fcolor=FFFFFF&size=35&type=png&text={0}'.format(quote(txt))
+ r = await self.get_text(api)
+ b = await self.bytes_download(r)
+ file = discord.File(b, filename='tti.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True, aliases=['comicsans'])
+ async def sans(self, ctx, *, txt:str):
+ api = 'http://api.img4me.com/?font=sans&fcolor=000000&size=35&type=png&text={0}'.format(quote(txt))
+ r = await self.get_text(api)
+ b = await self.bytes_download(r)
+ file = discord.File(b, filename='tti.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True, aliases=['needsmorejpeg', 'jpegify', 'magik2'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def jpeg(self, ctx, url:str=None, quality:int=1):
+ """Add more JPEG to an Image\nNeeds More JPEG!"""
+ if quality > 10:
+ quality = 10
+ elif quality < 1:
+ quality = 1
+ get_images = await self.get_images(ctx, urls=url)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ img = PIL.Image.open(b).convert('RGB')
+ final = BytesIO()
+ img.save(final, 'JPEG', quality=quality)
+ final.seek(0)
+ file = discord.File(final, filename='needsmorejpeg.jpg')
+ await ctx.send(file=file)
+
+ def do_vw(self, b, txt):
+ im = PIL.Image.open(b)
+ k = random.randint(0, 100)
+ im = macintoshplus.draw_method1(k, txt, im)
+ final = BytesIO()
+ im.save(final, 'png')
+ final.seek(0)
+ return final
+
+ @commands.command(pass_context=True, aliases=['vaporwave', 'vape', 'vapewave'])
+ @commands.cooldown(2, 5)
+ async def vw(self, ctx, url:str, *, txt:str=None):
+ """Vaporwave an image!"""
+ get_images = await self.get_images(ctx, urls=url, limit=1)
+ if not get_images:
+ return
+ for url in get_images:
+ if txt is None:
+ txt = "vapor wave"
+ b = await self.bytes_download(url)
+ final = await self.bot.loop.run_in_executor(None, self.do_vw, b, txt)
+ file = discord.File(final, filename='vapewave.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True, aliases=['achievement', 'ach'])
+ async def mc(self, ctx, *, txt:str):
+ """Generate a Minecraft Achievement"""
+ api = "https://mcgen.herokuapp.com/a.php?i=1&h=Achievement-{0}&t={1}".format(ctx.message.author.name, txt)
+ b = await self.bytes_download(api)
+ i = 0
+ while sys.getsizeof(b) == 88 and i != 10:
+ b = await self.bytes_download(api)
+ if sys.getsizeof(b) != 0:
+ i = 10
+ else:
+ i += 1
+ if i == 10 and sys.getsizeof(b) == 88:
+ await ctx.send("Minecraft Achievement Generator API is bad, pls try again")
+ return
+ file = discord.File(b, filename='achievement.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True, aliases=['wm'])
+ async def watermark(self, ctx, url:str, mark:str=None):
+ try:
+ check = await self.isimage(url)
+ if check == False:
+ await ctx.send("Invalid or Non-Image!")
+ return
+ b = await self.bytes_download(url)
+ if mark == 'brazzers' or mark is None:
+ wmm = await self.bytes_download("https://i.imgur.com/YAb1RMZ.png")
+ else:
+ check = await self.isimage(mark)
+ if check == False:
+ await ctx.send("Invalid or Non-Image for Watermark!")
+ return
+ wmm = await self.bytes_download(mark)
+ final = BytesIO()
+ with wand.image.Image(file=b) as img:
+ if mark:
+ with wand.image.Image(file=wmm) as wm:
+ img.watermark(image=wm, left=0, top=0)
+ else:
+ with wand.image.Image(filename=wmm) as wm:
+ img.watermark(image=wm, left=0, top=0)
+ img.save(file=final)
+ final.seek(0)
+ file = discord.File(final, filename='watermark.png')
+ await ctx.send(file=file)
+ except Exception as e:
+ exc_type, exc_obj, tb = sys.exc_info()
+ f = tb.tb_frame
+ lineno = tb.tb_lineno
+ filename = f.f_code.co_filename
+ linecache.checkcache(filename)
+ line = linecache.getline(filename, lineno, f.f_globals)
+ await ctx.send(code.format('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)))
+
+ def do_glitch(self, b, amount, seed, iterations):
+ b.seek(0)
+ img = jpglitch.Jpeg(bytearray(b.getvalue()), amount, seed, iterations)
+ final = BytesIO()
+ img.save_image(final)
+ final.seek(0)
+ return final
+
+ def do_gglitch(self, b):
+ b = bytearray(b.getvalue())
+ for x in range(0, sys.getsizeof(b)):
+ if b[x] == 33:
+ if b[x + 1] == 255:
+ end = x
+ break
+ elif b[x + 1] == 249:
+ end = x
+ break
+ for x in range(13, end):
+ b[x] = random.randint(0, 255)
+ return BytesIO(b)
+
+ @commands.command(aliases=['jpglitch'], pass_context=True)
+ @commands.cooldown(2, 5)
+ async def glitch(self, ctx, url:str=None, iterations:int=None, amount:int=None, seed:int=None):
+ """Glitch a gif or image"""
+ try:
+ if iterations is None:
+ iterations = random.randint(1, 30)
+ if amount is None:
+ amount = random.randint(1, 20)
+ elif amount > 99:
+ amount = 99
+ if seed is None:
+ seed = random.randint(1, 20)
+ get_images = await self.get_images(ctx, urls=url, msg=False)
+ gif = False
+ if not get_images:
+ get_images = await self.get_images(ctx, urls=url, gif=True)
+ if get_images:
+ gif = True
+ else:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if not gif:
+ img = PIL.Image.open(b)
+ b = BytesIO()
+ img.save(b, format='JPEG')
+ final = await self.bot.loop.run_in_executor(None, self.do_glitch, b, amount, seed, iterations)
+ file = discord.File(final, filename='glitch.jpeg')
+ await ctx.send('Iterations: `{0}` | Amount: `{1}` | Seed: `{2}`'.format(iterations, amount, seed), file=file)
+ else:
+ final = await self.bot.loop.run_in_executor(None, self.do_gglitch, b)
+ file = discord.File(final, filename='glitch.gif')
+ await ctx.send(file=file)
+ except:
+ await ctx.send("sorry, can't reglitch an image.")
+ raise
+
+ @commands.command(pass_context=True)
+ async def glitch2(self, ctx, *urls:str):
+
+ try:
+ get_images = await self.get_images(ctx, urls=urls)
+ if not get_images:
+ return
+ for url in get_images:
+ path = str(bundled_data_path(self))+"/"+self.random(True)
+ await self.download(url, path)
+ args = ['convert', '(', path, '-resize', '1024x1024>', ')', '-alpha', 'on', '(', '-clone', '0', '-channel', 'RGB', '-separate', '-channel', 'A', '-fx', '0', '-compose', 'CopyOpacity', '-composite', ')', '(', '-clone', '0', '-roll', '+5', '-channel', 'R', '-fx', '0', '-channel', 'A', '-evaluate', 'multiply', '.3', ')', '(', '-clone', '0', '-roll', '-5', '-channel', 'G', '-fx', '0', '-channel', 'A', '-evaluate', 'multiply', '.3', ')', '(', '-clone', '0', '-roll', '+0+5', '-channel', 'B', '-fx', '0', '-channel', 'A', '-evaluate', 'multiply', '.3', ')', '(', '-clone', '0', '-channel', 'A', '-fx', '0', ')', '-delete', '0', '-background', 'none', '-compose', 'SrcOver', '-layers', 'merge', '-rotate', '90', '-wave', '1x5', '-rotate', '-90', path]
+ await self.run_process(args)
+ file = discord.File(path, filename='glitch2.png')
+ await ctx.send(file=file)
+ os.remove(path)
+ except Exception as e:
+ print(e)
+ try:
+ os.remove(path)
+ except:
+ pass
+ raise
+
+ @commands.command(aliases=['pixel'], pass_context=True)
+ async def pixelate(self, ctx, *urls):
+ try:
+ get_images = await self.get_images(ctx, urls=urls, limit=6, scale=3000)
+ if not get_images:
+ return
+ img_urls = get_images[0]
+ pixels = get_images[1]
+ if pixels is None:
+ pixels = 9
+ scale_msg = get_images[2]
+ if scale_msg is None:
+ scale_msg = ''
+ for url in img_urls:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(img_urls) > 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ bg = (0, 0, 0)
+ img = PIL.Image.open(b)
+ img = img.resize((int(img.size[0]/pixels), int(img.size[1]/pixels)), PIL.Image.NEAREST)
+ img = img.resize((int(img.size[0]*pixels), int(img.size[1]*pixels)), PIL.Image.NEAREST)
+ load = img.load()
+ for i in range(0, img.size[0], pixels):
+ for j in range(0, img.size[1], pixels):
+ for r in range(pixels):
+ load[i+r, j] = bg
+ load[i, j+r] = bg
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ file = discord.File(final, filename='pixelated.png')
+ await ctx.send(scale_msg, file=file)
+ await asyncio.sleep(0.21)
+ except Exception as e:
+ print(e)
+ await ctx.send(':warning: `Too many pixels.`')
+
+ async def do_retro(self, text, bcg):
+ if '|' not in text:
+ if len(text) >= 15:
+ text = [text[i:i + 15] for i in range(0, len(text), 15)]
+ else:
+ split = text.split()
+ if len(split) == 1:
+ text = [x for x in text]
+ if len(text) == 4:
+ text[2] = text[2]+text[-1]
+ del text[3]
+ else:
+ text = split
+ else:
+ text = text.split('|')
+ headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:43.0) Gecko/20100101 Firefox/43.0'}
+ payload = aiohttp.FormData()
+ payload.add_field('current-category', 'all_effects')
+ payload.add_field('bcg', bcg)
+ payload.add_field('txt', '4')
+ count = 1
+ for s in text:
+ if count > 3:
+ break
+ payload.add_field('text'+str(count), s.replace("'", "\'"))
+ count += 1
+ try:
+ async with self.session.post('https://photofunia.com/effects/retro-wave?guild=3', data=payload, headers=headers) as r:
+ txt = await r.text()
+ except:
+ return
+ match = self.retro_regex.findall(txt)
+ if match:
+ download_url = match[0][0]
+ b = await self.bytes_download(download_url)
+ return b
+ return False
+
+ @commands.command()
+ async def retro(self, ctx, *, text:str):
+ retro_result = await self.do_retro(text, '5')
+ if retro_result is False:
+ await ctx.send(':warning: This text contains unsupported characters')
+ else:
+ file = discord.File(retro_result, filename='retro.png')
+ await ctx.send(file=file)
+
+ @commands.command()
+ async def retro2(self, ctx, *, text:str):
+ retro_result = await self.do_retro(text, '2')
+ if retro_result is False:
+ await ctx.send(':warning: This text contains unsupported characters')
+ else:
+ file = discord.File(retro_result, filename='retro.png')
+ await ctx.send(file=file)
+
+ @commands.command()
+ async def retro3(self, ctx, *, text:str):
+ retro_result = await self.do_retro(text, '4')
+ if retro_result is False:
+ await ctx.send(':warning: This text contains unsupported characters')
+ else:
+ file = discord.File(retro_result, filename='retro.png')
+ await ctx.send(file=file)
+
+ def do_waaw(self, b):
+ f = BytesIO()
+ f2 = BytesIO()
+ with wand.image.Image(file=b, format='png') as img:
+ h1 = img.clone()
+ width = int(img.width/2) if int(img.width/2) > 0 else 1
+ h1.crop(width=width, height=int(img.height), gravity='east')
+ h2 = h1.clone()
+ h1.rotate(degree=180)
+ h1.flip()
+ h1.save(file=f)
+ h2.save(file=f2)
+ f.seek(0)
+ f2.seek(0)
+ list_im = [f2, f]
+ imgs = [PIL.ImageOps.mirror(PIL.Image.open(i).convert('RGBA')) for i in list_im]
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.hstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ final = BytesIO()
+ imgs_comb.save(final, 'png')
+ final.seek(0)
+ return final
+
+ #Thanks to Iguniisu#9746 for the idea
+ @commands.command(pass_context=True, aliases=['magik3', 'mirror'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def waaw(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ final = await self.bot.loop.run_in_executor(None, self.do_waaw, b)
+ file = discord.File(final, filename='waaw.png')
+ await ctx.send(file=file)
+
+ def do_haah(self, b):
+ f = BytesIO()
+ f2 = BytesIO()
+ with wand.image.Image(file=b, format='png') as img:
+ h1 = img.clone()
+ h1.transform('50%x100%')
+ h2 = h1.clone()
+ h2.rotate(degree=180)
+ h2.flip()
+ h1.save(file=f)
+ h2.save(file=f2)
+ f.seek(0)
+ f2.seek(0)
+ list_im = [f2, f]
+ imgs = [PIL.ImageOps.mirror(PIL.Image.open(i).convert('RGBA')) for i in list_im]
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.hstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ final = BytesIO()
+ imgs_comb.save(final, 'png')
+ final.seek(0)
+ return final
+
+ @commands.command(pass_context=True, aliases=['magik4', 'mirror2'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def haah(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ final = await self.bot.loop.run_in_executor(None, self.do_haah, b)
+ file = discord.File(final, filename='haah.png')
+ await ctx.send(file=file)
+
+ def do_woow(self, b):
+ f = BytesIO()
+ f2 = BytesIO()
+ with wand.image.Image(file=b, format='png') as img:
+ h1 = img.clone()
+ width = int(img.width) if int(img.width) > 0 else 1
+ h1.crop(width=width, height=int(img.height/2), gravity='north')
+ h2 = h1.clone()
+ h2.rotate(degree=180)
+ h2.flop()
+ h1.save(file=f)
+ h2.save(file=f2)
+ f.seek(0)
+ f2.seek(0)
+ list_im = [f, f2]
+ imgs = [PIL.Image.open(i).convert('RGBA') for i in list_im]
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.vstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ final = BytesIO()
+ imgs_comb.save(final, 'png')
+ final.seek(0)
+ return final
+
+ @commands.command(pass_context=True, aliases=['magik5', 'mirror3'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def woow(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ final = await self.bot.loop.run_in_executor(None, self.do_woow, b)
+ file = discord.File(final, filename='woow.png')
+ await ctx.send(file=file)
+
+ def do_hooh(self, b):
+ f = BytesIO()
+ f2 = BytesIO()
+ with wand.image.Image(file=b, format='png') as img:
+ h1 = img.clone()
+ width = int(img.width) if int(img.width) > 0 else 1
+ h1.crop(width=width, height=int(img.height/2), gravity='south')
+ h2 = h1.clone()
+ h1.rotate(degree=180)
+ h2.flop()
+ h1.save(file=f)
+ h2.save(file=f2)
+ f.seek(0)
+ f2.seek(0)
+ list_im = [f, f2]
+ imgs = [PIL.Image.open(i).convert('RGBA') for i in list_im]
+ min_shape = sorted([(np.sum(i.size), i.size) for i in imgs])[0][1]
+ imgs_comb = np.vstack((np.asarray(i.resize(min_shape)) for i in imgs))
+ imgs_comb = PIL.Image.fromarray(imgs_comb)
+ final = BytesIO()
+ imgs_comb.save(final, 'png')
+ final.seek(0)
+ return final
+
+ @commands.command(pass_context=True, aliases=['magik6', 'mirror4'])
+ @commands.cooldown(2, 5, commands.BucketType.user)
+ async def hooh(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ if b is False:
+ if len(get_images) == 1:
+ await ctx.send(':warning: **Command download function failed...**')
+ return
+ continue
+ final = await self.bot.loop.run_in_executor(None, self.do_hooh, b)
+ file = discord.File(final, filename='hooh.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True)
+ async def flipimg(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ img = PIL.Image.open(b)
+ img = PIL.ImageOps.flip(img)
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ file = discord.File(final, filename='flip.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True)
+ async def flop(self, ctx, *urls:str):
+ get_images = await self.get_images(ctx, urls=urls, limit=5)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ img = PIL.Image.open(b)
+ img = PIL.ImageOps.mirror(img)
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ file = discord.File(final, filename='flop.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True, aliases=['inverse', 'negate'])
+ async def invert(self, ctx, url:str="None"):
+ get_images = await self.get_images(ctx, urls=url, limit=3)
+ if not get_images:
+ return
+ for url in get_images:
+ b = await self.bytes_download(url)
+ img = PIL.Image.open(b).convert('RGB')
+ img = PIL.ImageOps.invert(img)
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ file = discord.File(final, filename='flop.png')
+ await ctx.send(file=file)
+
+ @commands.command(pass_context=True)
+ async def rotate(self, ctx, *urls:str):
+ """Rotate image X degrees"""
+ get_images = await self.get_images(ctx, urls=urls, limit=3, scale=360)
+ if not get_images:
+ return
+ img_urls = get_images[0]
+ scale = get_images[1] if get_images[1] else random.choice([90, 180, 50, 45, 270, 120, 80])
+ for url in img_urls:
+ b = await self.bytes_download(url)
+ img = PIL.Image.open(b).convert('RGBA')
+ img = img.rotate(int(scale))
+ final = BytesIO()
+ img.save(final, 'png')
+ final.seek(0)
+ file = discord.File(final, filename='rotate.png')
+ await ctx.send('Rotated: `{0}°`'.format(scale), file=file)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
+
+ __del__ = __unload
diff --git a/notsobot/pixelsort/constants.py b/notsobot/pixelsort/constants.py
new file mode 100644
index 0000000..28d24d0
--- /dev/null
+++ b/notsobot/pixelsort/constants.py
@@ -0,0 +1,2 @@
+black_pixel = (0, 0, 0, 255)
+white_pixel = (255, 255, 255, 255)
diff --git a/notsobot/pixelsort/interval.py b/notsobot/pixelsort/interval.py
new file mode 100644
index 0000000..d41e290
--- /dev/null
+++ b/notsobot/pixelsort/interval.py
@@ -0,0 +1,174 @@
+from PIL import Image, ImageFilter
+import random as rand
+from . import constants
+from . import util
+
+
+def edge(pixels, image, angle):
+ img = Image.open(image)
+ img = img.rotate(angle, expand=True)
+ edges = img.filter(ImageFilter.FIND_EDGES)
+ edges = edges.convert('RGBA')
+ edge_data = edges.load()
+
+ filter_pixels = []
+ edge_pixels = []
+ intervals = []
+
+
+ for y in range(img.size[1]):
+ filter_pixels.append([])
+ for x in range(img.size[0]):
+ filter_pixels[y].append(edge_data[x, y])
+
+
+ for y in range(len(pixels)):
+ edge_pixels.append([])
+ for x in range(len(pixels[0])):
+ if util.lightness(filter_pixels[y][x]) < 0.25:
+ edge_pixels[y].append(constants.white_pixel)
+ else:
+ edge_pixels[y].append(constants.black_pixel)
+
+
+ for y in range(len(pixels) - 1, 1, -1):
+ for x in range(len(pixels[0]) - 1, 1, -1):
+ if edge_pixels[y][x] == constants.black_pixel and edge_pixels[y][x - 1] == constants.black_pixel:
+ edge_pixels[y][x] = constants.white_pixel
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ for x in range(len(pixels[0])):
+ if edge_pixels[y][x] == constants.black_pixel:
+ intervals[y].append(x)
+ intervals[y].append(len(pixels[0]))
+ return intervals
+
+
+def threshold(pixels, image, angle):
+ intervals = []
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ for x in range(len(pixels[0])):
+ if util.lightness(pixels[y][x]) < 0.25 or util.lightness(pixels[y][x]) > 0.8:
+ intervals[y].append(x)
+ intervals[y].append(len(pixels[0]))
+ return intervals
+
+
+def random(pixels, image, angle):
+ intervals = []
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ x = 0
+ while True:
+ width = util.random_width(50)
+ x += width
+ if x > len(pixels[0]):
+ intervals[y].append(len(pixels[0]))
+ break
+ else:
+ intervals[y].append(x)
+ return intervals
+
+
+def waves(pixels, image, angle):
+ intervals = []
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ x = 0
+ while True:
+ width = 50 + rand.randint(0, 10)
+ x += width
+ if x > len(pixels[0]):
+ intervals[y].append(len(pixels[0]))
+ break
+ else:
+ intervals[y].append(x)
+ return intervals
+
+
+def file_mask(pixels, image, angle):
+ intervals = []
+ file_pixels = []
+
+ img = Image.open(image)
+ img = img.convert('RGBA')
+ data = img.load()
+ for y in range(img.size[1]):
+ file_pixels.append([])
+ for x in range(img.size[0]):
+ file_pixels[y].append(data[x, y])
+
+
+ for y in range(len(pixels) - 1, 1, -1):
+ for x in range(len(pixels[0]) - 1, 1, -1):
+ if file_pixels[y][x] == constants.black_pixel and file_pixels[y][x - 1] == constants.black_pixel:
+ file_pixels[y][x] = constants.white_pixel
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ for x in range(len(pixels[0])):
+ if file_pixels[y][x] == constants.black_pixel:
+ intervals[y].append(x)
+ intervals[y].append(len(pixels[0]))
+
+ return intervals
+
+
+def file_edges(pixels, image, angle):
+ img = Image.open(image)
+ img = img.rotate(angle, expand=True)
+ img = img.resize((len(pixels[0]), len(pixels)), Image.ANTIALIAS)
+ edges = img.filter(ImageFilter.FIND_EDGES)
+ edges = edges.convert('RGBA')
+ edge_data = edges.load()
+
+ filter_pixels = []
+ edge_pixels = []
+ intervals = []
+
+
+ for y in range(img.size[1]):
+ filter_pixels.append([])
+ for x in range(img.size[0]):
+ filter_pixels[y].append(edge_data[x, y])
+
+
+ for y in range(len(pixels)):
+ edge_pixels.append([])
+ for x in range(len(pixels[0])):
+ if util.lightness(filter_pixels[y][x]) < 0.25:
+ edge_pixels[y].append(constants.white_pixel)
+ else:
+ edge_pixels[y].append(constants.black_pixel)
+
+
+ for y in range(len(pixels) - 1, 1, -1):
+ for x in range(len(pixels[0]) - 1, 1, -1):
+ if edge_pixels[y][x] == constants.black_pixel and edge_pixels[y][x - 1] == constants.black_pixel:
+ edge_pixels[y][x] = constants.white_pixel
+
+
+ for y in range(len(pixels)):
+ intervals.append([])
+ for x in range(len(pixels[0])):
+ if edge_pixels[y][x] == constants.black_pixel:
+ intervals[y].append(x)
+ intervals[y].append(len(pixels[0]))
+ return intervals
+
+
+def none(pixels, image, angle):
+ intervals = []
+ for y in range(len(pixels)):
+ intervals.append([len(pixels[y])])
+ return intervals
diff --git a/notsobot/pixelsort/sorter.py b/notsobot/pixelsort/sorter.py
new file mode 100644
index 0000000..1d588a5
--- /dev/null
+++ b/notsobot/pixelsort/sorter.py
@@ -0,0 +1,23 @@
+import random
+
+def sort_image(pixels, intervals, randomness, s_func):
+ sorted_pixels = []
+ for y in range(len(pixels)):
+ row = []
+ x_min = 0
+ for x_max in intervals[y]:
+ interval = []
+ for x in range(x_min, x_max):
+ interval.append(pixels[y][x])
+ if random.randint(0, 100) >= randomness:
+ row += sort_interval(interval, s_func)
+ else:
+ row += interval
+ x_min = x_max
+ row.append(pixels[y][0])
+ sorted_pixels.append(row)
+ return sorted_pixels
+
+
+def sort_interval(interval, sorting_function):
+ return [] if interval == [] else sorted(interval, key=sorting_function)
diff --git a/notsobot/pixelsort/sorting.py b/notsobot/pixelsort/sorting.py
new file mode 100644
index 0000000..606c564
--- /dev/null
+++ b/notsobot/pixelsort/sorting.py
@@ -0,0 +1,17 @@
+from . import util
+
+
+def lightness(pixel):
+ return util.lightness(pixel)
+
+
+def intensity(pixel):
+ return pixel[0] + pixel[1] + pixel[2]
+
+
+def maximum(pixel):
+ return max(pixel[0], pixel[1], pixel[2])
+
+
+def minimum(pixel):
+ return min(pixel[0], pixel[1], pixel[2])
diff --git a/notsobot/pixelsort/util.py b/notsobot/pixelsort/util.py
new file mode 100644
index 0000000..f38d609
--- /dev/null
+++ b/notsobot/pixelsort/util.py
@@ -0,0 +1,36 @@
+import random
+import string
+from colorsys import rgb_to_hsv
+
+
+def id_generator(size=5, chars=string.ascii_lowercase + string.ascii_uppercase + string.digits):
+ return ''.join(random.choice(chars) for _ in range(size))
+
+
+def lightness(pixel):
+ return rgb_to_hsv(pixel[0], pixel[1], pixel[2])[2] / 255.0 # For backwards compatibility with python2
+
+
+def random_width(clength):
+ x = random.random()
+ width = int(clength * (1 - x))
+ return width
+
+
+def crop_to(image_to_crop, reference_image):
+ """
+ Crops image to the size of a reference image. This function assumes that the relevant image is located in the center
+ and you want to crop away equal sizes on both the left and right as well on both the top and bottom.
+ :param image_to_crop
+ :param reference_image
+ :return: image cropped to the size of the reference image
+ """
+ reference_size = reference_image.size
+ current_size = image_to_crop.size
+ dx = current_size[0] - reference_size[0]
+ dy = current_size[1] - reference_size[1]
+ left = dx / 2
+ upper = dy / 2
+ right = dx / 2 + reference_size[0]
+ lower = dy / 2 + reference_size[1]
+ return image_to_crop.crop(box=(left, upper, right, lower))
diff --git a/notsobot/vw/img/png/background/geometric.jpg b/notsobot/vw/img/png/background/geometric.jpg
new file mode 100644
index 0000000..5a3a6c6
Binary files /dev/null and b/notsobot/vw/img/png/background/geometric.jpg differ
diff --git a/notsobot/vw/img/png/bubbles/JavaUpdateAvailable.png b/notsobot/vw/img/png/bubbles/JavaUpdateAvailable.png
new file mode 100644
index 0000000..e029b17
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/JavaUpdateAvailable.png differ
diff --git a/notsobot/vw/img/png/bubbles/Windows Connection with Little connectivity.png b/notsobot/vw/img/png/bubbles/Windows Connection with Little connectivity.png
new file mode 100644
index 0000000..3e50870
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/Windows Connection with Little connectivity.png differ
diff --git a/notsobot/vw/img/png/bubbles/a screaming comes across the sky.png b/notsobot/vw/img/png/bubbles/a screaming comes across the sky.png
new file mode 100644
index 0000000..6f233e6
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/a screaming comes across the sky.png differ
diff --git a/notsobot/vw/img/png/bubbles/faster.png b/notsobot/vw/img/png/bubbles/faster.png
new file mode 100644
index 0000000..6d09c8e
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/faster.png differ
diff --git a/notsobot/vw/img/png/bubbles/out of a fantasy.png b/notsobot/vw/img/png/bubbles/out of a fantasy.png
new file mode 100644
index 0000000..14ff00a
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/out of a fantasy.png differ
diff --git a/notsobot/vw/img/png/bubbles/pluggeddeviceintoaudiojack.png b/notsobot/vw/img/png/bubbles/pluggeddeviceintoaudiojack.png
new file mode 100644
index 0000000..dd74c84
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/pluggeddeviceintoaudiojack.png differ
diff --git a/notsobot/vw/img/png/bubbles/project a world.png b/notsobot/vw/img/png/bubbles/project a world.png
new file mode 100644
index 0000000..9de5212
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/project a world.png differ
diff --git a/notsobot/vw/img/png/bubbles/stupid_bubble_by_Baka_Sora_Club.png b/notsobot/vw/img/png/bubbles/stupid_bubble_by_Baka_Sora_Club.png
new file mode 100644
index 0000000..fd2322f
Binary files /dev/null and b/notsobot/vw/img/png/bubbles/stupid_bubble_by_Baka_Sora_Club.png differ
diff --git a/notsobot/vw/img/png/greek/greek1.png b/notsobot/vw/img/png/greek/greek1.png
new file mode 100644
index 0000000..55cb33b
Binary files /dev/null and b/notsobot/vw/img/png/greek/greek1.png differ
diff --git a/notsobot/vw/img/png/greek/greek2.png b/notsobot/vw/img/png/greek/greek2.png
new file mode 100644
index 0000000..ca879d2
Binary files /dev/null and b/notsobot/vw/img/png/greek/greek2.png differ
diff --git a/notsobot/vw/img/png/greek/greek3.png b/notsobot/vw/img/png/greek/greek3.png
new file mode 100644
index 0000000..de60ec9
Binary files /dev/null and b/notsobot/vw/img/png/greek/greek3.png differ
diff --git a/notsobot/vw/img/png/greek/greek4.png b/notsobot/vw/img/png/greek/greek4.png
new file mode 100644
index 0000000..4649270
Binary files /dev/null and b/notsobot/vw/img/png/greek/greek4.png differ
diff --git a/notsobot/vw/img/png/greek/siddhartha.png b/notsobot/vw/img/png/greek/siddhartha.png
new file mode 100644
index 0000000..d20b2f2
Binary files /dev/null and b/notsobot/vw/img/png/greek/siddhartha.png differ
diff --git a/notsobot/vw/img/png/pics/ak47.png b/notsobot/vw/img/png/pics/ak47.png
new file mode 100644
index 0000000..7c48588
Binary files /dev/null and b/notsobot/vw/img/png/pics/ak47.png differ
diff --git a/notsobot/vw/img/png/pics/blindblake.png b/notsobot/vw/img/png/pics/blindblake.png
new file mode 100644
index 0000000..aaef799
Binary files /dev/null and b/notsobot/vw/img/png/pics/blindblake.png differ
diff --git a/notsobot/vw/img/png/pics/dolphin.png b/notsobot/vw/img/png/pics/dolphin.png
new file mode 100644
index 0000000..3a25b6e
Binary files /dev/null and b/notsobot/vw/img/png/pics/dolphin.png differ
diff --git a/notsobot/vw/img/png/pics/drip.png b/notsobot/vw/img/png/pics/drip.png
new file mode 100644
index 0000000..f2d50a4
Binary files /dev/null and b/notsobot/vw/img/png/pics/drip.png differ
diff --git a/notsobot/vw/img/png/pics/fiji.png b/notsobot/vw/img/png/pics/fiji.png
new file mode 100644
index 0000000..cd4ebc9
Binary files /dev/null and b/notsobot/vw/img/png/pics/fiji.png differ
diff --git a/notsobot/vw/img/png/pics/gun.png b/notsobot/vw/img/png/pics/gun.png
new file mode 100644
index 0000000..71cb83c
Binary files /dev/null and b/notsobot/vw/img/png/pics/gun.png differ
diff --git a/notsobot/vw/img/png/pics/knife.png b/notsobot/vw/img/png/pics/knife.png
new file mode 100644
index 0000000..b3ad925
Binary files /dev/null and b/notsobot/vw/img/png/pics/knife.png differ
diff --git a/notsobot/vw/img/png/pics/knuckle.png b/notsobot/vw/img/png/pics/knuckle.png
new file mode 100644
index 0000000..41a384b
Binary files /dev/null and b/notsobot/vw/img/png/pics/knuckle.png differ
diff --git a/notsobot/vw/img/png/windows/98-problem.jpg b/notsobot/vw/img/png/windows/98-problem.jpg
new file mode 100644
index 0000000..7d45f7e
Binary files /dev/null and b/notsobot/vw/img/png/windows/98-problem.jpg differ
diff --git a/notsobot/vw/img/png/windows/9x-wu4.png b/notsobot/vw/img/png/windows/9x-wu4.png
new file mode 100644
index 0000000..77f3bc9
Binary files /dev/null and b/notsobot/vw/img/png/windows/9x-wu4.png differ
diff --git a/notsobot/vw/img/png/windows/C2FAT32.gif b/notsobot/vw/img/png/windows/C2FAT32.gif
new file mode 100644
index 0000000..379842e
Binary files /dev/null and b/notsobot/vw/img/png/windows/C2FAT32.gif differ
diff --git a/notsobot/vw/img/png/windows/IPC_MPI_CP5611_1.gif b/notsobot/vw/img/png/windows/IPC_MPI_CP5611_1.gif
new file mode 100644
index 0000000..b5ccafe
Binary files /dev/null and b/notsobot/vw/img/png/windows/IPC_MPI_CP5611_1.gif differ
diff --git a/notsobot/vw/img/png/windows/Windows_98_-_Critical_Update_Notification.png b/notsobot/vw/img/png/windows/Windows_98_-_Critical_Update_Notification.png
new file mode 100644
index 0000000..890b44a
Binary files /dev/null and b/notsobot/vw/img/png/windows/Windows_98_-_Critical_Update_Notification.png differ
diff --git a/notsobot/vw/img/png/windows/au_15.gif b/notsobot/vw/img/png/windows/au_15.gif
new file mode 100644
index 0000000..1f43ec4
Binary files /dev/null and b/notsobot/vw/img/png/windows/au_15.gif differ
diff --git a/notsobot/vw/img/png/windows/au_16.gif b/notsobot/vw/img/png/windows/au_16.gif
new file mode 100644
index 0000000..82e1a3e
Binary files /dev/null and b/notsobot/vw/img/png/windows/au_16.gif differ
diff --git a/notsobot/vw/img/png/windows/au_20.gif b/notsobot/vw/img/png/windows/au_20.gif
new file mode 100644
index 0000000..d614b14
Binary files /dev/null and b/notsobot/vw/img/png/windows/au_20.gif differ
diff --git a/notsobot/vw/img/png/windows/create_disk_image.gif b/notsobot/vw/img/png/windows/create_disk_image.gif
new file mode 100644
index 0000000..a1f1180
Binary files /dev/null and b/notsobot/vw/img/png/windows/create_disk_image.gif differ
diff --git a/notsobot/vw/img/png/windows/ht1338-alert-001-en.png b/notsobot/vw/img/png/windows/ht1338-alert-001-en.png
new file mode 100644
index 0000000..942234c
Binary files /dev/null and b/notsobot/vw/img/png/windows/ht1338-alert-001-en.png differ
diff --git a/notsobot/vw/img/png/windows/regedit.gif b/notsobot/vw/img/png/windows/regedit.gif
new file mode 100644
index 0000000..f5599da
Binary files /dev/null and b/notsobot/vw/img/png/windows/regedit.gif differ
diff --git a/notsobot/vw/img/png/windows/screenshot.png b/notsobot/vw/img/png/windows/screenshot.png
new file mode 100644
index 0000000..b1ca778
Binary files /dev/null and b/notsobot/vw/img/png/windows/screenshot.png differ
diff --git a/notsobot/vw/img/png/windows/sysinfo.gif b/notsobot/vw/img/png/windows/sysinfo.gif
new file mode 100644
index 0000000..f95b541
Binary files /dev/null and b/notsobot/vw/img/png/windows/sysinfo.gif differ
diff --git a/notsobot/vw/img/png/windows/update.gif b/notsobot/vw/img/png/windows/update.gif
new file mode 100644
index 0000000..bfed475
Binary files /dev/null and b/notsobot/vw/img/png/windows/update.gif differ
diff --git a/notsobot/vw/img/png/windows/win98.png b/notsobot/vw/img/png/windows/win98.png
new file mode 100644
index 0000000..4440db6
Binary files /dev/null and b/notsobot/vw/img/png/windows/win98.png differ
diff --git a/notsobot/vw/img/png/windows/winnt31.png b/notsobot/vw/img/png/windows/winnt31.png
new file mode 100644
index 0000000..5b75c6f
Binary files /dev/null and b/notsobot/vw/img/png/windows/winnt31.png differ
diff --git a/notsobot/vw/macintoshplus.py b/notsobot/vw/macintoshplus.py
new file mode 100644
index 0000000..897dc4a
--- /dev/null
+++ b/notsobot/vw/macintoshplus.py
@@ -0,0 +1,216 @@
+# encoding: utf-8
+# https://github.com/rickyhan/macintoshplus
+"""Vaporwaveは音楽のジャンルや芸術運動である[3] [4]このようなバウンスハウス、またはchillwave、そして、より広く、エレクトロニックダンスミュージック、などのインディーseapunkから2010年代初頭のダンスのジャンルに出現した。 、その態度やメッセージに多くの多様性と曖昧さ、vaporwaveがありますが:時々の両方が、大量消費社会の批判とパロディとして機能し80年代のヤッピー文化、[5]とニューエイジの音楽、音響的および審美的に彼らのノスタルジックで好奇心の魅力を紹介しながら、アーティファクト。"""
+from PIL import Image, ImageDraw, ImageFont, ImageEnhance, ImageFilter
+from random import randint, choice, Random
+import os, hashlib
+from math import sin, cos, tan
+
+japanese_corpus = '''それは20年前の今日だった
+サージェント·ペッパーは、プレイするバンドを教え
+彼らは、スタイルの外でと続いている
+しかし、彼らは笑顔を上げることが保証している
+だから私はあなたに導入することができる
+あなたはこれらすべての年のために知られてきた行為
+サージェント·ペパーズ·ロンリー·ハーツ·クラブ·バンド
+私たちはしているサージェント·ペパーズ·ロンリー·ハーツ·クラブ·バンド
+私たちは、あなたがショーを楽しむことを望む
+私たちはしているサージェント·ペパーズ·ロンリー·ハーツ·クラブ·バンド
+後ろに座ると夜を手放す
+サージェント·ペッパーの孤独、サージェント·ペッパーの孤独
+サージェント·ペパーズ·ロンリー·ハーツ·クラブ·バンド
+それは素晴らしいですここに
+それは確かにスリルだ
+あなたはそのような素敵な観客だ
+私たちは、私たちと一緒に家お連れしたいと思います
+私たちは家に連れて行くのが大好きです
+私は実際にショーを停止する必要はありません
+しかし、私はあなたが「知りたいかもしれないと思った
+歌手は歌を歌うために起こっていること
+そして、私はあなたのすべてを一緒に歌うことを望んでいる
+だから私はあなたに紹介しましょう
+唯一無二のビリー·シアーズ
+そして、サージェント·ペパーズ·ロンリー·ハーツ·クラブ·バンド'''.split('\n')
+main_dir = str(__file__)[:-16]
+bubbles = [main_dir+'/img/png/bubbles/' + i for i in os.listdir(main_dir+'/img/png/bubbles/') if i != 'Thumbs.db']
+windows = [main_dir+'/img/png/windows/' + i for i in os.listdir(main_dir+'/img/png/windows/') if i != 'Thumbs.db']
+backgrounds = [main_dir+'/img/png/background/' + i for i in os.listdir(main_dir+'/img/png/background/') if i != 'Thumbs.db']
+pics = [main_dir+'/img/png/pics/' + i for i in os.listdir(main_dir+'/img/png/pics/') if i != 'Thumbs.db']
+greek = [main_dir+'/img/png/greek/' + i for i in os.listdir(main_dir+'/img/png/greek/') if i != 'Thumbs.db']
+
+def random_color(k=0):
+ RGB = int(k%255),int(255*cos(k)),int(255*(1-sin(k)))
+ return RGB
+def full_width(txt):
+ '''translate to unicode letters'''
+ WIDE_MAP = dict((i, i + 0xFEE0) for i in range(0x21, 0x7F))
+ WIDE_MAP[0x20] = 0x3000
+ return str(txt).translate(WIDE_MAP)
+def draw_text(txt, image, k=0, x=0, y=30):
+ '''takes a image and places txt on it'''
+ print('adding text:', txt.encode('utf-8'))
+ font_path = main_dir+"/resources/arial.ttf"
+ draw = ImageDraw.Draw(image)
+
+ #autofit
+ fontsize = 1 # starting font size
+ # portion of image width you want text width to be
+ img_fraction = 0.50
+ font = ImageFont.truetype(font_path, fontsize)
+ while font.getsize(txt)[0] < img_fraction*image.size[0]*0.7:
+ # iterate until the text size is just larger than the criteria
+ fontsize += 1
+ font = ImageFont.truetype(font_path, fontsize)
+
+ txt = full_width(txt)
+ #draw.text((0, 30), txt, fill=random_color(k) , font=font)
+ # #############
+ # # thin border
+ # draw.text((x-1, y), txt, font=font, fill=random_color(k+200))
+ # draw.text((x+1, y), txt, font=font, fill=random_color(k+200))
+ # draw.text((x, y-1), txt, font=font, fill=random_color(k+200))
+ # draw.text((x, y+1), txt, font=font, fill=random_color(k+200))
+
+ # thicker border
+ draw.text((x-2, y-2), txt, font=font, fill=random_color(k+90))
+ draw.text((x+2, y-2), txt, font=font, fill=random_color(k+60))
+ draw.text((x-2, y+2), txt, font=font, fill=random_color(k+37))
+ draw.text((x+2, y+2), txt, font=font, fill=random_color(k+80))
+ #################
+
+
+ return image
+
+def insert_bubble(foreground_path, im):
+ '''insert notification bubble on the bottom right corner'''
+ print('adding bubble:', foreground_path)
+ foreground = Image.open(foreground_path)
+ background_size = im.size
+ foreground_size = foreground.size
+ im.paste(foreground, (background_size[0]-foreground_size[0], background_size[1]-foreground_size[1]), foreground)
+ return im
+def insert_window_as_background(foreground_path, im,k=0):
+ '''fractal generative art, not a great idea for vaporwave though. not ironic enough'''
+ print('adding window:', foreground_path)
+ foreground = Image.open(foreground_path)
+ background_size = im.size
+ foreground_size = foreground.size
+ ratio = float(foreground_size[0]) / float(foreground_size[1])
+ for i in range(500,600,1): # the step determines the distances between
+ pos = ( int((background_size[0]-foreground_size[0])/2 + i*sin(i)/sin(k)) ,
+ int((background_size[1]-foreground_size[1])/2 + i*cos(i)/ratio/cos(k))
+ )
+ try:
+ im.paste(foreground, pos, foreground)
+ except ValueError:
+ im.paste(foreground, pos)
+ return im
+def insert_cascade(foreground_path, im, k=0, x=100,y=100):
+ '''another postironic function. raster box drawing'''
+ print('adding window:', foreground_path)
+ foreground = Image.open(foreground_path)
+ background_size = im.size
+ foreground_size = foreground.size
+ # ratio = float(foreground_size[0]) / float(foreground_size[1])
+ acc = -1
+ v = .0
+ dy = .0
+ for i in range(int(k*100)): # the step determines the distances between
+ dy = v * i + 0.5 * acc * (i**2)
+ v = v + acc * i
+ pos = ( int(x +11* i) ,
+ int(y - dy)
+ )
+ im.paste(foreground, pos)
+ if background_size[1] - foreground_size[1] <= pos[1]+foreground_size[1]:
+ v = -v
+ acc = acc * 0.9
+
+ return im
+def insert_window_as_background2(foreground_path, im):
+ '''another postironic function. raster box drawing'''
+ print('adding window:', foreground_path)
+ foreground = Image.open(foreground_path)
+ background_size = im.size
+ foreground_size = foreground.size
+ ratio = float(foreground_size[0]) / float(foreground_size[1])
+ for i in range(0,100,10): # the step determines the distances between
+ pos = ( int((background_size[0]-foreground_size[0])/2 + i) ,
+ int((background_size[1]-foreground_size[1])/2 - i)
+ )
+ im.paste(foreground, pos)
+ return im
+def horizon(background_path, im):
+ '''stretch a picture for horizontal perspective. math is hard'''
+ background = Image.open(background_path)
+ # WWWWWWWWWWWWTTTTTTTTTTTTTTTTTTTFFFFFFFFFFFFFFFFFFFFFFF MATH???? :-K
+ im.paste(background,(0,0))
+ return im
+def insert_pic(foreground_path, im, k=0, x=0, y=1000):
+ '''add Vaporwaveは音楽のジャンルや芸術運動である style pic. k is for nuanced
+ transformations such as rotation and oscillation'''
+ print('adding pic:', foreground_path)
+
+ foreground = Image.open(foreground_path)
+ background_size = im.size
+ foreground_size = foreground.size
+ ratio = float(foreground_size[0]) / float(foreground_size[1])
+ pos = ( x ,
+ y
+ )
+ foreground = foreground.rotate(k*100)
+ im.paste(foreground, pos, foreground)
+ return im
+def color(im, k=3):
+ enhancer = ImageEnhance.Color(im)
+ return enhancer.enhance(k)
+def contrast(im, k=3):
+ enhancer = ImageEnhance.Contrast(im)
+ return enhancer.enhance(k)
+def sharpness(im, k=3):
+ enhancer = ImageEnhance.Sharpness(im)
+ return enhancer.enhance(k)
+def brightness(im, k=3):
+ enhancer = ImageEnhance.Brightness(im)
+ return enhancer.enhance(k)
+def smooth(im, k=3):
+ return im.filter(ImageFilter.SMOOTH)
+
+
+
+def hashseed(seedtext):
+ return hashlib.sha224(seedtext.encode()).hexdigest()
+def draw_method1(k, name, im):
+ '''non-ironic function'''
+ if name == 'vapor wave':
+ seedvalue = str(randint(0, 999999))
+ else:
+ seedvalue = hashseed(name)
+ x, y = size = (1000,1000)
+ # im = horizon(choice(backgrounds),im)
+ im = insert_cascade(Random(seedvalue+str(0)).choice(windows),im, k=0.5)
+ im = insert_pic(Random(seedvalue+str(1)).choice(pics),im,k=0,x=int(x/2),y=int(y/2))
+ im = insert_pic(Random(seedvalue+str(3)).choice(pics),im,k=0,x=int(x/2),y=0)
+ im = insert_pic(choice(pics), im, x=randint(0, im.height), y=randint(0, im.width))
+ im = insert_pic(Random(seedvalue+str(3)).choice(greek),im,k=0,x=0,y=int(y/2.5+50))
+ im = insert_window_as_background(Random(seedvalue+str(7)).choice(pics), im, k=44)
+ im = insert_bubble(Random(seedvalue+str(5)).choice(bubbles), im)
+ im = draw_text(Random(seedvalue+str(6)).choice(japanese_corpus), im, k=500, y=int(y/2))
+ im = draw_text(name, im, k=Random(seedvalue+str(13)).randint(100,500), x=50, y=int(y/2))
+ im = smooth(im, Random(seedvalue+':)').randint(3,10))
+ im = color(im, Random(seedvalue).randint(3,10))
+ return im
+
+if __name__ == '__main__':
+ '''k is for nuanced transformations in individual functions'''
+ # for k in range(100,200):
+ # # if k!= 2: continue
+ # print k, '------------'
+ # im = draw_method1(float(k)/100,'MOFO NIGGER')
+ # im.save('animated\\'+str(k)+'.png')
+
+ ############################################
+ k=95
+ im = draw_method1(int(k/100),name='REDDIT')
+ im.save('100.png')
+ print(hashseed('VAPOR MONDAY'))
\ No newline at end of file
diff --git a/notsobot/vw/resources/arial.ttf b/notsobot/vw/resources/arial.ttf
new file mode 100644
index 0000000..12cc15c
Binary files /dev/null and b/notsobot/vw/resources/arial.ttf differ
diff --git a/rekt/__init__.py b/rekt/__init__.py
new file mode 100644
index 0000000..c15f23e
--- /dev/null
+++ b/rekt/__init__.py
@@ -0,0 +1,4 @@
+from .rekt import Rekt
+
+def setup(bot):
+ bot.add_cog(Rekt(bot))
diff --git a/rekt/info.json b/rekt/info.json
new file mode 100644
index 0000000..425f3c9
--- /dev/null
+++ b/rekt/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Are you REKT?",
+ "install_msg":"Are you REKT?",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"TrustyBot",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"REKT",
+ "tags":[
+ "general",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/rekt/rekt.py b/rekt/rekt.py
new file mode 100644
index 0000000..642c8b5
--- /dev/null
+++ b/rekt/rekt.py
@@ -0,0 +1,113 @@
+import discord
+from redbot.core import commands
+from redbot.core import checks
+from random import choice
+
+rektlist = [
+ "☑ Rekt",
+ "☑ Tyrannosaurus Rekt",
+ "☑ sudo apt-get Rekt",
+ "☑ e=mRekt²",
+ "☑ Rekt and Morty",
+ "☑ Really Rekt",
+ "☑ Cash4Rekt.com",
+ "☑ Grapes of Rekt",
+ "☑ Ship Rekt",
+ "☑ Rektavoir Dogs",
+ "☑ Raiders of the Rekt Ark ",
+ "☑ Indiana Jones and the Temple of Rekt",
+ "☑ Rekt markes the spot",
+ "☑ Caught rekt handed",
+ "☑ The Rekt Side Story",
+ "☑ Singin' In The Rekt",
+ "☑ Painting The Roses Rekt",
+ "☑ Rekt Van Winkle",
+ "☑ Parks and Rekt",
+ "☑ Lord of the Rekts: The Reking of the King",
+ "☑ Star Trekt",
+ "☑ The Rekt Prince of Bel-Air",
+ "☑ A Game of Rekt",
+ "☑ Rektflix",
+ "☑ Rekt it like it's hot",
+ "☑ RektBox 360",
+ "☑ The Rekt-men",
+ "☑ School Of Rekt",
+ "☑ I am Fire, I am Rekt",
+ "☑ Rekt and Roll",
+ "☑ Professor Rekt",
+ "☑ Catcher in the Rekt",
+ "☑ Rekt-22",
+ "☑ Harry Potter: The Half-Rekt Prince",
+ "☑ Great Rektspectations",
+ "☑ Paper Scissors Rekt",
+ "☑ RektCraft",
+ "☑ Grand Rekt Auto V",
+ "☑ Call of Rekt: Modern Reking 2",
+ "☑ Legend Of Zelda: Ocarina of Rekt",
+ "☑ Rekt It Ralph",
+ "☑ Left 4 Rekt",
+ "☑ www.rekkit.com",
+ "☑ Pokemon: Fire Rekt",
+ "☑ The Shawshank Rektemption",
+ "☑ The Rektfather",
+ "☑ The Rekt Knight",
+ "☑ Fiddler on the Rekt",
+ "☑ The Rekt Files",
+ "☑ The Good, the Bad, and The Rekt",
+ "☑ Forrekt Gump",
+ "☑ The Silence of the Rekts",
+ "☑ The Green Rekt",
+ "☑ Gladirekt",
+ "☑ Spirekted Away",
+ "☑ Terminator 2: Rektment Day",
+ "☑ The Rekt Knight Rises",
+ "☑ The Rekt King",
+ "☑ REKT-E",
+ "☑ Citizen Rekt",
+ "☑ Requiem for a Rekt",
+ "☑ REKT TO REKT ass to ass",
+ "☑ Star Wars: Episode VI - Return of the Rekt",
+ "☑ Braverekt",
+ "☑ Batrekt Begins",
+ "☑ 2001: A Rekt Odyssey",
+ "☑ The Wolf of Rekt Street",
+ "☑ Rekt's Labyrinth",
+ "☑ 12 Years a Rekt",
+ "☑ Gravirekt",
+ "☑ Finding Rekt",
+ "☑ The Arekters",
+ "☑ There Will Be Rekt",
+ "☑ Christopher Rektellston",
+ "☑ Hachi: A Rekt Tale",
+ "☑ The Rekt Ultimatum",
+ "☑ Shrekt",
+ "☑ Rektal Exam",
+ "☑ Rektium for a Dream",
+ "☑ www.Trekt.tv",
+ "☑ Erektile Dysfunction",
+ "☑ Jesus, stepping out the grave: 'Get ressurekt'"
+ ]
+
+
+class Rekt(getattr(commands, "Cog", object)):
+ """
+ Post embed with random rekt messages
+ """
+ def __init__(self, bot):
+ self.bot = bot
+
+ @commands.command()
+ @commands.cooldown(1, 60, commands.BucketType.guild)
+ async def rekt(self, ctx):
+ """Post embed with random rekt messages"""
+ user = ctx.message.author.id
+ rektemoji = ["\u2611", "\U0001F1F7", "\U0001F1EA", "\U0001F1F0", "\U0001F1F9"]
+ embed = discord.Embed(colour=discord.Colour.blue())
+ embed.add_field(name="NOT REKT", value="⬜ Not Rekt", inline=True)
+ message = "\n".join(choice(rektlist) for line in range(10))
+ if message != "":
+ embed.add_field(name="REKT", value=message, inline=True)
+ embed.set_author(name="Are you REKT?")
+ msg = await ctx.send(embed=embed)
+ for emoji in rektemoji:
+ await msg.add_reaction(emoji=emoji)
diff --git a/retrigger/__init__.py b/retrigger/__init__.py
new file mode 100644
index 0000000..ca34154
--- /dev/null
+++ b/retrigger/__init__.py
@@ -0,0 +1,6 @@
+from .retrigger import ReTrigger
+
+def setup(bot):
+ n = ReTrigger(bot)
+ bot.add_cog(n)
+
diff --git a/retrigger/info.json b/retrigger/info.json
new file mode 100644
index 0000000..53f4f16
--- /dev/null
+++ b/retrigger/info.json
@@ -0,0 +1,25 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Trigger events based on regular expressions",
+ "install_msg":"Add trigger responses to regex, see for help building regex expressions.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"ReTrigger",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[
+ "pillow"
+ ],
+ "short":"ReTrigger",
+ "tags":[
+ "general",
+ "utility",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/retrigger/retrigger.py b/retrigger/retrigger.py
new file mode 100644
index 0000000..5de8f12
--- /dev/null
+++ b/retrigger/retrigger.py
@@ -0,0 +1,999 @@
+import discord
+from redbot.core import commands, checks, Config
+from redbot.core.data_manager import cog_data_path
+from PIL import Image
+from io import BytesIO
+from copy import copy
+from datetime import datetime
+import aiohttp
+import functools
+import asyncio
+import random
+import string
+import re
+import os
+
+
+class Trigger:
+ """
+ Trigger class to handle trigger objects
+ """
+
+ def __init__(self, name, regex, response_type, author, count,
+ image=None, text=None, whitelist=[], blacklist=[], cooldown={}):
+ self.name = name
+ self.regex = regex
+ self.response_type = response_type
+ self.author = author
+ self.count = count
+ self.image = image
+ self.text = text
+ self.whitelist = whitelist
+ self.blacklist = blacklist
+ self.cooldown = cooldown
+
+ def _add_count(self, number:int):
+ self.count += number
+
+ def to_json(self) -> dict:
+ return {"name":self.name,
+ "regex":self.regex,
+ "response_type":self.response_type,
+ "author": self.author,
+ "count": self.count,
+ "image":self.image,
+ "text":self.text,
+ "whitelist":self.whitelist,
+ "blacklist":self.blacklist,
+ "cooldown":self.cooldown
+ }
+
+ @classmethod
+ def from_json(cls, data:dict):
+ if "cooldown" not in data:
+ cooldown = {}
+ else:
+ cooldown = data["cooldown"]
+ return cls(data["name"],
+ data["regex"],
+ data["response_type"],
+ data["author"],
+ data["count"],
+ data["image"],
+ data["text"],
+ data["whitelist"],
+ data["blacklist"],
+ cooldown)
+
+
+class ReTrigger(getattr(commands, "Cog", object)):
+ """
+ Trigger bot events using regular expressions
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 964565433247)
+ default_guild = {"trigger_list":{}, "allow_multiple":False}
+ self.config.register_guild(**default_guild)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ async def local_perms(self, message):
+ """Check the user is/isn't locally whitelisted/blacklisted.
+ https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/core/global_checks.py
+ """
+ if await self.bot.is_owner(message.author):
+ return True
+ elif message.guild is None:
+ return True
+ guild_settings = self.bot.db.guild(message.guild)
+ local_blacklist = await guild_settings.blacklist()
+ local_whitelist = await guild_settings.whitelist()
+
+ _ids = [r.id for r in message.author.roles if not r.is_default()]
+ _ids.append(message.author.id)
+ if local_whitelist:
+ return any(i in local_whitelist for i in _ids)
+
+ return not any(i in local_blacklist for i in _ids)
+
+ async def global_perms(self, message):
+ """Check the user is/isn't globally whitelisted/blacklisted.
+ https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/core/global_checks.py
+ """
+ if await self.bot.is_owner(message.author):
+ return True
+
+ whitelist = await self.bot.db.whitelist()
+ if whitelist:
+ return message.author.id in whitelist
+
+ return message.author.id not in await self.bot.db.blacklist()
+
+ async def channel_perms(self, trigger, channel):
+ if trigger.whitelist:
+ return channel.id in trigger.whitelist
+ return channel.id not in trigger.blacklist
+
+ async def check_ignored_channel(self, message):
+ """https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/release/3.0.0/redbot/cogs/mod/mod.py#L1273"""
+ channel = message.channel
+ guild = channel.guild
+ author = message.author
+ mod = self.bot.get_cog("Mod")
+ perms = channel.permissions_for(author)
+ surpass_ignore = (
+ isinstance(channel, discord.abc.PrivateChannel)
+ or perms.manage_guild
+ or await self.bot.is_owner(author)
+ or await self.bot.is_admin(author)
+ )
+ if surpass_ignore:
+ return True
+ guild_ignored = await mod.settings.guild(guild).ignored()
+ chann_ignored = await mod.settings.channel(channel).ignored()
+ return not (guild_ignored or chann_ignored and not perms.manage_channels)
+
+ async def check_trigger_exists(self, trigger, guild):
+ if trigger in await self.config.guild(guild).trigger_list():
+ return True
+ else:
+ return False
+
+ async def make_guild_folder(self, directory):
+ if not directory.is_dir():
+ print("Creating guild folder")
+ directory.mkdir(exist_ok=True, parents=True)
+
+ async def save_image_location(self, image_url, guild):
+ seed = ''.join(random.sample(string.ascii_uppercase + string.digits, k=5))
+ filename = image_url.split("/")[-1]
+ filename = "{}-{}".format(seed, filename)
+ directory = cog_data_path(self) /str(guild.id)
+ cur_images = await self.config.guild(guild).images()
+ file_path = str(cog_data_path(self)) + f"/{guild.id}/{filename}"
+ await self.make_guild_folder(directory)
+ async with self.session.get(image_url) as resp:
+ test = await resp.read()
+ with open(file_path, "wb") as f:
+ f.write(test)
+ return filename
+
+ async def wait_for_image(self, ctx):
+ await ctx.send("Upload an image for me to use! Type `exit` to cancel.")
+ msg = None
+ while msg is None:
+ check = lambda m: m.author == ctx.message.author and m.attachments != []
+ try:
+ msg = await self.bot.wait_for("message", check=check, timeout=60)
+ except asyncio.TimeoutError:
+ await ctx.send("Image adding timed out.")
+ break
+ if "exit" in msg.content.lower():
+ await ctx.send("Image adding cancelled.")
+ break
+ return msg
+
+ def resize_image(self, size, image):
+ length, width = (32, 32) # Start with the smallest size we want to upload
+ im = Image.open(image)
+ im.thumbnail((length*size, width*size), Image.ANTIALIAS)
+ byte_array = BytesIO()
+ im.save(byte_array, format="PNG")
+ return discord.File(byte_array.getvalue(), filename="reeee.png")
+
+ async def trigger_menu(self, ctx:commands.Context, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ post = post_list[page]
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = discord.Embed(timestamp=ctx.message.created_at)
+ em.colour = await self.bot.db.color()
+ for trigger in post:
+ blacklist = ", ".join(x for x in [f"<#{y}>" for y in trigger["blacklist"]])
+ whitelist = ", ".join(x for x in [f"<#{y}>" for y in trigger["whitelist"]])
+ info = ("__Author__: <@" + str(trigger["author"])+
+ ">\n__Count__: **" + str(trigger["count"]) +"**\n"+
+ "__Regex__: **" + trigger["regex"]+ "**\n"+
+ "__Response__: **" + trigger["response_type"] + "**\n"
+ )
+ if blacklist:
+ info += "__Blacklist__: **" + blacklist + "**\n"
+ if whitelist:
+ info += "__Whitelist__: **" + whitelist + "**\n"
+ if trigger["cooldown"]:
+ time = trigger["cooldown"]["time"]
+ style = trigger["cooldown"]["style"]
+ info += "__Cooldown__: **{}s per {}**".format(time, style)
+
+ em.add_field(name=trigger["name"], value=info[:1024])
+ em.set_author(name=ctx.guild.name, icon_url=ctx.guild.icon_url)
+ em.set_footer(text="Page {}/{}".format(page+1, len(post_list)))
+ else:
+ await ctx.send("I need embed_links permission to use this command.")
+ return
+ if len(post_list) == 1:
+ # No need to offer multiple pages if they don't exist
+ return await ctx.send(embed=em)
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await ctx.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ if react.emoji == "➡":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await self.trigger_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react.emoji == "⬅":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await self.trigger_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ async def check_trigger_cooldown(self, message, trigger):
+ guild = message.guild
+ trigger_list = await self.config.guild(guild).trigger_list()
+ now = datetime.now().timestamp()
+ if trigger.cooldown == {}:
+ return False
+ else:
+ if trigger.cooldown["style"] in ["guild", "server"]:
+ last = trigger.cooldown["last"]
+ time = trigger.cooldown["time"]
+ if (now - last) > time:
+ trigger.cooldown["last"] = now
+ trigger_list[trigger.name] = trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ return False
+ else:
+ return True
+ else:
+ style = trigger.cooldown["style"]
+ snowflake = getattr(message, style)
+ if snowflake.id not in [x["id"] for x in trigger.cooldown["last"]]:
+ trigger.cooldown["last"].append({"id":snowflake.id, "last":now})
+ trigger_list[trigger.name] = trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ return False
+ else:
+ entity_list = trigger.cooldown["last"]
+ for entity in entity_list:
+ if entity["id"] == snowflake.id:
+ last = entity["last"]
+ time = trigger.cooldown["time"]
+ if (now - last) > time:
+ trigger.cooldown["last"].remove({"id":snowflake.id, "last":last})
+ trigger.cooldown["last"].append({"id":snowflake.id, "last":now})
+ trigger_list[trigger.name] = trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ return False
+ else:
+ return True
+
+ async def on_message(self, message):
+ if message.guild is None:
+ return
+ if message.author.bot:
+ return
+ if not await self.local_perms(message):
+ return
+ if not await self.global_perms(message):
+ return
+ if not await self.check_ignored_channel(message):
+ return
+ msg = message.content
+ guild = message.guild
+ channel = message.channel
+ prefix_list = await self.bot.command_prefix(self.bot, message)
+ for prefix in prefix_list:
+ if msg.startswith(prefix):
+ # Don't run a trigger if it's the name of a command
+ return
+ trigger_list = await self.config.guild(guild).trigger_list()
+ for triggers in trigger_list:
+ trigger = Trigger.from_json(trigger_list[triggers])
+ if not await self.channel_perms(trigger, channel):
+ continue
+ search = re.findall(trigger.regex, message.content)
+ if search != []:
+ if await self.check_trigger_cooldown(message, trigger):
+ return
+ trigger._add_count(1)
+ trigger_list[triggers] = trigger.to_json()
+ await self.perform_trigger(message, trigger, search[0])
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ if not await self.config.guild(guild).allow_multiple():
+ return
+
+ async def perform_trigger(self, message, trigger, find):
+ own_permissions = message.channel.permissions_for(message.guild.me)
+ guild = message.guild
+ channel = message.channel
+ author = message.author
+ if trigger.response_type == "resize":
+ path = str(cog_data_path(self)) + f"/{guild.id}/{trigger.image}"
+ task = functools.partial(self.resize_image, size=len(find)-3, image=path)
+ task = self.bot.loop.run_in_executor(None, task)
+ try:
+ file = await asyncio.wait_for(task, timeout=60)
+ except asyncio.TimeoutError:
+ return
+ return await message.channel.send(file=file)
+ if trigger.response_type == "text" and own_permissions.send_messages:
+ return await channel.send(trigger.text)
+ if trigger.response_type == "react" and own_permissions.add_reactions:
+ for emoji in trigger.text:
+ await message.add_reaction(emoji)
+ return
+ if trigger.response_type == "ban" and own_permissions.ban_members:
+ reason = "Trigger response: {}".format(trigger.name)
+ if await self.bot.is_owner(author) or author == guild.owner:
+ # Don't want to accidentally ban the bot owner
+ # or try to ban the guild owner
+ return
+ if guild.me.top_role > author.top_role:
+ await author.ban(reason=reason, delete_message_days=0)
+ return
+ if trigger.response_type == "kick" and own_permissions.kick_members:
+ if await self.bot.is_owner(author) or author == guild.owner:
+ # Don't want to accidentally kick the bot owner
+ # or try to kick the guild owner
+ return
+ reason = "Trigger response: {}".format(trigger.name)
+ if guild.me.top_role > author.top_role:
+ await author.kick(reason=reason)
+ return
+ if trigger.response_type == "image" and own_permissions.attach_files:
+ path = str(cog_data_path(self)) + f"/{guild.id}/{trigger.image}"
+ file = discord.File(path)
+ return await channel.send(trigger.text, file=file)
+ if trigger.response_type == "command":
+ msg = copy(message)
+ prefix_list = await self.bot.command_prefix(self.bot, message)
+ msg.content = prefix_list[0] + trigger.text
+ self.bot.dispatch("message", msg)
+ return
+ if trigger.response_type == "delete":
+ await message.delete()
+ return
+ if trigger.response_type == "add_role":
+ role = guild.get_role(trigger.text)
+ try:
+ await author.add_roles(role, reason="Said the magic words")
+ except Exception as e:
+ print(e)
+ return
+ if trigger.response_type == "remove_role":
+ role = guild.get_role(trigger.text)
+ try:
+ await author.remove_roles(role, reason="Said the magic words")
+ except Exception as e:
+ print(e)
+ return
+
+
+ async def remove_trigger(self, guild, trigger_name):
+ trigger_list = await self.config.guild(guild).trigger_list()
+ for triggers in trigger_list:
+ trigger = Trigger.from_json(trigger_list[triggers])
+ if trigger.name == trigger_name:
+ if trigger.image is not None:
+ path = str(cog_data_path(self)) + f"/{guild.id}/{trigger.image}"
+ try:
+ os.remove(path)
+ except Exception as e:
+ print(e)
+ del trigger_list[triggers]
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ return True
+ return False
+
+ async def get_trigger(self, guild, name):
+ trigger = None
+ index = None
+ trigger_list = await self.config.guild(guild).trigger_list()
+ if name in trigger_list:
+ trigger = Trigger.from_json(trigger_list[name])
+ return trigger
+
+ @commands.group()
+ @checks.mod_or_permissions(manage_messages=True)
+ @commands.guild_only()
+ async def retrigger(self, ctx):
+ """
+ Setup automatic triggers based on regular expressions
+
+ https://regexr.com/ is a good place to test regex
+ """
+ pass
+
+ @retrigger.command()
+ async def allowmultiple(self, ctx):
+ """
+ Toggle multiple triggers to respond at once
+ """
+ if await self.config.guild(ctx.guild).allow_multiple():
+ await self.config.guild(ctx.guild).allow_multiple.set(False)
+ await ctx.send("Multiple responses disabled, only the first trigger will happen.")
+ return
+ else:
+ await self.config.guild(ctx.guild).allow_multiple.set(True)
+ await ctx.send("Multiple responses enabled, all triggers will occur.")
+ return
+
+ @retrigger.group()
+ async def blacklist(self, ctx):
+ """
+ Set blacklist options for retrigger
+ """
+ pass
+
+ @retrigger.group()
+ async def whitelist(self, ctx):
+ """
+ Set whitelist options for retrigger
+ """
+ pass
+
+ @retrigger.command()
+ async def cooldown(self, ctx, name:str, time:int, style="guild"):
+ """
+ Set cooldown options for retrigger
+
+ `name` is the name of the trigger
+ `time` is a time in seconds until the trigger will run again
+ `style` must be either `guild`, `server`, `channel`, `user`, or `member`
+ """
+ trigger = await self.get_trigger(ctx.guild, name)
+ if trigger is None:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+ return
+ if style not in ["guild", "server", "channel", "user", "member"]:
+ await ctx.send("Style must be either `guild`, `server`, `channel`, `user`, or `member`.")
+ return
+ msg = "Cooldown of {}s per {} set for Trigger {}.".format(time, style, name)
+ if style in ["user", "member"]:
+ style = "author"
+ if style in ["guild", "server"]:
+ cooldown = {"time":time, "style":style, "last": 0}
+ else:
+ cooldown = {"time":time, "style":style, "last": []}
+ if time <= 0:
+ cooldown = {}
+ msg = "Cooldown for Trigger {} reset.".format(name)
+ trigger_list = await self.config.guild(ctx.guild).trigger_list()
+ trigger.cooldown = cooldown
+ trigger_list[name] = trigger.to_json()
+ await self.config.guild(ctx.guild).trigger_list.set(trigger_list)
+ await ctx.send(msg)
+
+ @whitelist.command(name="add")
+ async def whitelist_add(self, ctx, name:str, channel:discord.TextChannel=None):
+ """
+ Add channel to trigger's whitelist
+
+ `name` is the name of the trigger
+ `channel` is the channel where the trigger will only work defaults to current channel
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ trigger = await self.get_trigger(ctx.guild, name)
+ if trigger is None:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+ return
+ if channel.id not in trigger.whitelist:
+ trigger_list = await self.config.guild(ctx.guild).trigger_list()
+ trigger.whitelist.append(channel.id)
+ trigger_list[name] = trigger.to_json()
+ await self.config.guild(ctx.guild).trigger_list.set(trigger_list)
+ await ctx.send("{} added to Trigger {}'s whitelist.".format(channel.mention, name))
+ return
+ else:
+ await ctx.send("{} is already in Trigger {}'s whitelist.".format(channel.mention, name))
+ return
+
+
+ @whitelist.command(name="remove", aliases=["rem", "del"])
+ async def whitelist_remove(self, ctx, name:str, channel:discord.TextChannel=None):
+ """
+ Remove channel from trigger's whitelist
+
+ `name` is the name of the trigger
+ `channel` is the channel where the trigger will only work defaults to current channel
+ """
+ if channel is None:
+ channel = ctx.message.channel
+
+ trigger = await self.get_trigger(ctx.guild, name)
+ if trigger is None:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+ return
+ if channel.id in trigger.whitelist:
+ trigger_list = await self.config.guild(ctx.guild).trigger_list()
+ trigger.whitelist.remove(channel.id)
+ trigger_list[name] = trigger.to_json()
+ await self.config.guild(ctx.guild).trigger_list.set(trigger_list)
+ await ctx.send("{} removed from Trigger {}'s whitelist.".format(channel.mention, name))
+ else:
+ await ctx.send("{} is not in Trigger {}'s whitelist.".format(channel.mention, name))
+
+
+ @blacklist.command(name="add")
+ async def blacklist_add(self, ctx, name:str, channel:discord.TextChannel=None):
+ """
+ Add channel to trigger's blacklist
+
+ `name` is the name of the trigger
+ `channel` is the channel where the trigger will only work defaults to current channel
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ trigger = await self.get_trigger(ctx.guild, name)
+ if trigger is None:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+ return
+ if channel.id not in trigger.blacklist:
+ trigger_list = await self.config.guild(ctx.guild).trigger_list()
+ trigger.blacklist.append(channel.id)
+ trigger_list[name] = trigger.to_json()
+ await self.config.guild(ctx.guild).trigger_list.set(trigger_list)
+ await ctx.send("{} added to Trigger {}'s whitelist.".format(channel.mention, name))
+ else:
+ await ctx.send("{} is already in Trigger {}'s whitelist.".format(channel.mention, name))
+
+
+ @blacklist.command(name="remove", aliases=["rem", "del"])
+ async def blacklist_remove(self, ctx, name:str, channel:discord.TextChannel=None):
+ """
+ Remove channel from trigger's blacklist
+
+ `name` is the name of the trigger
+ `channel` is the channel where the trigger will only work defaults to current channel
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ trigger = await self.get_trigger(ctx.guild, name)
+ if trigger is None:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+ return
+ if channel.id in trigger.blacklist:
+ trigger_list = await self.config.guild(ctx.guild).trigger_list()
+ trigger.blacklist.remove(channel.id)
+ trigger_list[name] = trigger.to_json()
+ await self.config.guild(ctx.guild).trigger_list.set(trigger_list)
+ await ctx.send("{} removed from Trigger {}'s blacklist.".format(channel.mention, name))
+ else:
+ await ctx.send("{} is not in Trigger {}'s blacklist.".format(channel.mention, name))
+
+
+ @retrigger.command()
+ async def list(self, ctx):
+ """
+ List all triggers currently on the server
+ """
+ trigger_dict = await self.config.guild(ctx.guild).trigger_list()
+ trigger_list = [trigger_dict[name] for name in trigger_dict]
+ if trigger_list == []:
+ await ctx.send("There are no triggers setup on this server.")
+ return
+ post_list = [trigger_list[i:i + 10] for i in range(0, len(trigger_list), 10)]
+ await self.trigger_menu(ctx, post_list)
+
+ @retrigger.command(aliases=["del", "rem", "delete"])
+ async def remove(self, ctx, name):
+ """
+ Remove a specified trigger
+
+ `name` is the name of the trigger
+ """
+ if await self.remove_trigger(ctx.guild, name):
+ await ctx.send("Trigger `{}` removed.".format(name))
+ else:
+ await ctx.send("Trigger `{}` doesn't exist.".format(name))
+
+
+ @retrigger.command()
+ async def text(self, ctx, name:str, regex:str, *, text:str):
+ """
+ Add a text response trigger
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `text` response of the trigger
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "text", author, 0, None, text)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ async def image(self, ctx, name:str, regex:str, image_url:str=None):
+ """
+ Add an image/file response trigger
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `image_url` optional image_url if none is provided the bot will ask to upload an image
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ if ctx.message.attachments != []:
+ image_url = ctx.message.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+ if image_url is not None:
+ filename = await self.save_image_location(image_url, guild)
+ else:
+ msg = await self.wait_for_image(ctx)
+ if msg is None:
+ return
+ image_url = msg.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+
+ new_trigger = Trigger(name, regex, "image", author, 0, filename, None)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ async def imagetext(self, ctx, name:str, regex:str, text:str, image_url:str=None):
+ """
+ Add an image/file response with text trigger
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `text` the triggered text response
+ `image_url` optional image_url if none is provided the bot will ask to upload an image
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ if ctx.message.attachments != []:
+ image_url = ctx.message.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+ if image_url is not None:
+ filename = await self.save_image_location(image_url, guild)
+ else:
+ msg = await self.wait_for_image(ctx)
+ if msg is None:
+ return
+ image_url = msg.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+
+ new_trigger = Trigger(name, regex, "image", author, 0, filename, text)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ async def resize(self, ctx, name:str, regex:str, image_url:str=None):
+ """
+ Add an image to resize in response to a trigger
+ this will attempt to resize the image based on length of matching regex
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `image_url` optional image_url if none is provided the bot will ask to upload an image
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ if ctx.message.attachments != []:
+ image_url = ctx.message.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+ if image_url is not None:
+ filename = await self.save_image_location(image_url, guild)
+ else:
+ msg = await self.wait_for_image(ctx)
+ if msg is None:
+ return
+ image_url = msg.attachments[0].url
+ filename = await self.save_image_location(image_url, guild)
+
+ new_trigger = Trigger(name, regex, "resize", author, 0, filename, None)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ @checks.mod_or_permissions(ban_members=True)
+ async def ban(self, ctx, name:str, regex:str):
+ """
+ Add a trigger to ban users for saying specific things found with regex
+ This respects hierarchy so ensure the bot role is lower in the list
+ than mods and admin so they don't get banned by accident
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "ban", author, 0, None, None)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ @checks.mod_or_permissions(kick_members=True)
+ async def kick(self, ctx, name:str, regex:str):
+ """
+ Add a trigger to kick users for saying specific things found with regex
+ This respects hierarchy so ensure the bot role is lower in the list
+ than mods and admin so they don't get kicked by accident
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "kick", author, 0, None, None)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ async def react(self, ctx, name:str, regex:str, *, emojis:str):
+ """
+ Add a reaction trigger
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `emojis` the emojis to react with when triggered separated by spaces
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ good_emojis = []
+ for emoji in emojis.split(" "):
+ if "<" in emoji and ">" in emoji:
+ emoji = emoji[1:-1]
+ try:
+ await ctx.message.add_reaction(emoji)
+ good_emojis.append(emoji)
+ except Exception as e:
+ print(e)
+ if good_emojis == []:
+ await ctx.send("None of the emojis supplied will work!")
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "react", author, 0, None, good_emojis)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ async def command(self, ctx, name:str, regex:str, *, command:str):
+ """
+ Add a command trigger
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `command` the command that will be triggered, do add [p] prefix
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ cmd_list = command.split(" ")
+ existing_cmd = self.bot.get_command(cmd_list[0])
+ if existing_cmd is None:
+ await ctx.send("{} doesn't seem to be an available command.".format(command))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "command", author, 0, None, command)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command(aliases=["deletemsg"])
+ async def filter(self, ctx, name:str, regex:str):
+ """
+ Add a trigger to delete a message
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "delete", author, 0, None, None)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ @commands.bot_has_permissions(manage_roles=True)
+ async def addrole(self, ctx, name:str, regex:str, role:discord.Role):
+ """
+ Add a trigger to add a role
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `role` the role applied when the regex pattern matches
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ if role >= ctx.me.top_role:
+ await ctx.send("I can't assign roles higher than my own.")
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "add_role", author, 0, None, role.id)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+ @retrigger.command()
+ @commands.bot_has_permissions(manage_roles=True)
+ async def removerole(self, ctx, name:str, regex:str, role:discord.Role):
+ """
+ Add a trigger to remove a role
+
+ `name` name of the trigger
+ `regex` the regex that will determine when to respond
+ `role` the role applied when the regex pattern matches
+ See https://regexr.com/ for help building a regex pattern
+ Example for simple search: `"\\bthis matches"` the whole phrase only
+ For case insensitive searches add `(?i)` at the start of the regex
+ """
+ if await self.check_trigger_exists(name, ctx.guild):
+ await ctx.send("{} is already a trigger name")
+ return
+ try:
+ search = re.findall(regex, ctx.message.content)
+ except Exception as e:
+ await ctx.send("There is something wrong with that regex pattern: {}".format(e))
+ return
+ if role >= ctx.me.top_role:
+ await ctx.send("I can't remove roles higher than my own.")
+ return
+ guild = ctx.guild
+ author = ctx.message.author.id
+ new_trigger = Trigger(name, regex, "remove_role", author, 0, None, role.id)
+ trigger_list = await self.config.guild(guild).trigger_list()
+ trigger_list[name] = new_trigger.to_json()
+ await self.config.guild(guild).trigger_list.set(trigger_list)
+ await ctx.send("Trigger `{}` set.".format(name))
+
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/runescape/__init__.py b/runescape/__init__.py
new file mode 100644
index 0000000..a91079b
--- /dev/null
+++ b/runescape/__init__.py
@@ -0,0 +1,5 @@
+from .runescape import Runescape
+
+def setup(bot):
+ n = Runescape(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/runescape/info.json b/runescape/info.json
new file mode 100644
index 0000000..91fb69f
--- /dev/null
+++ b/runescape/info.json
@@ -0,0 +1,23 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Gathers stats from Runescape API endpoints.",
+ "install_msg":"gathers runescape stats and information.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"runescape",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[
+ "tabulate"
+ ],
+ "short":"Runescape",
+ "tags":[
+ "runescape"
+ ]
+}
\ No newline at end of file
diff --git a/runescape/profile.py b/runescape/profile.py
new file mode 100644
index 0000000..609c990
--- /dev/null
+++ b/runescape/profile.py
@@ -0,0 +1,148 @@
+from typing import Tuple
+from redbot.core import commands
+
+import discord
+
+class Profile:
+ def __init__(self, name:str, combatlevel:int, logged_in:bool, rank:int, melee_total:int, magic_total:int, ranged_total: int,
+ totalskill:int, totalxp:int, questsstarted:int, questscomplete:int, questsnotstarted:int, activities:list,
+ attack:dict, defence:dict, strength:dict, constitution:dict, ranged:dict, prayer:dict, magic:dict, cooking:dict,
+ woodcutting:dict, fletching:dict, fishing:dict, firemaking:dict, crafting:dict, smithing:dict, mining:dict,
+ herblore:dict, agility:dict, thieving:dict, slayer:dict, farming:dict, runecrafting:dict, hunter:dict, construction:dict,
+ summoning:dict, dungeoneering:dict, divination:dict, invention:dict):
+ super().__init__()
+ self.name = name
+ self.combatlevel = combatlevel
+ self.logged_in = logged_in
+ self.rank = rank
+ self.melee_total = melee_total
+ self.magic_total = magic_total
+ self.ranged_total = ranged_total
+ self.totalskill = totalskill
+ self.totalxp = totalxp
+ self.questsstarted = questsstarted
+ self.questscomplete = questscomplete
+ self.questsnotstarted = questsnotstarted
+ self.activities = activities
+ self.attack = attack
+ self.defence = defence
+ self.strength = strength
+ self.constitution = constitution
+ self.ranged = ranged
+ self.prayer = prayer
+ self.magic = magic
+ self.cooking = cooking
+ self.woodcutting = woodcutting
+ self.fletching = fletching
+ self.fishing = fishing
+ self.firemaking = firemaking
+ self.crafting = crafting
+ self.smithing = smithing
+ self.mining = mining
+ self.herblore = herblore
+ self.agility = agility
+ self.thieving = thieving
+ self.slayer = slayer
+ self.farming = farming
+ self.runecrafting = runecrafting
+ self.hunter = hunter
+ self.construction = construction
+ self.summoning = summoning
+ self.dungeoneering = dungeoneering
+ self.divination = divination
+ self.invention = invention
+
+ def to_json(self) -> dict:
+ return {
+ "name": self.name,
+ "combatlevel": self.combatlevel,
+ "logged_in": self.logged_in,
+ "rank": self.rank,
+ "melee_total": self.melee_total,
+ "magic_total": self.magic_total,
+ "ranged_total": self.ranged_total,
+ "totalskill": self.totalskill,
+ "totalxp": self.totalxp,
+ "questsstarted": self.questsstarted,
+ "questscomplete": self.questscomplete,
+ "questsnotstarted": self.questsnotstarted,
+ "activities": self.activities,
+ "attack": self.attack,
+ "defence": self.defence,
+ "strength": self.strength,
+ "constitution": self.constitution,
+ "ranged": self.ranged,
+ "prayer": self.prayer,
+ "magic": self.magic,
+ "cooking": self.cooking,
+ "woodcutting": self.woodcutting,
+ "fletching": self.fletching,
+ "fishing": self.fishing,
+ "firemaking": self.firemaking,
+ "crafting": self.crafting,
+ "smithing": self.smithing,
+ "mining": self.mining,
+ "herblore": self.herblore,
+ "agility": self.agility,
+ "thieving": self.thieving,
+ "slayer": self.slayer,
+ "farming": self.farming,
+ "runecrafting": self.runecrafting,
+ "hunter": self.hunter,
+ "construction": self.construction,
+ "summoning": self.summoning,
+ "dungeoneering": self.dungeoneering,
+ "divination": self.divination,
+ "invention": self.invention
+ }
+
+
+ @classmethod
+ async def from_json(cls, data: dict):
+ skill_id_conversion = {
+ "0":"Attack",
+ "1":"Defence",
+ "2":"Strength",
+ "3":"Constitution",
+ "4":"Ranged",
+ "5":"Prayer",
+ "6":"Magic",
+ "7":"Cooking",
+ "8":"Woodcutting",
+ "9":"Fletching",
+ "10":"Fishing",
+ "11":"Firemaking",
+ "12":"Crafting",
+ "13":"Smithing",
+ "14":"Mining",
+ "15":"Herblore",
+ "16":"Agility",
+ "17":"Thieving",
+ "18":"Slayer",
+ "19":"Farming",
+ "20":"Runecrafting",
+ "21":"Hunter",
+ "22":"Construction",
+ "23":"Summoning",
+ "24":"Dungeoneering",
+ "25":"Divination",
+ "26":"Invention"
+ }
+ def get_skill(skill_id):
+ for skill in data["skillvalues"]:
+ if skill["id"] == skill_id:
+ skill["name"] = skill_id_conversion[str(skill_id)]
+ return skill
+
+ logged_in = True if data["loggedIn"] == "true" else False
+
+ return cls(data["name"], data["combatlevel"], logged_in,
+ data["rank"], data["melee"], data["magic"], data["ranged"],
+ data["totalskill"], data["totalxp"], data["questsstarted"],
+ data["questscomplete"], data["questsnotstarted"], data["activities"],
+ get_skill(0), get_skill(1), get_skill(2), get_skill(3), get_skill(4),
+ get_skill(5), get_skill(6), get_skill(7), get_skill(8), get_skill(9),
+ get_skill(10), get_skill(11), get_skill(12), get_skill(13), get_skill(14),
+ get_skill(15), get_skill(16), get_skill(17), get_skill(18), get_skill(19),
+ get_skill(20), get_skill(21), get_skill(22), get_skill(23), get_skill(24),
+ get_skill(25), get_skill(26))
\ No newline at end of file
diff --git a/runescape/runescape.py b/runescape/runescape.py
new file mode 100644
index 0000000..297c456
--- /dev/null
+++ b/runescape/runescape.py
@@ -0,0 +1,148 @@
+import discord
+from redbot.core import commands
+from redbot.core import Config
+from random import randint
+from random import choice
+from enum import Enum
+import json
+import datetime
+import aiohttp
+import asyncio
+from tabulate import tabulate
+from .profile import Profile
+
+class Runescape(getattr(commands, "Cog", object)):
+ """
+ Display Runescape account info
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 1845134845412)
+ default = {"rsn":""}
+ self.config.register_user(**default)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ @commands.group(name="runescape", aliases=["rs"])
+ async def runescape(self, ctx):
+ """Search for a user account or profile"""
+ pass
+
+ @runescape.command()
+ async def set(self, ctx, RunescapeName):
+ """Set your runescape name for easer commands."""
+ user = self.bot.get_user(ctx.message.author.id)
+ await self.config.user(user).rsn.set(RunescapeName)
+ await ctx.send("Your Runescape name has been set. To change re-do this command.")
+
+ async def make_url_profile(self, runescape_name, activities):
+ return "https://apps.runescape.com/runemetrics/profile/profile?user={}&activities={}".format(runescape_name, activities)
+
+ async def make_url_player_details(self, runescape_name):
+ return "http://services.runescape.com/m=website-data/playerDetails.ws?names=%5B%22{}%22%5D&callback=jQuery000000000000000_0000000000&_=0".format(runescape_name)
+
+ async def get_player_details(self, runescape_name):
+ async with self.session.get(await self.make_url_player_details(runescape_name)) as resp:
+ data = await resp.text()
+ json_data = json.loads(data.replace("jQuery000000000000000_0000000000([", "").replace("]);", ""))
+ return json_data
+ # return await resp.json()
+
+ async def get_data_profile(self, runescape_name, activities):
+ async with self.session.get(await self.make_url_profile(runescape_name, activities)) as resp:
+ return await resp.json()
+
+ async def get_profile_obj(self, profile_data):
+ return await Profile.from_json(profile_data)
+
+ async def get_profile(self, runescape_name, activities=5):
+ data = await self.get_data_profile(runescape_name, activities)
+ if "error" in data:
+ return "NO PROFILE"
+ return await self.get_profile_obj(data)
+
+ @runescape.command()
+ async def profile(self, ctx, runescape_name:str=None, activity:int=10):
+ """Display a players profile in Runescape"""
+ user = self.bot.get_user(ctx.message.author.id)
+ if runescape_name is None:
+ runescape_name = await self.config.user(user).rsn()
+ if runescape_name is None:
+ await ctx.send("You need to set your Runescape name first!")
+ return
+
+ details = await self.get_player_details(runescape_name)
+ data = await self.get_profile(runescape_name, activity)
+ if data == "NO PROFILE":
+ await ctx.send("The account {} doesn't appear to exist!".format(runescape_name))
+ return
+ # print(data.slayer)
+ embed = await self.profile_embed(data, details)
+ await ctx.send(embed=embed)
+
+
+ @runescape.command()
+ async def stats(self, ctx, *, runescape_name:str=None):
+ """Display a players stats in Runescape"""
+ user = self.bot.get_user(ctx.message.author.id)
+ if runescape_name is None:
+ runescape_name = await self.config.user(user).rsn()
+ if runescape_name is None:
+ await ctx.send("You need to set your Runescape name first!")
+ return
+
+ details = await self.get_player_details(runescape_name)
+ data = await self.get_profile(runescape_name)
+ if data == "NO PROFILE":
+ await ctx.send("The account {} doesn't appear to exist!".format(runescape_name))
+ return
+ # print(data.slayer)
+ skills = await self.stats_message(data)
+ await ctx.send(skills)
+
+ async def raw_stats_message(self, p):
+ skills_list = [["Overall", p.totalskill, "{:,}".format(p.totalxp), p.rank]]
+ skills = ["Attack","Defence","Strength","Constitution","Ranged","Prayer","Magic","Cooking","Woodcutting","Fletching","Fishing","Firemaking","Crafting","Smithing","Mining","Herblore","Agility","Thieving","Slayer","Farming","Runecrafting","Hunter","Construction","Summoning","Dungeoneering","Divination","Invention"]
+ stats = p.to_json()
+ for skill in skills:
+ level = stats[skill.lower()]["level"]
+ xp = stats[skill.lower()]["xp"]
+ rank = stats[skill.lower()]["rank"] if "rank" in stats[skill.lower()] else "Unranked"
+ skills_list.append([skill, level, xp, rank])
+ return tabulate(skills_list, headers=['Skill', 'Level', 'Experience', 'Rank'], tablefmt='orgtbl')
+
+ async def stats_message(self, p):
+ table = await self.raw_stats_message(p)
+ top_row_len = len(table.split("\n")[0])
+ top_row = top_row_len*"-"
+ spaces = int(((top_row_len - (14 + len(p.name)))/2) -1) * " "
+ skills = "```css\n{top_row}\n|{spaces}RS3 STATS FOR {user}{spaces}|\n{top_row}\n{skills}\n{top_row}```"\
+ .format(spaces=spaces, top_row=top_row, user=p.name, skills=table)
+ return skills
+
+
+ async def profile_embed(self, profile, details):
+ em = discord.Embed()
+ if details["isSuffix"]:
+ em.set_author(name="{} {}".format(profile.name, details["title"]))
+ else:
+ em.set_author(name="{} {}".format(details["title"], profile.name))
+ activities = ""
+ for activity in profile.activities:
+ activities += "[{}] {}\n".format(activity["date"], activity["text"])
+
+ # em.colour = int(teams[_teams.name]["home"].replace("#", ""), 16)
+ em.set_thumbnail(url="http://secure.runescape.com/m=avatar-rs/{}/chat.png".format(profile.name.replace(" ", "%20")))
+ em.add_field(name="Combat Level", value=profile.combatlevel)
+ em.add_field(name="Total Level", value=profile.totalskill)
+ em.add_field(name="Total XP", value=profile.totalxp)
+ if activities != "":
+ em.add_field(name="Activities", value=activities)
+ # if profile.logged_in:
+ # em.set_footer(text="Online", icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/Green_pog.svg/64px-Green_pog.svg.png")
+ # else:
+ # em.set_footer(text="Offline", icon_url="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Red_pog.svg/64px-Red_pog.svg.png")
+ return em
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/serverstats/__init__.py b/serverstats/__init__.py
new file mode 100644
index 0000000..fd9eb4c
--- /dev/null
+++ b/serverstats/__init__.py
@@ -0,0 +1,4 @@
+from .serverstats import ServerStats
+
+def setup(bot):
+ bot.add_cog(ServerStats(bot))
\ No newline at end of file
diff --git a/serverstats/info.json b/serverstats/info.json
new file mode 100644
index 0000000..d4ce244
--- /dev/null
+++ b/serverstats/info.json
@@ -0,0 +1,19 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Get information about servers the bot is on.",
+ "install_msg":"Use `[p]setguildjoin` to set a channel to see all new servers the bot is added to and some information about them.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"ServerStats",
+ "permissions":[],
+ "requirements":[],
+ "short":"Get various stats about servers the bot is on.",
+ "tags":[
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/serverstats/serverstats.py b/serverstats/serverstats.py
new file mode 100644
index 0000000..e8feece
--- /dev/null
+++ b/serverstats/serverstats.py
@@ -0,0 +1,765 @@
+from random import choice, randint
+import discord
+import asyncio
+from redbot.core import commands
+from redbot.core import checks, bank, Config
+import datetime
+import aiohttp
+from io import BytesIO
+from redbot.core.i18n import Translator
+from redbot.core.utils.chat_formatting import pagify, box
+from typing import Union
+
+_ = Translator("ServerStats", __file__)
+
+numbs = {
+ "next": "➡",
+ "back": "⬅",
+ "exit": "❌"
+}
+
+
+class GuildNotFoundError(Exception):
+ pass
+
+class ServerStats(getattr(commands, "Cog", object)):
+ """
+ Gather useful information about servers the bot is in
+ A lot of commands are bot owner only
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ default_global = {"join_channel":None}
+ self.config = Config.get_conf(self, 54853421465543)
+ self.config.register_global(**default_global)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+
+ async def on_guild_join(self, guild):
+ """Build and send a message containing serverinfo when the bot joins a new server"""
+ channel_id = await self.config.join_channel()
+ if channel_id is None:
+ return
+ channel = self.bot.get_channel(channel_id)
+ online = len([m.status for m in guild.members
+ if m.status == discord.Status.online or
+ m.status == discord.Status.idle])
+ total_users = len(guild.members)
+ text_channels = len([x for x in guild.text_channels])
+ voice_channels = len([x for x in guild.voice_channels])
+ passed = (datetime.datetime.utcnow() - guild.created_at).days
+ created_at = _("{} has joined a new server!\n That's {} servers now! \nServer created {}. That's over {} days ago!".format(
+ channel.guild.me.mention,
+ len(self.bot.guilds),
+ guild.created_at.strftime("%d %b %Y %H:%M"),
+ passed))
+
+ colour = guild.roles[-1].colour
+
+ em = discord.Embed(
+ description=created_at,
+ colour=colour,
+ timestamp=guild.created_at)
+ em.add_field(name="Region", value=str(guild.region))
+ em.add_field(name="Users", value="{}/{}".format(online, total_users))
+ em.add_field(name="Text Channels", value=text_channels)
+ em.add_field(name="Voice Channels", value=voice_channels)
+ em.add_field(name="Roles", value=len(guild.roles))
+ em.add_field(name="Owner", value="{} | {}".format(str(guild.owner), guild.owner.mention))
+ if guild.features != []:
+ em.add_field(name="Guild Features", value=", ".join(feature for feature in guild.features))
+ em.set_footer(text="guild ID: {}".format(guild.id))
+ em.set_author(name=guild.name, icon_url=guild.icon_url_as(format="png"))
+ em.set_thumbnail(url=guild.icon_url_as(format="png"))
+ await channel.send(embed=em)
+
+ async def on_guild_remove(self, guild):
+ """Build and send a message containing serverinfo when the bot leaves a server"""
+ channel_id = await self.config.join_channel()
+ if channel_id is None:
+ return
+ channel = self.bot.get_channel(channel_id)
+ online = len([m.status for m in guild.members
+ if m.status == discord.Status.online or
+ m.status == discord.Status.idle])
+ total_users = len(guild.members)
+ text_channels = len([x for x in guild.text_channels])
+ voice_channels = len([x for x in guild.voice_channels])
+ passed = (datetime.datetime.utcnow() - guild.created_at).days
+ created_at = _("{} has left a server!\n That's {} servers now! \nServer created {}. That's over {} days ago!".format(
+ channel.guild.me.mention,
+ len(self.bot.guilds),
+ guild.created_at.strftime("%d %b %Y %H:%M"),
+ passed))
+
+ colour = guild.roles[-1].colour
+
+ em = discord.Embed(
+ description=created_at,
+ colour=colour,
+ timestamp=guild.created_at)
+ em.add_field(name="Region", value=str(guild.region))
+ em.add_field(name="Users", value="{}/{}".format(online, total_users))
+ em.add_field(name="Text Channels", value=text_channels)
+ em.add_field(name="Voice Channels", value=voice_channels)
+ em.add_field(name="Roles", value=len(guild.roles))
+ em.add_field(name="Owner", value="{} | {}".format(str(guild.owner), guild.owner.mention))
+ if guild.features != []:
+ em.add_field(name="Guild Features", value=", ".join(feature for feature in guild.features))
+ em.set_footer(text="guild ID: {}".format(guild.id))
+ em.set_author(name=guild.name, icon_url=guild.icon_url_as(format="png"))
+ em.set_thumbnail(url=guild.icon_url_as(format="png"))
+
+ await channel.send(embed=em)
+
+ @commands.command()
+ async def emoji(self, ctx, emoji:str):
+ """
+ Post a large size server emoji in chat
+ """
+ if emoji is discord.Emoji:
+ await ctx.channel.trigger_typing()
+ emoji_name = emoji.name
+ ext = emoji.url.split(".")[-1]
+ async with self.session.get(emoji.url) as resp:
+ data = await resp.read()
+ file = discord.File(io.BytesIO(data),filename="{}.{}".format(emoji.name, ext))
+ await ctx.send(file=file)
+ # await self.bot.say(emoji.url)
+ else:
+ emoji_id = emoji.split(":")[-1].replace(">", "")
+ if not emoji_id.isdigit():
+ return
+ await ctx.channel.trigger_typing()
+ # print(emoji_id)
+ if emoji.startswith("= ctx.me.top_role:
+ await ctx.send("That role is higher than my role so I can't kick those members.")
+ return
+ if role is None:
+ member_list = [m for m in ctx.guild.members if m.top_role < ctx.me.top_role]
+ else:
+ member_list = [m for m in role.members if m.top_role < ctx.me.top_role]
+ # for member in member_list:
+ user_list = []
+ for channel in ctx.guild.text_channels:
+ if not channel.permissions_for(ctx.me).read_message_history:
+ continue
+ async for message in channel.history(limit=None, after=after):
+ if message.author.id not in user_list:
+ user_list.append(message.author.id)
+ for member in member_list:
+ if member.id in user_list:
+ member_list.remove(member)
+ send_msg = ("{} estimated users to kick. ".format(len(member_list)) +
+ "Would you like to kick them?")
+ msg = await ctx.send(send_msg)
+ if ctx.channel.permissions_for(ctx.me).add_reactions:
+ check = lambda r, u: u == ctx.message.author and r.emoji in ["✅", "❌"]
+ await msg.add_reaction("✅")
+ await msg.add_reaction("❌")
+
+ try:
+ reaction, user = await self.bot.wait_for("reaction_add", check=check, timeout=60)
+ except asyncio.TimeoutError:
+ await ctx.send("I guess not.")
+ if reaction.emoji == "✅":
+ link = await self.ask_for_invite(ctx)
+ no_invite = []
+ for member in member_list:
+ if link:
+ try:
+ await member.send(link)
+ except:
+ no_invite.append(member.id)
+ await member.kick(reason="Kicked due to inactivity.")
+ if link and len(no_invite) > 0:
+ await ctx.send("{} users could not be DM'd an invite link".format(len(no_invite)))
+ else:
+ await ctx.send("Not kicking users.")
+ return
+
+ @commands.command()
+ @commands.bot_has_permissions(embed_links=True)
+ async def avatar(self, ctx, member:discord.Member=None):
+ """
+ Display a users avatar in chat
+ """
+ if member is None:
+ member = ctx.message.author
+ guild = ctx.message.guild
+ if guild is not None:
+ colour = member.top_role.colour
+ else:
+ colour = discord.Embed.Empty
+ await ctx.channel.trigger_typing()
+ em = discord.Embed(title="**Avatar**", colour=colour)
+ if member.is_avatar_animated():
+ url = member.avatar_url_as(format="gif")
+ if not member.is_avatar_animated():
+ url = member.avatar_url_as(static_format="png")
+ em.set_image(url= url)
+ em.set_author(name="{}#{}".format(member.name, member.discriminator), icon_url=url, url=url)
+ await ctx.send(embed=em)
+
+ @commands.command()
+ @checks.is_owner()
+ @commands.bot_has_permissions(embed_links=True)
+ async def setguildjoin(self, ctx, channel:discord.TextChannel=None):
+ """
+ Set a channel to see new servers the bot is joining
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ await self.config.join_channel.set(channel.id)
+ await ctx.send("Posting new servers and left servers in {}".format(channel.mention))
+
+ @commands.command()
+ @checks.is_owner()
+ async def removeguildjoin(self, ctx):
+ """
+ Stop bots join/leave server messages
+ """
+ await self.config.join_channel.set(None)
+ await ctx.send("No longer posting joined or left servers.")
+
+ @commands.command(hidden=True)
+ @checks.is_owner()
+ async def checkcheater(self, ctx, user_id:int):
+ """
+ Checks for possible cheaters abusing the global bank and server powers
+ """
+ is_cheater = False
+ for guild in self.bot.guilds:
+ print(guild.owner.id)
+ if guild.owner.id == user_id:
+ is_cheater = True
+ await ctx.send("<@{}> is guild owner of {}".format(user_id, guild.name))
+ if not is_cheater:
+ await ctx.send("Not a cheater")
+
+ @commands.command(hidden=True)
+ @checks.is_owner()
+ async def whois(self, ctx, member:Union[int, discord.User]):
+ """
+ Display servers a user shares with the bot
+
+ `member` can be a user ID or mention
+ """
+ if type(member) == int:
+ try:
+ member = await self.bot.get_user_info(member)
+ except discord.errors.NotFound:
+ await ctx.send(f"{member} doesn't seem to be a discord user.")
+ return
+ guild_list = []
+ for guild in self.bot.guilds:
+ members = [member.id for member in guild.members]
+ if member.id in members:
+ guild_list.append(guild)
+ if guild_list != []:
+ msg = "{} ({}) is on:\n".format(member.name, member.id)
+ for guild in guild_list:
+ msg += "{} ({})\n".format(guild.name, guild.id)
+ for page in pagify(msg, ["\n"]):
+ await ctx.send(page)
+ else:
+ msg = f"{member.name}#{member.discriminator} ({member.id}) is not in any shared servers!"
+ await ctx.send(msg)
+
+ @commands.command(hidden=True)
+ @checks.is_owner()
+ async def topservers(self, ctx):
+ """
+ Lists servers by number of users and shows number of users
+ """
+ owner = ctx.author
+ guilds = sorted(list(self.bot.guilds),
+ key=lambda s: len(s.members), reverse=True)
+ msg = ""
+ for i, server in enumerate(guilds):
+ msg += "{}: {}\n".format(server.name, len(server.members))
+
+ for page in pagify(msg, ['\n']):
+ await ctx.send(page)
+
+ @commands.command(hidden=True)
+ @checks.is_owner()
+ async def newservers(self, ctx):
+ """
+ Lists servers by when the bot was added to the server
+ """
+ owner = ctx.author
+ guilds = sorted(list(self.bot.guilds),
+ key=lambda s: s.me.joined_at)
+ msg = ""
+ for i, server in enumerate(guilds):
+ msg += "{}: {} ({})\n".format(i, server.name, server.id)
+
+ for page in pagify(msg, ['\n']):
+ await ctx.send(page)
+
+ @commands.command()
+ @checks.mod_or_permissions(manage_messages=True)
+ @commands.bot_has_permissions(manage_channels=True)
+ async def slowmode(self, ctx, time:int=0, channel:discord.TextChannel=None):
+ """
+ Set a channels slowmode setting
+
+ `time` must be a number between 0 and 120
+ `channel` is the channel you want to set slowmode on defaults to current channel
+ """
+ if channel is None:
+ channel = ctx.channel
+ if time < 0 or time > 120:
+ await ctx.send("You can only set a number between 0 and 120")
+ return
+ await channel.edit(slowmode_delay=time)
+ await ctx.send(f"Slowmode set to {time} in {channel.mention}")
+
+ @commands.command()
+ @checks.mod_or_permissions(manage_messages=True)
+ async def topmembers(self, ctx, number:int=10, guild_name:Union[int, str]=None):
+ """
+ Lists top members on the server by join date
+
+ `number` is the number of users to display default is 10
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ member_list = sorted(guild.members, key=lambda m: m.joined_at)
+ new_msg = "__**First {} members of {}**__\n".format(number, guild.name)
+ for member in member_list[:number]:
+ new_msg += "{}. {}\n".format((member_list.index(member)+1), member.name)
+
+ for page in pagify(new_msg, ['\n']):
+ await ctx.send(page)
+
+ async def get_guild_obj(self, guild_name):
+ if type(guild_name) == int:
+ page_guild = [g for g in self.bot.guilds if int(guild_name) == g.id]
+ if type(guild_name) == str:
+ page_guild = [g for g in self.bot.guilds if guild_name.lower() in g.name.lower()]
+ try:
+ if guild_name is not None:
+ guilds = [g for g in self.bot.guilds]
+ guild = guilds[guilds.index(page_guild[0])]
+ except IndexError as e:
+ raise GuildNotFoundError
+ return guild
+
+ @commands.command()
+ @checks.is_owner()
+ async def listchannels(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Lists channels and their position and ID for a server
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ channels = {}
+ msg = "__**{}({})**__\n".format(guild.name, guild.id)
+ for category in guild.by_category():
+ if category[0] is not None:
+ msg += "{} ({}): Position {}\n".format(category[0].mention, category[0].id, category[0].position)
+ for channel in category[1]:
+ msg += "{} ({}): Position {}\n".format(channel.mention, channel.id, channel.position)
+ for page in pagify(msg, ["\n"]):
+ await ctx.send(page)
+
+ async def guild_menu(self, ctx, post_list: list,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+
+ guild = post_list[page]
+ online = len([m.status for m in guild.members
+ if m.status == discord.Status.online or
+ m.status == discord.Status.idle])
+ total_users = len(guild.members)
+ text_channels = len([x for x in guild.text_channels])
+ voice_channels = len([x for x in guild.voice_channels])
+ passed = (ctx.message.created_at - guild.created_at).days
+ created_at = _("Since {}. That's over {} days ago!"
+ "".format(guild.created_at.strftime("%d %b %Y %H:%M"),
+ passed))
+
+ colour = ''.join([choice('0123456789ABCDEF') for x in range(6)])
+ colour = int(colour, 16)
+ invite_link = "https://discord.gg/"
+
+ em = discord.Embed(
+ description=created_at,
+ colour=discord.Colour(value=colour),
+ timestamp=guild.created_at)
+ em.add_field(name="Region", value=str(guild.region))
+ em.add_field(name="Users", value="{}/{}".format(online, total_users))
+ em.add_field(name="Text Channels", value=text_channels)
+ em.add_field(name="Voice Channels", value=voice_channels)
+ em.add_field(name="Roles", value=len(guild.roles))
+ em.add_field(name="Owner", value="{} | {}".format(str(guild.owner), guild.owner.mention))
+ if guild.features != []:
+ em.add_field(name="Guild Features", value=", ".join(feature for feature in guild.features))
+ em.set_footer(text="guild ID: {}".format(guild.id))
+
+ if guild.icon_url:
+ em.set_author(name=guild.name, url=invite_link, icon_url=guild.icon_url)
+ em.set_thumbnail(url=guild.icon_url)
+ else:
+ em.set_author(name=guild.name)
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await self.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await self.guild_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await self.guild_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @commands.command()
+ @checks.is_owner()
+ @commands.bot_has_permissions(embed_links=True)
+ async def getguild(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Display info about servers the bot is on
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guilds = [guild for guild in self.bot.guilds]
+ page = 0
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ page = guilds.index(guild)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+
+
+ await self.guild_menu(ctx, guilds, None, page)
+
+
+ @commands.command()
+ @checks.mod_or_permissions(manage_messages=True)
+ async def nummembers(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Display number of users on a server
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+
+ await ctx.send("{} has {} members.".format(guild.name, len(guild.members)))
+
+ @commands.command()
+ @checks.mod_or_permissions(manage_messages=True)
+ async def getroles(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Displays all roles and their associated ID in chat
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ msg = ""
+ for role in guild.roles:
+ msg += ("{} ({})\n".format(role.name, role.id))
+
+ for page in pagify(msg, ["\n"]):
+ await ctx.send(page)
+
+ @commands.command()
+ @checks.mod_or_permissions(manage_messages=True)
+ async def rolestats(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Display number of members in each role by role hierarchy
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ msg = ""
+ for role in sorted(guild.roles, reverse=True):
+ msg += "{}: {} \n".format(role.mention, len(role.members))
+ for page in pagify(msg, ["\n"]):
+ em = discord.Embed(description=page)
+ await ctx.send(embed=em)
+
+ async def check_highest(self, data):
+ highest = 0
+ users = 0
+ for user, value in data.items():
+ if value > highest:
+ highest = value
+ users = user
+ return highest, users
+
+ @commands.command(name="getreactions", aliases=["getreaction"])
+ @checks.mod_or_permissions(manage_messages=True)
+ async def get_reactions(self, ctx, message_id:int, channel:discord.TextChannel=None):
+ """
+ Gets a list of all reactions from specified message and displays the user ID,
+ Username, and Discriminator and the emoji name.
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ msg = await channel.get_message(message_id)
+ new_msg = ""
+ for reaction in msg.reactions:
+ async for user in reaction.users():
+ if type(reaction.emoji) is not str:
+ new_msg += "{} {}#{} {}\n".format(user.id, user.name, user.discriminator, reaction.emoji.name)
+ else:
+ new_msg += "{} {}#{} {}\n".format(user.id, user.name, user.discriminator, reaction.emoji)
+ for page in pagify(new_msg, shorten_by=20):
+ await ctx.send("```py\n{}\n```".format(page))
+
+
+ @commands.command(aliases=["serverstats"])
+ @checks.mod_or_permissions(manage_messages=True)
+ async def server_stats(self, ctx, *, guild_name:Union[int, str]=None):
+ """Gets total messages on the server and per-channel basis as well as most single user posts"""
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ channel = ctx.message.channel
+ total_msgs = 0
+ msg = ""
+ total_contribution = {}
+ warning_msg = await ctx.send(_("This might take a while!"))
+ async with ctx.channel.typing():
+ for chn in guild.channels:
+ channel_msgs = 0
+ channel_contribution = {}
+ try:
+ async for message in chn.history(limit=10000000):
+ author = message.author
+ channel_msgs += 1
+ total_msgs += 1
+ if author.id not in channel_contribution:
+ channel_contribution[author.id] = 1
+ else:
+ channel_contribution[author.id] += 1
+
+ if author.id not in total_contribution:
+ total_contribution[author.id] = 1
+ else:
+ total_contribution[author.id] += 1
+ highest, users = await self.check_highest(channel_contribution)
+ msg += "{}: Total Messages:**{}** most user posts **{}**\n".format(chn.mention, channel_msgs, highest)
+ except discord.errors.Forbidden:
+ pass
+ except AttributeError:
+ pass
+ highest, users = await self.check_highest(total_contribution)
+ new_msg = "__{}__: Total Messages:**{}** Most user posts **{}**\n{}".format(guild.name, total_msgs, highest, msg)
+ await warning_msg.delete()
+ for page in pagify(new_msg, ["\n"]):
+ await channel.send(page)
+
+
+ async def emoji_menu(self, ctx, post_list: list, guild,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+
+ emojis = post_list[page]
+ em = discord.Embed(timestamp=ctx.message.created_at)
+ em.set_author(name=guild.name + " Emojis", icon_url=guild.icon_url)
+ regular = []
+ msg = ""
+ for emoji in emojis:
+ msg += emoji
+ em.description = msg
+ em.set_footer(text="Page {} of {}".format(page+1, len(post_list)))
+
+ if not message:
+ message = await ctx.send(embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await self.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", self.bot.user)
+ await message.remove_reaction("❌", self.bot.user)
+ await message.remove_reaction("➡", self.bot.user)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ try:
+ await message.remove_reaction("➡", ctx.message.author)
+ except:
+ pass
+ return await self.emoji_menu(ctx, post_list, guild, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ try:
+ await message.remove_reaction("⬅", ctx.message.author)
+ except:
+ pass
+ return await self.emoji_menu(ctx, post_list, guild, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @commands.command(aliases=["serveremojis"])
+ @commands.bot_has_permissions(embed_links=True)
+ async def guildemojis(self, ctx, *, guild_name:Union[int, str]=None):
+ """
+ Display all server emojis in a menu that can be scrolled through
+
+ `guild_name` can be either the server ID or partial name
+ """
+ guild = ctx.guild
+ if guild_name is not None:
+ try:
+ guild = await self.get_guild_obj(guild_name)
+ except GuildNotFoundError:
+ await ctx.send("{} guild could not be found.".format(guild_name))
+ return
+ msg = ""
+ embed = discord.Embed(timestamp=ctx.message.created_at)
+ embed.set_author(name=guild.name, icon_url=guild.icon_url)
+ regular = []
+ for emoji in guild.emojis:
+ if emoji.animated:
+ regular.append(f" = `:{emoji.name}:`\n")
+ else:
+ regular.append(f"<:{emoji.name}:{emoji.id}> = `:{emoji.name}:`\n")
+ if regular != "":
+ embed.description = regular
+ x = [regular[i:i+10] for i in range(0, len(regular), 10)]
+ # if animated != "":
+ # embed.add_field(name="Animated Emojis", value=animated[:1023])
+ await self.emoji_menu(ctx, x, guild)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/spoiler/__init__.py b/spoiler/__init__.py
new file mode 100644
index 0000000..05944f9
--- /dev/null
+++ b/spoiler/__init__.py
@@ -0,0 +1,4 @@
+from .spoiler import Spoiler
+
+def setup(bot):
+ bot.add_cog(Spoiler(bot))
\ No newline at end of file
diff --git a/spoiler/info.json b/spoiler/info.json
new file mode 100644
index 0000000..9f88911
--- /dev/null
+++ b/spoiler/info.json
@@ -0,0 +1,24 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Post spoiler messages through the bot.",
+ "install_msg":"Use `[p]spoiler spoiler message` to post a spoiler message, react to be DM'd the spoiler.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Spoiler",
+ "permissions":[
+ "manage_messages",
+ "add_reactions"
+ ],
+ "requirements":[],
+ "short":"Spoiler messages",
+ "tags":[
+ "general",
+ "utility",
+ "spoiler"
+ ]
+}
\ No newline at end of file
diff --git a/spoiler/spoiler.py b/spoiler/spoiler.py
new file mode 100644
index 0000000..4bb5be6
--- /dev/null
+++ b/spoiler/spoiler.py
@@ -0,0 +1,75 @@
+import discord
+from redbot.core import Config, checks, commands
+
+
+__version__ = "1.1.0"
+__author__ = "TrustyJAID"
+
+
+class Spoiler(getattr(commands, "Cog", object)):
+ """
+ Post spoilers in chat without spoining the text for everyone
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ default_guild = {"messages":[]}
+ self.config = Config.get_conf(self, 545496534746)
+ self.config.register_guild(**default_guild)
+
+
+ @commands.command(name="spoiler", aliases=["spoilers"])
+ @commands.guild_only()
+ async def _spoiler(self, ctx, *, spoiler_msg):
+ """
+ Post spoilers in chat, react to the message to see the spoilers
+ """
+ if not ctx.channel.permissions_for(ctx.me).manage_messages:
+ await ctx.send("I don't have `manage_messages` permission.")
+ return
+ if not ctx.channel.permissions_for(ctx.me).add_reactions:
+ await ctx.send("I don't have `add_reactions` permission.")
+ return
+ await ctx.message.delete()
+ author = ctx.author.name
+ msg_text = "**__SPOILERS__** (React to this message to view {}'s spoiler.)".format(author)
+ new_msg = await ctx.send(msg_text)
+ await new_msg.add_reaction("✅")
+ msg_list = await self.config.guild(ctx.guild).messages()
+ spoiler_obj = {"message_id":new_msg.id, "spoiler_text":spoiler_msg, "author":ctx.author.id}
+ msg_list.append(spoiler_obj)
+ await self.config.guild(ctx.guild).messages.set(msg_list)
+
+ async def make_embed(self, channel, spoiler_obj):
+ msg = await channel.get_message(spoiler_obj["message_id"])
+ author = await self.bot.get_user_info(spoiler_obj["author"])
+ name = f"{author.name}#{author.discriminator} Spoiled"
+ spoiler_text = spoiler_obj["spoiler_text"] + f"\n\n [Click here for context]({msg.jump_url})"
+ em = discord.Embed(description = spoiler_text, timestamp=msg.created_at)
+ em.set_author(name=name, icon_url=getattr(author, "avatar_url", discord.Embed.Empty), url=msg.jump_url)
+ em.set_footer(text='{} | #{}'.format(channel.guild.name, channel.name))
+ return em
+
+ async def on_raw_reaction_add(self, payload):
+ if str(payload.emoji) != "✅":
+ return
+ channel = self.bot.get_channel(id=payload.channel_id)
+ try:
+ guild = channel.guild
+ except:
+ return
+ if payload.message_id not in [m["message_id"] for m in await self.config.guild(guild).messages()]:
+ return
+ user = guild.get_member(payload.user_id)
+ if user.bot:
+ return
+ msg_list = await self.config.guild(guild).messages()
+ spoiler_obj = None
+ for msg in msg_list:
+ if payload.message_id == msg["message_id"]:
+ spoiler_obj = msg
+ if spoiler_obj is not None:
+ try:
+ await user.send(embed = await self.make_embed(channel, spoiler_obj))
+ except Exception as e:
+ print(e)
\ No newline at end of file
diff --git a/starboard/__init__.py b/starboard/__init__.py
new file mode 100644
index 0000000..254e729
--- /dev/null
+++ b/starboard/__init__.py
@@ -0,0 +1,4 @@
+from .starboard import Starboard
+
+def setup(bot):
+ bot.add_cog(Starboard(bot))
\ No newline at end of file
diff --git a/starboard/info.json b/starboard/info.json
new file mode 100644
index 0000000..8fb3574
--- /dev/null
+++ b/starboard/info.json
@@ -0,0 +1,24 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Create a starboard channel to save those amazing posts!",
+ "install_msg":"Create a starboard!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Starboard",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Starboard",
+ "tags":[
+ "general",
+ "starboard",
+ "star",
+ "fun"
+ ]
+}
\ No newline at end of file
diff --git a/starboard/message_entry.py b/starboard/message_entry.py
new file mode 100644
index 0000000..2b86751
--- /dev/null
+++ b/starboard/message_entry.py
@@ -0,0 +1,20 @@
+class StarboardMessage:
+
+ def __init__(self, original_message, new_message, count):
+ super().__init__()
+ self.original_message = original_message
+ self.new_message = new_message
+ self.count = count
+
+ def to_json(self) -> dict:
+ return {
+ "original_message": self.original_message,
+ "new_message": self.new_message,
+ "count": self.count
+ }
+
+ @classmethod
+ def from_json(cls, data: dict):
+ return cls(data["original_message"], data["new_message"], data["count"])
+
+
diff --git a/starboard/starboard.py b/starboard/starboard.py
new file mode 100644
index 0000000..b9079e8
--- /dev/null
+++ b/starboard/starboard.py
@@ -0,0 +1,408 @@
+import discord
+from redbot.core import Config
+from redbot.core import checks
+from redbot.core import commands
+from .message_entry import StarboardMessage
+from copy import copy
+
+class Starboard(getattr(commands, "Cog", object)):
+ """
+ Create a starboard to *pin* those special comments
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ default_guild = {"enabled": False, "channel": None, "emoji": None,
+ "role":[], "messages":[], "ignore":[], "threshold": 0}
+ self.config = Config.get_conf(self, 356488795)
+ self.config.register_guild(**default_guild)
+ self.message_list = []
+
+ @commands.group(pass_context=True)
+ @checks.admin_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def starboard(self, ctx):
+ """Commands for managing the starboard"""
+ if ctx.invoked_subcommand is None:
+ guild = ctx.guild
+ if guild is None:
+ return
+ enabled = await self.config.guild(guild).enabled()
+ if enabled:
+ channel = self.bot.get_channel(await self.config.guild(guild).channel())
+ if channel is None:
+ channel_mention = "None"
+ else:
+ channel_mention = channel.mention
+ emoji = await self.config.guild(guild).emoji()
+ role = ", ".join(guild.get_role(r).name for r in await self.config.guild(guild).role())
+ ignore = await self.config.guild(guild).ignore()
+ if ignore != []:
+ ignored_channels = ", ".join(self.bot.get_channel(chn).mention for chn in ignore)
+ ignored_channels += ", {}".format(channel.mention)
+ else:
+ ignored_channels = channel.mention
+ threshold = await self.config.guild(guild).threshold()
+ if ctx.channel.permissions_for(ctx.guild.me).embed_links:
+ em = discord.Embed(title="Starboard settings for {}".format(ctx.guild.name))
+ em.add_field(name="Enabled", value=str(enabled))
+ em.add_field(name="Emoji", value=str(emoji))
+ em.add_field(name="Starboard Channel", value=channel_mention)
+ em.add_field(name="Roles Allowed", value=role)
+ em.add_field(name="Ignored Channels", value=ignored_channels)
+ em.add_field(name="Threshold", value=threshold)
+ await ctx.send(embed=em)
+ else:
+ msg = f"Starboard Settings for {guild.name}\n"
+ msg += f"Enabled: {enabled}\n"
+ msg += f"Emoji: {str(emoji)}\n"
+ msg += f"Starboard Channel:{channel.mention}\n"
+ msg += f"Roles Allowed: {role}\n"
+ msg += f"Ignored Channels: {ignored_channels}\n"
+ msg += f"Threshold: {threshold}"
+ await ctx.send(msg)
+
+ @starboard.group(pass_context=True, name="role", aliases=["roles"])
+ async def _roles(self, ctx):
+ """Add or remove roles allowed to add to the starboard"""
+ pass
+
+ async def get_everyone_role(self, guild):
+ for role in guild.roles:
+ if role.is_default():
+ return role
+
+ async def check_guild_emojis(self, guild, emoji):
+ guild_emoji = None
+ for emojis in guild.emojis:
+ if str(emojis.id) in emoji:
+ guild_emoji = emojis
+ return guild_emoji
+
+ @commands.command()
+ @commands.guild_only()
+ async def star(self, ctx, msg_id, channel:discord.TextChannel=None):
+ """
+ Manually star a message
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ guild = channel.guild
+ if guild is None:
+ await ctx.send("This command can work in guilds only.")
+ return
+ try:
+ msg = await channel.get_message(id=msg_id)
+ except:
+ return
+ user = ctx.message.author
+ if msg.channel.id in await self.config.guild(guild).ignore():
+ return
+ if msg.channel.id == await self.config.guild(guild).channel():
+ return
+ if not await self.config.guild(guild).enabled():
+ return
+ if not await self.check_roles(user, msg.author, guild):
+ return
+ emoji = await self.config.guild(guild).emoji()
+ if await self.check_is_posted(guild, msg):
+ channel = self.bot.get_channel(await self.config.guild(guild).channel())
+ msg_id, count2 = await self.get_posted_message(guild, msg)
+ if msg_id is not None:
+ msg_edit = await channel.get_message(msg_id)
+ await msg_edit.edit(content="{} **#{}**".format(emoji, count2))
+ return
+ count = 1
+ channel2 = self.bot.get_channel(id=await self.config.guild(guild).channel())
+ em = await self.build_embed(guild, msg)
+ try:
+ post_msg = await channel2.send("{} **#{}**".format(emoji, count), embed=em)
+ except discord.errors.Forbidden:
+ return await ctx.send("I don't have permissions to post in the starboard channel.")
+ past_message_list = await self.config.guild(guild).messages()
+ past_message_list.append(StarboardMessage(msg.id, post_msg.id, count).to_json())
+ await self.config.guild(guild).messages.set(past_message_list)
+
+
+ @starboard.command(pass_context=True, name="setup", aliases=["set"])
+ async def setup_starboard(self, ctx, channel: discord.TextChannel=None, emoji="⭐", role:discord.Role=None):
+ """
+ Setup the starboard on this server
+
+ Default channel is the current channel
+ Default emoji is ⭐
+ Default role is everyone
+ """
+ guild = ctx.message.guild
+ if channel is None:
+ channel = ctx.message.channel
+ if "<" in emoji and ">" in emoji:
+ emoji = await self.check_guild_emojis(guild, emoji)
+ if emoji is None:
+ await ctx.send("That emoji is not on this guild!")
+ return
+ else:
+ emoji = "<:" + emoji.name + ":" + str(emoji.id) + ">"
+
+ if not channel.permissions_for(guild.me).send_messages:
+ await ctx.send("I don't have permission to post in {}".format(channel.mention))
+ return
+
+ if not channel.permissions_for(guild.me).embed_links:
+ await ctx.send("I don't have permission to embed links in {}".format(channel.mention))
+ return
+
+ if role is None:
+ role = await self.get_everyone_role(guild)
+ await self.config.guild(ctx.guild).emoji.set(emoji)
+ await self.config.guild(ctx.guild).channel.set(channel.id)
+ await self.config.guild(ctx.guild).role.set([role.id])
+ await self.config.guild(ctx.guild).enabled.set(True)
+ await ctx.send("Starboard set to {}".format(channel.mention))
+
+ @starboard.command(name="disable")
+ async def disable_starboard(self, ctx):
+ """Disables the starboard for this server."""
+ await self.config.guild(ctx.guild).enabled.set(False)
+ await ctx.send("Starboard disabled here!")
+
+ @starboard.command(name="enable")
+ async def enable_starboard(self, ctx):
+ """Enables the starboard for this server."""
+ await self.config.guild(ctx.guild).enabled.set(True)
+ await ctx.send("Starboard enabled here!")
+
+ @starboard.command(name="ignore")
+ async def toggle_channel_ignore(self, ctx, channel:discord.TextChannel=None):
+ """
+ Toggles channel to be ignored by starboard
+
+ The starboard channel is always ignored by default
+ """
+ if channel is None:
+ channel = ctx.message.channel
+ ignore_list = await self.config.guild(ctx.guild).ignore()
+ if channel.id in ignore_list:
+ ignore_list.remove(channel.id)
+ await ctx.send("{} removed from the ignored channel list!".format(channel.mention))
+ else:
+ ignore_list.append(channel.id)
+ await ctx.send("{} added to the ignored channel list!".format(channel.mention))
+ await self.config.guild(ctx.guild).ignore.set(ignore_list)
+
+ @starboard.command(pass_context=True, name="emoji")
+ async def set_emoji(self, ctx, emoji="⭐"):
+ """Set the emoji for the starboard defaults to ⭐"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await ctx.send("I am not setup for the starboard on this guild!\
+ \nuse `[p]starboard set` to set it up.")
+ return
+ is_guild_emoji = False
+ if "<" in emoji and ">" in emoji:
+ emoji = await self.check_guild_emojis(guild, emoji)
+ if emoji is None:
+ await ctx.send("That emoji is not on this guild!")
+ return
+ else:
+ is_guild_emoji = True
+ emoji = "<:" + emoji.name + ":" + str(emoji.id) + ">"
+ await self.config.guild(guild).emoji.set(emoji)
+ if is_guild_emoji:
+ await ctx.send("Starboard emoji set to {}.".format(emoji))
+ else:
+ await ctx.send("Starboard emoji set to {}.".format(emoji))
+
+ @starboard.command(pass_context=True, name="channel")
+ async def set_channel(self, ctx, channel:discord.TextChannel=None):
+ """Set the channel for the starboard"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await ctx.send("I am not setup for the starboard on this guild!\
+ \nuse `[p]starboard set` to set it up.")
+ return
+ if channel is None:
+ channel = ctx.message.channel
+
+ if not channel.permissions_for(guild.me).send_messages:
+ await ctx.send("I don't have permission to post in {}".format(channel.mention))
+ return
+
+ if not channel.permissions_for(guild.me).embed_links:
+ await ctx.send("I don't have permission to embed links in {}".format(channel.mention))
+ return
+ await self.config.guild(guild).channel.set(channel.id)
+ await ctx.send("Starboard channel set to {}.".format(channel.mention))
+
+ @starboard.command(pass_context=True, name="threshold")
+ async def set_threshold(self, ctx, threshold:int=0):
+ """Set the threshold before posting to the starboard"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await ctx.send(
+ "I am not setup for the starboard on this guild!\
+ \nuse `[p]starboard set` to set it up.")
+ return
+ await self.config.guild(guild).threshold.set(threshold)
+ await ctx.send("Starboard threshold set to {}.".format(threshold))
+
+ @_roles.command(pass_context=True, name="add")
+ async def add_role(self, ctx, role:discord.Role=None):
+ """Add a role allowed to add messages to the starboard defaults to @everyone"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await ctx.send("I am not setup for the starboard on this guild!\
+ \nuse starboard set to set it up.")
+ return
+ everyone_role = await self.get_everyone_role(guild)
+ guild_roles = await self.config.guild(guild).role()
+ if role is None:
+ role = everyone_role
+ if role.id in guild_roles:
+ await ctx.send("{} can already add to the starboard!".format(role.name))
+ return
+ if everyone_role.id in guild_roles and role != everyone_role:
+ guild_roles.remove(everyone_role.id)
+ guild_roles.append(role.id)
+ await self.config.guild(guild).role.set(guild_roles)
+ await ctx.send("Starboard role set to {}.".format(role.name))
+
+ @_roles.command(pass_context=True, name="remove", aliases=["del", "rem"])
+ async def remove_role(self, ctx, role:discord.Role):
+ """Remove a role allowed to add messages to the starboard"""
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await ctx.send("I am not setup for the starboard on this guild! use starboard set to set it up.")
+ return
+ everyone_role = await self.get_everyone_role(guild)
+ guild_roles = await self.config.guild(guild).role()
+ if role.id in guild_roles:
+ guild_roles.remove(role.id)
+ if guild_roles == []:
+ guild_roles.append(everyone_role.id)
+ await self.config.guild(guild).role.set(guild_roles)
+ await ctx.send("{} removed from starboard.".format(role.name))
+
+ async def check_roles(self, user, author, guild):
+ """Checks if the user is allowed to add to the starboard
+ Allows bot owner to always add messages for testing
+ disallows users from adding their own messages"""
+ has_role = False
+ for role in user.roles:
+ if role.id in await self.config.guild(guild).role():
+ has_role = True
+ if user is author:
+ has_role = False
+ if user.id == self.bot.owner_id:
+ # Owner should always be allowed to add messages
+ has_role = True
+ return has_role
+
+ async def check_is_posted(self, guild, message):
+ is_posted = False
+ for past_message in await self.config.guild(guild).messages():
+ if message.id == past_message["original_message"]:
+ is_posted = True
+ if (guild.id, message.id) in self.message_list:
+ is_posted = True
+ return is_posted
+
+ async def get_posted_message(self, guild, message):
+ msg_list = await self.config.guild(guild).messages()
+ msg = None
+ for past_message in msg_list:
+ if message.id == past_message["original_message"]:
+ msg = past_message
+ if msg is None:
+ return
+ msg_list.remove(msg)
+ msg["count"] += 1
+ msg_list.append(msg)
+ await self.config.guild(guild).messages.set(msg_list)
+ return msg["new_message"], msg["count"]
+
+ async def build_embed(self, guild, msg):
+ channel = msg.channel
+ author = msg.author
+ if msg.embeds != []:
+ em = msg.embeds[0]
+ if msg.content != "":
+ if em.description != discord.Embed.Empty:
+ em.description = "{}\n\n{}".format(msg.content, em.description)
+ else:
+ em.description = msg.content
+ if not author.bot:
+ em.set_author(name=author.display_name, url=msg.jump_url, icon_url=author.avatar_url)
+ else:
+ em = discord.Embed(timestamp=msg.created_at)
+ try:
+ em.color = author.top_role.color
+ except Exception as e:
+ print(e)
+ pass
+ em.description = msg.content
+ em.set_author(name=author.display_name, url=msg.jump_url, icon_url=author.avatar_url)
+ if msg.attachments != []:
+ em.set_image(url=msg.attachments[0].url)
+ em.timestamp = msg.created_at
+ em.description = em.description +"\n\n[Click Here to view context]({})".format(msg.jump_url)
+ em.set_footer(text='{} | {}'.format(channel.guild.name, channel.name))
+ return em
+
+
+ async def on_raw_reaction_add(self, payload):
+ channel = self.bot.get_channel(id=payload.channel_id)
+ try:
+ guild = channel.guild
+ except:
+ return
+ try:
+ msg = await channel.get_message(id=payload.message_id)
+ except:
+ return
+ user = guild.get_member(payload.user_id)
+ if msg.channel.id in await self.config.guild(guild).ignore():
+ return
+ if msg.channel.id == await self.config.guild(guild).channel():
+ return
+ if not await self.config.guild(guild).enabled():
+ return
+ if not await self.check_roles(user, msg.author, guild):
+ return
+ if user.bot:
+ return
+ react = await self.config.guild(guild).emoji()
+ if str(react) == str(payload.emoji):
+ threshold = await self.config.guild(guild).threshold()
+ try:
+ reaction = [r for r in msg.reactions if str(r.emoji) == str(payload.emoji)][0]
+ count = reaction.count
+ except IndexError:
+ count = 0
+ async for user in reaction.users():
+ # This makes sure that the user cannot add their own count to the starboard threshold
+ if msg.author.id == user.id and count != 0:
+ count -= 1
+ if await self.check_is_posted(guild, msg):
+ channel = self.bot.get_channel(await self.config.guild(guild).channel())
+ msg_id, count2 = await self.get_posted_message(guild, msg)
+ if msg_id is not None:
+ msg_edit = await channel.get_message(msg_id)
+ await msg_edit.edit(content="{} **#{}**".format(payload.emoji, count))
+ return
+
+ self.message_list.append((guild.id, payload.message_id))
+ if count < threshold:
+ past_message_list = await self.config.guild(guild).messages()
+ past_message_list.append(StarboardMessage(msg.id, None, count).to_json())
+ await self.config.guild(guild).messages.set(past_message_list)
+ self.message_list.remove((guild.id, payload.message_id))
+ return
+
+ channel2 = self.bot.get_channel(id=await self.config.guild(guild).channel())
+ em = await self.build_embed(guild, msg)
+ post_msg = await channel2.send("{} **#{}**".format(payload.emoji, count), embed=em)
+ past_message_list = await self.config.guild(guild).messages()
+ past_message_list.append(StarboardMessage(msg.id, post_msg.id, count).to_json())
+ await self.config.guild(guild).messages.set(past_message_list)
+ self.message_list.remove((guild.id, payload.message_id))
\ No newline at end of file
diff --git a/stickyroles/__init__.py b/stickyroles/__init__.py
new file mode 100644
index 0000000..6f8b975
--- /dev/null
+++ b/stickyroles/__init__.py
@@ -0,0 +1,4 @@
+from .stickyroles import StickyRoles
+
+def setup(bot):
+ bot.add_cog(StickyRoles(bot))
\ No newline at end of file
diff --git a/stickyroles/info.json b/stickyroles/info.json
new file mode 100644
index 0000000..549b14f
--- /dev/null
+++ b/stickyroles/info.json
@@ -0,0 +1,25 @@
+{
+ "author":[
+ "Twentysix",
+ "TrustyJAID"
+ ],
+ "description":"With this cog you can specify which roles you want to be reapplied on join. This is particularly useful to fight \"role evasion\".",
+ "install_msg":"The command group is `[p]stickyroles`. Remember that role names are case sensitive. If a user with the roles you specified with `[p]stickyroles add` leaves the server and comes back those roles will be reapplied to them. Make sure that Red has appropriate permissions.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"stickyroles",
+ "permissions":[
+ "manage_roles"
+ ],
+ "requirements":[],
+ "short":"Reapplies specific roles on join",
+ "tags":[
+ "utility",
+ "roles",
+ "tools",
+ "moderation"
+ ]
+}
\ No newline at end of file
diff --git a/stickyroles/stickyroles.py b/stickyroles/stickyroles.py
new file mode 100644
index 0000000..606967d
--- /dev/null
+++ b/stickyroles/stickyroles.py
@@ -0,0 +1,132 @@
+import discord
+import os
+from redbot.core import commands
+from collections import defaultdict
+from redbot.core import Config
+from redbot.core import checks
+
+default = {
+ "sticky_roles": [],
+ "to_reapply" : {}
+}
+
+
+class StickyRoles(getattr(commands, "Cog", object)):
+ """Reapplies specific roles on join. Rewritten for V3 from https://github.com/Twentysix26/26-Cogs/blob/master/stickyroles/stickyroles.py"""
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 1358454876)
+ self.config.register_guild(**default)
+ # db = dataIO.load_json("data/stickyroles/stickyroles.json")
+ # self.db = defaultdict(lambda: default.copy(), db)
+
+ @commands.group(pass_context=True, aliases=["stickyrole"])
+ @checks.admin()
+ async def stickyroles(self, ctx):
+ """Adds / removes roles to be reapplied on join"""
+ pass
+
+ @stickyroles.command(pass_context=True)
+ async def add(self, ctx, *, role: discord.Role):
+ """Adds role to be reapplied on join"""
+ guild = ctx.message.guild
+ sticky_roles = await self.config.guild(guild).sticky_roles()
+ if not guild.me.top_role.position > role.position:
+ await ctx.send("I don't have enough permissions to add that "
+ "role. Remember to take role hierarchy in "
+ "consideration.")
+ return
+ if role.id in sticky_roles:
+ await ctx.send("{} is already in the sticky roles.".format(role.name))
+ return
+ sticky_roles.append(role.id)
+ await self.config.guild(guild).sticky_roles.set(sticky_roles)
+ await ctx.send("That role will now be reapplied on join.")
+
+ @stickyroles.command(pass_context=True)
+ async def remove(self, ctx, *, role: discord.Role):
+ """Removes role to be reapplied on join"""
+ guild = ctx.message.guild
+ sticky_roles = await self.config.guild(guild).sticky_roles()
+ if role.id not in sticky_roles:
+ await ctx.send("That role was never added in the first place.")
+ return
+ sticky_roles.remove(role.id)
+ await self.config.guild(guild).sticky_roles.set(sticky_roles)
+ await ctx.send("That role won't be reapplied on join.")
+
+ @stickyroles.command(pass_context=True)
+ async def clear(self, ctx):
+ """Removes all sticky roles"""
+ guild = ctx.message.guild
+ await self.config.guild(guild).sticky_roles.set([])
+ await self.config.guild(guild).to_reapply.set({})
+ await ctx.send("All sticky roles have been removed.")
+
+ @stickyroles.command(name="list", pass_context=True)
+ async def _list(self, ctx):
+ """Lists sticky roles"""
+ guild = ctx.message.guild
+ roles = await self.config.guild(guild).sticky_roles()
+ roles = [discord.utils.get(guild.roles, id=r) for r in await self.config.guild(guild).sticky_roles()]
+ roles = [r.name for r in roles if r is not None]
+ if roles:
+ await ctx.send("Sticky roles:\n\n" + ", ".join(roles))
+ else:
+ await ctx.send("No sticky roles. Add some with `{}stickyroles "
+ "add`".format(ctx.prefix))
+
+ async def on_member_remove(self, member):
+ guild = member.guild
+ sticky_roles = await self.config.guild(guild).sticky_roles()
+ to_reapply = await self.config.guild(guild).to_reapply()
+ if to_reapply is None:
+ return
+
+ save = False
+
+ for role in member.roles:
+ if role.id in sticky_roles:
+ if str(member.id) not in to_reapply:
+ to_reapply[str(member.id)] = []
+ to_reapply[str(member.id)].append(role.id)
+ save = True
+
+ if save:
+ await self.config.guild(guild).to_reapply.set(to_reapply)
+
+ async def on_member_join(self, member):
+ guild = member.guild
+ sticky_roles = await self.config.guild(guild).sticky_roles()
+ to_reapply = await self.config.guild(guild).to_reapply()
+ if to_reapply is None:
+ return
+
+ if str(member.id) not in to_reapply:
+ return
+
+ to_add = []
+
+ for role_id in to_reapply[str(member.id)]:
+ if role_id not in sticky_roles:
+ continue
+ role = discord.utils.get(guild.roles, id=role_id)
+ if role:
+ to_add.append(role)
+
+ del to_reapply[str(member.id)]
+
+ if to_add:
+ try:
+ await member.add_roles(*to_add)
+ except discord.Forbidden:
+ print("Failed to add roles to {} ({})\n{}\n"
+ "I lack permissions to do that."
+ "".format(member, member.id, to_add))
+ except discord.HTTPException as e:
+ print("Failed to add roles to {} ({})\n{}\n"
+ "{}"
+ "".format(member, member.id, to_add, e))
+
+ await self.config.guild(guild).to_reapply.set(to_reapply)
diff --git a/tarot/__init__.py b/tarot/__init__.py
new file mode 100644
index 0000000..81cb4c6
--- /dev/null
+++ b/tarot/__init__.py
@@ -0,0 +1,4 @@
+from .tarotreading import TarotReading
+
+def setup(bot):
+ bot.add_cog(TarotReading(bot))
\ No newline at end of file
diff --git a/tarot/info.json b/tarot/info.json
new file mode 100644
index 0000000..a17e523
--- /dev/null
+++ b/tarot/info.json
@@ -0,0 +1,23 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Get your Tarot reading done!",
+ "install_msg":"Usage: `[p]tarots life` `[p]tarots reading` `[p]tarots card`",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Tarot",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"General commands",
+ "tags":[
+ "general",
+ "fun",
+ "tarot"
+ ]
+}
\ No newline at end of file
diff --git a/tarot/tarot_cards.py b/tarot/tarot_cards.py
new file mode 100644
index 0000000..812afff
--- /dev/null
+++ b/tarot/tarot_cards.py
@@ -0,0 +1,470 @@
+card_list = {
+ "1": {
+ "card_meaning": "Inspiration, power, creation, beginnings, potential",
+ "card_name": "Ace of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ace-of-wands/",
+ "card_img": "http://i.imgur.com/MfJ1s77.jpg"
+ },
+ "10": {
+ "card_meaning": "Burden, responsibility, hard work, stress, achievement",
+ "card_name": "Ten of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ten-of-wands/",
+ "card_img": "http://i.imgur.com/hNC3y5g.jpg"
+ },
+ "11": {
+ "card_meaning": "Enthusiasm, exploration, discovery, free spirit",
+ "card_name": "Page of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/page-of-wands/",
+ "card_img": "http://i.imgur.com/44puitP.jpg"
+ },
+ "12": {
+ "card_meaning": "Energy, passion, lust, action, adventure, impulsiveness",
+ "card_name": "Knight of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/knight-of-wands/",
+ "card_img": "http://i.imgur.com/yzCPXQX.jpg"
+ },
+ "13": {
+ "card_meaning": "Exuberance, warmth, vibrancy, determination",
+ "card_name": "Queen of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/queen-of-wands/",
+ "card_img": "http://i.imgur.com/LTeYFqy.jpg"
+ },
+ "14": {
+ "card_meaning": "Natural-born leader, vision, entrepreneur, honour",
+ "card_name": "King of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/king-of-wands/",
+ "card_img": "http://i.imgur.com/iC2Il8N.jpg"
+ },
+ "15": {
+ "card_meaning": "Raw power, victory, break-throughs, mental clarity",
+ "card_name": "Ace of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ace-of-swords/",
+ "card_img": "http://i.imgur.com/ja2tUWE.jpg"
+ },
+ "16": {
+ "card_meaning": "Indecision, choices, truce, stalemate, blocked emotions",
+ "card_name": "Two of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/two-of-swords/",
+ "card_img": "http://i.imgur.com/EBIjsot.jpg"
+ },
+ "17": {
+ "card_meaning": "Painful separation, sorrow heartbreak, grief, rejection",
+ "card_name": "Three of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/three-of-swords/",
+ "card_img": "http://i.imgur.com/CkKUNSa.jpg"
+ },
+ "18": {
+ "card_meaning": "Contemplation, recuperation, passivity, relaxation, rest",
+ "card_name": "Four of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/four-of-swords/",
+ "card_img": "http://i.imgur.com/y1psOrh.jpg"
+ },
+ "19": {
+ "card_meaning": "Conflict, tension, loss, defeat, win at all costs, betrayal",
+ "card_name": "Five of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/five-of-swords/",
+ "card_img": "http://i.imgur.com/T1pDWbo.jpg"
+ },
+ "2": {
+ "card_meaning": "Future planning, progress, decisions, discovery",
+ "card_name": "Two of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/two-of-wands/",
+ "card_img": "http://i.imgur.com/Ghb63pd.jpg"
+ },
+ "20": {
+ "card_meaning": "Regretful but necessary transition, rite of passage",
+ "card_name": "Six of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/six-of-swords/",
+ "card_img": "http://i.imgur.com/ddXLubY.jpg"
+ },
+ "21": {
+ "card_meaning": "Betrayal, deception, getting away with something, stealth",
+ "card_name": "Seven of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/seven-of-swords/",
+ "card_img": "http://i.imgur.com/6DNu8dU.jpg"
+ },
+ "22": {
+ "card_meaning": "Isolation, self-imposed restriction, imprisonment",
+ "card_name": "Eight of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/eight-of-swords/",
+ "card_img": "http://i.imgur.com/ov9j8pg.jpg"
+ },
+ "23": {
+ "card_meaning": "Depression, nightmares, intense anxiety, despair",
+ "card_name": "Nine of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/nine-of-swords/",
+ "card_img": "http://i.imgur.com/iWl54Xx.jpg"
+ },
+ "24": {
+ "card_meaning": "Back-stabbed, defeat, crisis, betrayal, endings, loss",
+ "card_name": "Ten of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ten-of-swords/",
+ "card_img": "http://i.imgur.com/NhkCBnz.jpg"
+ },
+ "25": {
+ "card_meaning": "Talkative, curious, mentally restless, energetic",
+ "card_name": "Page of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/page-of-swords/",
+ "card_img": "http://i.imgur.com/decjazD.jpg"
+ },
+ "26": {
+ "card_meaning": "Opinionated, hasty, action-oriented, communicative",
+ "card_name": "Knight of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/knight-of-swords/",
+ "card_img": "http://i.imgur.com/p87LNk8.jpg"
+ },
+ "27": {
+ "card_meaning": "Quick thinker, organised, perceptive, independent",
+ "card_name": "Queen of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/queen-of-swords/",
+ "card_img": "http://i.imgur.com/vgTOeBk.jpg"
+ },
+ "28": {
+ "card_meaning": "Clear thinking, intellectual power, authority, truth",
+ "card_name": "King of Swords",
+ "card_url": "http://www.tarotlore.com/tarot-cards/king-of-swords/",
+ "card_img": "http://i.imgur.com/Y0EtbYp.jpg"
+ },
+ "29": {
+ "card_meaning": "Love, compassion, creativity, overwhelming emotion",
+ "card_name": "Ace of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ace-of-cups/",
+ "card_img": "http://i.imgur.com/4ZcxuXf.jpg"
+ },
+ "3": {
+ "card_meaning": "Preparation, foresight, enterprise, expansion",
+ "card_name": "Three of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/three-of-wands/",
+ "card_img": "http://i.imgur.com/NIUAuzw.jpg"
+ },
+ "30": {
+ "card_meaning": "Unified love, partnership, attraction, relationships",
+ "card_name": "Two of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/two-of-cups/",
+ "card_img": "http://i.imgur.com/K8MRy5I.jpg"
+ },
+ "31": {
+ "card_meaning": "Celebration, friendship, creativity, community",
+ "card_name": "Three of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/three-of-cups/",
+ "card_img": "http://i.imgur.com/lqsvyuD.jpg"
+ },
+ "32": {
+ "card_meaning": "Meditation, contemplation, apathy, re-evaluation",
+ "card_name": "Four of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/four-of-cups/",
+ "card_img": "http://i.imgur.com/wd1JMK5.jpg"
+ },
+ "33": {
+ "card_meaning": "Loss, regret, disappointment, despair, bereavement",
+ "card_name": "Five of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/five-of-cups/",
+ "card_img": "http://i.imgur.com/8EqDUAa.jpg"
+ },
+ "34": {
+ "card_meaning": "Reunion, nostalgia, childhood memories, innocence",
+ "card_name": "Six of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/six-of-cups/",
+ "card_img": "http://i.imgur.com/pA7oFHJ.jpg"
+ },
+ "35": {
+ "card_meaning": "Fantasy, illusion, wishful thinking, choices, imagination",
+ "card_name": "Seven of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/seven-of-cups/",
+ "card_img": "http://i.imgur.com/NL300h2.jpg"
+ },
+ "36": {
+ "card_meaning": "Escapism, disappointment, abandonment, withdrawal",
+ "card_name": "Eight of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/eight-of-cups/",
+ "card_img": "http://i.imgur.com/MTgZYuZ.jpg"
+ },
+ "37": {
+ "card_meaning": "Wishes fulfilled, comfort, happiness, satisfaction",
+ "card_name": "Nine of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/nine-of-cups/",
+ "card_img": "http://i.imgur.com/FzW2aGy.jpg"
+ },
+ "38": {
+ "card_meaning": "Harmony, marriage, happiness, alignment",
+ "card_name": "Ten of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ten-of-cups/",
+ "card_img": "http://i.imgur.com/bEm3wa8.jpg"
+ },
+ "39": {
+ "card_meaning": "A messenger, creative beginnings, synchronicity",
+ "card_name": "Page of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/page-of-cups/",
+ "card_img": "http://i.imgur.com/UvanQ1x.jpg"
+ },
+ "4": {
+ "card_meaning": "Celebration, harmony, marriage, home, community",
+ "card_name": "Four of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/four-of-wands/",
+ "card_img": "http://i.imgur.com/heelDVY.jpg"
+ },
+ "40": {
+ "card_meaning": "Romance, charm, 'Knight in shining armour', imagination",
+ "card_name": "Knight of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/knight-of-cups/",
+ "card_img": "http://i.imgur.com/SfpE4cm.jpg"
+ },
+ "41": {
+ "card_meaning": "Emotional security, calm, intuitive, compassionate",
+ "card_name": "Queen of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/queen-of-cups/",
+ "card_img": "http://i.imgur.com/ZVMpaO6.jpg"
+ },
+ "42": {
+ "card_meaning": "Emotional balance and control, generosity",
+ "card_name": "King of Cups",
+ "card_url": "http://www.tarotlore.com/tarot-cards/king-of-cups/",
+ "card_img": "http://i.imgur.com/fW2cZDl.jpg"
+ },
+ "43": {
+ "card_meaning": "Manifestation, new financial opportunity, prosperity",
+ "card_name": "Ace of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ace-of-pentacles/",
+ "card_img": "http://i.imgur.com/ebAyNZZ.jpg"
+ },
+ "44": {
+ "card_meaning": "Balance, adaptability, time management, prioritisation",
+ "card_name": "Two of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/two-of-pentacles/",
+ "card_img": "http://i.imgur.com/F3URp9M.jpg"
+ },
+ "45": {
+ "card_meaning": "Teamwork, initial fulfilment, collaboration, learning",
+ "card_name": "Three of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/three-of-pentacles/",
+ "card_img": "http://i.imgur.com/hzIo13n.jpg"
+ },
+ "46": {
+ "card_meaning": "Control, stability, security, possession, conservatism",
+ "card_name": "Four of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/four-of-pentacles/",
+ "card_img": "http://i.imgur.com/caXXbBL.jpg"
+ },
+ "47": {
+ "card_meaning": "Isolation, insecurity, worry, financial loss, poverty",
+ "card_name": "Five of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/five-of-pentacles/",
+ "card_img": "http://i.imgur.com/hIG43wQ.jpg"
+ },
+ "48": {
+ "card_meaning": "Generosity, charity, giving, prosperity, sharing wealth",
+ "card_name": "Six of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/six-of-pentacles/",
+ "card_img": "http://i.imgur.com/NR2JdPf.jpg"
+ },
+ "49": {
+ "card_meaning": "Vision, perseverance, profit, reward, investment",
+ "card_name": "Seven of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/seven-of-pentacles/",
+ "card_img": "http://i.imgur.com/nYYBX2T.jpg"
+ },
+ "5": {
+ "card_meaning": "Disagreement, competition, strife, tension, conflict",
+ "card_name": "Five of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/five-of-wands/",
+ "card_img": "http://i.imgur.com/Qojm2p1.jpg"
+ },
+ "50": {
+ "card_meaning": "Apprenticeship, education, quality, engagement",
+ "card_name": "Eight of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/eight-of-pentacles/",
+ "card_img": "http://i.imgur.com/rSCcjOv.jpg"
+ },
+ "51": {
+ "card_meaning": "Gratitude, luxury, self-sufficiency, culmination",
+ "card_name": "Nine of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/nine-of-pentacles/",
+ "card_img": "http://i.imgur.com/TsHqgIQ.jpg"
+ },
+ "52": {
+ "card_meaning": "Wealth, inheritance, family, establishment, retirement",
+ "card_name": "Ten of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/ten-of-pentacles/",
+ "card_img": "http://i.imgur.com/p8VSgOO.jpg"
+ },
+ "53": {
+ "card_meaning": "Manifestation, financial opportunity, new job",
+ "card_name": "Page of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/page-of-pentacles/",
+ "card_img": "http://i.imgur.com/WsQEzyQ.jpg"
+ },
+ "54": {
+ "card_meaning": "Efficiency, routine, conservatism, methodical",
+ "card_name": "Knight of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/knight-of-pentacles/",
+ "card_img": "http://i.imgur.com/yEL8ZAr.jpg"
+ },
+ "55": {
+ "card_meaning": "Practical, homely, motherly, down-to-earth, security",
+ "card_name": "Queen of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/queen-of-pentacles/",
+ "card_img": "http://i.imgur.com/OX60YCi.jpg"
+ },
+ "56": {
+ "card_meaning": "Security, control, power, discipline, abundance",
+ "card_name": "King of Pentacles",
+ "card_url": "http://www.tarotlore.com/tarot-cards/king-of-pentacles/",
+ "card_img": "http://i.imgur.com/Dk6tR9R.jpg"
+ },
+ "57": {
+ "card_meaning": "Beginnings, innocence, spontaneity, a free spirit",
+ "card_name": "Fool",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-fool/",
+ "card_img": "http://i.imgur.com/vetEoDu.jpg"
+ },
+ "58": {
+ "card_meaning": "Power, skill, concentration, action, resourcefulness",
+ "card_name": "Magician",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-magician/",
+ "card_img": "http://i.imgur.com/9VJLy9S.jpg"
+ },
+ "59": {
+ "card_meaning": "Intuition, Higher powers, mystery, subconscious mind",
+ "card_name": "High Priestess",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-high-priestess/",
+ "card_img": "http://i.imgur.com/bablzG8.jpg"
+ },
+ "6": {
+ "card_meaning": "Public recognition, victory, progress, self-confidence",
+ "card_name": "Six of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/six-of-wands/",
+ "card_img": "http://i.imgur.com/DClClQ5.jpg"
+ },
+ "60": {
+ "card_meaning": "Fertility, femininity, beauty, nature, abundance",
+ "card_name": "Empress",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-empress/",
+ "card_img": "http://i.imgur.com/sh0Fzdt.jpg"
+ },
+ "61": {
+ "card_meaning": "Authority, father-figure, structure, solid foundation",
+ "card_name": "Emperor",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-emperor/",
+ "card_img": "http://i.imgur.com/sc76hNS.jpg"
+ },
+ "62": {
+ "card_meaning": "Religion, group identification, conformity, tradition, beliefs",
+ "card_name": "Hierophant",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-hierophant/",
+ "card_img": "http://i.imgur.com/JFvG1um.jpg"
+ },
+ "63": {
+ "card_meaning": "Love, union, relationships, values alignment, choices",
+ "card_name": "Lovers",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-lovers/",
+ "card_img": "http://i.imgur.com/U6CcViS.jpg"
+ },
+ "64": {
+ "card_meaning": "Control, will power, victory, assertion, determination",
+ "card_name": "Chariot",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-chariot/",
+ "card_img": "http://i.imgur.com/xilfsxU.jpg"
+ },
+ "65": {
+ "card_meaning": "Strength, courage, patience, control, compassion",
+ "card_name": "Strength",
+ "card_url": "http://www.tarotlore.com/tarot-cards/strength/",
+ "card_img": "http://i.imgur.com/DhNmgJ5.jpg"
+ },
+ "66": {
+ "card_meaning": "Soul-searching, introspection, being alone, inner guidance",
+ "card_name": "Hermit",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-hermit/",
+ "card_img": "http://i.imgur.com/yTzCitM.jpg"
+ },
+ "67": {
+ "card_meaning": "Good luck, karma, life cycles, destiny, a turning point",
+ "card_name": "Wheel of Fortune",
+ "card_url": "http://www.tarotlore.com/tarot-cards/wheel-of-fortune/",
+ "card_img": "http://i.imgur.com/jrY1gDP.jpg"
+ },
+ "68": {
+ "card_meaning": "Justice, fairness, truth, cause and effect, law",
+ "card_name": "Justice",
+ "card_url": "http://www.tarotlore.com/tarot-cards/justice/",
+ "card_img": "http://i.imgur.com/eyHEpUR.jpg"
+ },
+ "69": {
+ "card_meaning": "Suspension, restriction, letting go, sacrifice",
+ "card_name": "Hanged Man",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-hanged-man/",
+ "card_img": "http://i.imgur.com/b5Sml3N.jpg"
+ },
+ "7": {
+ "card_meaning": "Challenge, competition, perseverance",
+ "card_name": "Seven of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/seven-of-wands/",
+ "card_img": "http://i.imgur.com/hsNtHC0.jpg"
+ },
+ "70": {
+ "card_meaning": "Endings, beginnings, change, transformation, transition",
+ "card_name": "Death",
+ "card_url": "http://www.tarotlore.com/tarot-cards/death/",
+ "card_img": "http://i.imgur.com/ujauT3a.jpg"
+ },
+ "71": {
+ "card_meaning": "Balance, moderation, patience, purpose, meaning",
+ "card_name": "Temperance",
+ "card_url": "http://www.tarotlore.com/tarot-cards/temperance/",
+ "card_img": "http://i.imgur.com/i2iwvA0.jpg"
+ },
+ "72": {
+ "card_meaning": "Bondage, addiction, sexuality, materialism",
+ "card_name": "Devil",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-devil/",
+ "card_img": "http://i.imgur.com/ChhcGKF.jpg"
+ },
+ "73": {
+ "card_meaning": "Disaster, upheaval, sudden change, revelation",
+ "card_name": "Tower",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-tower/",
+ "card_img": "http://i.imgur.com/ZYpEMKl.jpg"
+ },
+ "74": {
+ "card_meaning": "Hope, spirituality, renewal, inspiration, serenity",
+ "card_name": "Star",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-star/",
+ "card_img": "http://i.imgur.com/2X56bTd.jpg"
+ },
+ "75": {
+ "card_meaning": "Illusion, fear, anxiety, insecurity, subconscious",
+ "card_name": "Moon",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-moon/",
+ "card_img": "http://i.imgur.com/8Cpfekc.jpg"
+ },
+ "76": {
+ "card_meaning": "Fun, warmth, success, positivity, vitality",
+ "card_name": "Sun",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-sun/",
+ "card_img": "http://i.imgur.com/zgJJy7b.jpg"
+ },
+ "77": {
+ "card_meaning": "Judgement, rebirth, inner calling, absolution",
+ "card_name": "Judgement",
+ "card_url": "http://www.tarotlore.com/tarot-cards/judgement/",
+ "card_img": "http://i.imgur.com/JyALFQF.jpg"
+ },
+ "78": {
+ "card_meaning": "Completion, integration, accomplishment, travel",
+ "card_name": "World",
+ "card_url": "http://www.tarotlore.com/tarot-cards/the-world/",
+ "card_img": "http://i.imgur.com/3ZncYkn.jpg"
+ },
+ "8": {
+ "card_meaning": "Speed, action, air travel, movement, swift change",
+ "card_name": "Eight of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/eight-of-wands/",
+ "card_img": "http://i.imgur.com/TaTYcNt.jpg"
+ },
+ "9": {
+ "card_meaning": "Courage, persistence, test of faith, resilience",
+ "card_name": "Nine of Wands",
+ "card_url": "http://www.tarotlore.com/tarot-cards/nine-of-wands/",
+ "card_img": "http://i.imgur.com/qjJdi8J.jpg"
+ }
+}
diff --git a/tarot/tarotreading.py b/tarot/tarotreading.py
new file mode 100644
index 0000000..493bbe9
--- /dev/null
+++ b/tarot/tarotreading.py
@@ -0,0 +1,105 @@
+import discord
+from redbot.core import commands
+from . import tarot_cards
+import aiohttp
+import json
+import random
+from random import sample
+from random import choice
+import time
+
+
+class TarotReading(getattr(commands, "Cog", object)):
+ """
+ Post information about tarot cards and readings
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.tarot_cards = tarot_cards.card_list
+
+
+ def get_colour(self):
+ colour =''.join([choice('0123456789ABCDEF')for x in range(6)])
+ return int(colour, 16)
+
+ @commands.group(pass_context=True)
+ async def tarot(self, ctx):
+ pass
+
+ @tarot.command(name="life", pass_context=True)
+ async def _life(self, ctx, user: discord.Member=None):
+ """Unique reading based on your discord user ID. Doesn't change."""
+ card_meaning = ["Past", "Present", "Future", "Potential", "Reason"]
+ if user is None:
+ user = ctx.message.author
+ userseed = user.id
+
+ random.seed(int(userseed))
+ cards = []
+ cards = sample((range(1, 78)), 5)
+
+ embed = discord.Embed(title="Tarot reading for {}".format(user.display_name),
+ colour=discord.Colour(value=self.get_colour()))
+ embed.set_thumbnail(url=self.tarot_cards[str(cards[-1])]["card_img"])
+ embed.timestamp = ctx.message.created_at
+ embed.set_author(name=user.name, icon_url=user.avatar_url)
+ number = 0
+ for card in cards:
+ embed.add_field(name="{0}: {1}".format(card_meaning[number], self.tarot_cards[str(card)]["card_name"]),
+ value=self.tarot_cards[str(card)]["card_meaning"])
+ number += 1
+ await ctx.send(embed=embed)
+
+ @tarot.command(name="reading", pass_context=True)
+ async def _reading(self, ctx, user: discord.Member=None):
+ """Unique reading as of this very moment."""
+ card_meaning = ["Past", "Present", "Future", "Potential", "Reason"]
+ if user is None:
+ user = ctx.message.author
+
+ cards = []
+ cards = sample((range(1, 78)), 5)
+
+ embed = discord.Embed(title="Tarot reading for {}".format(user.display_name),
+ colour=discord.Colour(value=self.get_colour()))
+ embed.set_thumbnail(url=self.tarot_cards[str(cards[-1])]["card_img"])
+ embed.timestamp = ctx.message.created_at
+ embed.set_author(name=user.name, icon_url=user.avatar_url)
+ number = 0
+ for card in cards:
+ embed.add_field(name="{0}: {1}".format(card_meaning[number], self.tarot_cards[str(card)]["card_name"]),
+ value=self.tarot_cards[str(card)]["card_meaning"])
+ number += 1
+ await ctx.send(embed=embed)
+
+
+ @tarot.command(name="card", pass_context=True)
+ async def _card(self, ctx, *, msg=None):
+ """Random card or choose a card based on number or name."""
+ user = ctx.message.author
+ # msg = message.content
+ card = None
+
+ if msg is None:
+ card = self.tarot_cards[str(random.randint(1, 78))]
+
+ elif msg.isdigit() and int(msg) > 0 and int(msg) < 79:
+ card = self.tarot_cards[str(msg)]
+
+ elif not msg.isdigit():
+ for cards in self.tarot_cards:
+ if msg.lower() in self.tarot_cards[cards]["card_name"].lower():
+ card = self.tarot_cards[cards]
+ if card is None:
+ await self.bot.say("That card does not exist!")
+ return
+
+ embed = discord.Embed(title=card["card_name"],
+ description=card["card_meaning"],
+ colour=discord.Colour(value=self.get_colour()),
+ url=card["card_url"])
+ embed.timestamp = ctx.message.created_at
+ embed.set_author(name=user.name, icon_url=user.avatar_url)
+ embed.set_image(url=card["card_img"])
+ await ctx.send(embed=embed)
diff --git a/translate/__init__.py b/translate/__init__.py
new file mode 100644
index 0000000..4229c29
--- /dev/null
+++ b/translate/__init__.py
@@ -0,0 +1,7 @@
+from .translate import Translate
+# from redbot.core import data_manager
+
+def setup(bot):
+ n = Translate(bot)
+ # data_manager.load_bundled_data(n, __file__)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/translate/flags.py b/translate/flags.py
new file mode 100644
index 0000000..fa4ba28
--- /dev/null
+++ b/translate/flags.py
@@ -0,0 +1 @@
+FLAGS={'🇦🇩': {'code': 'ca', 'country': 'Andorra', 'name': 'Catalan'}, '🇦🇪': {'code': 'ar', 'country': 'United Arab Emirates', 'name': 'Arabic'}, '🇦🇫': {'code': 'ps', 'country': 'Afghanistan', 'name': 'Pashto'}, '🇦🇬': {'code': 'en', 'country': 'Antigua and Barbuda', 'name': 'English'}, '🇦🇮': {'code': 'en', 'country': 'Anguilla', 'name': 'English'}, '🇦🇱': {'code': 'sq', 'country': 'Albania', 'name': 'Albanian'}, '🇦🇲': {'code': 'hy', 'country': 'Armenia', 'name': 'Armenian'}, '🇦🇴': {'code': 'pt', 'country': 'Angola', 'name': 'Portuguese'}, '🇦🇶': {'code': 'en', 'country': 'Antarctica', 'name': 'English'}, '🇦🇷': {'code': 'es', 'country': 'Argentina', 'name': 'Spanish'}, '🇦🇸': {'code': 'en', 'country': 'American Samoa', 'name': 'English'}, '🇦🇹': {'code': 'de', 'country': 'Austria', 'name': 'German'}, '🇦🇺': {'code': 'en', 'country': 'Australia', 'name': 'English'}, '🇦🇼': {'code': 'nl', 'country': 'Aruba', 'name': 'Dutch'}, '🇦🇽': {'code': 'sv', 'country': 'Åland Islands', 'name': 'Swedish'}, '🇦🇿': {'code': 'az', 'country': 'Azerbaijan', 'name': 'Azerbaijani'}, '🇧🇦': {'code': 'bs', 'country': 'Bosnia and Herzegovina', 'name': 'Bosnian'}, '🇧🇧': {'code': 'en', 'country': 'Barbados', 'name': 'English'}, '🇧🇩': {'code': 'bn', 'country': 'Bangladesh', 'name': 'Bengali'}, '🇧🇪': {'code': 'nl', 'country': 'Belgium', 'name': 'Dutch'}, '🇧🇫': {'code': 'fr', 'country': 'Burkina Faso', 'name': 'French'}, '🇧🇬': {'code': 'bg', 'country': 'Bulgaria', 'name': 'Bulgarian'}, '🇧🇭': {'code': 'ar', 'country': 'Bahrain', 'name': 'Arabic'}, '🇧🇮': {'code': 'fr', 'country': 'Burundi', 'name': 'French'}, '🇧🇯': {'code': 'fr', 'country': 'Benin', 'name': 'French'}, '🇧🇱': {'code': 'fr', 'country': 'Saint Barthélemy', 'name': 'French'}, '🇧🇲': {'code': 'en', 'country': 'Bermuda', 'name': 'English'}, '🇧🇳': {'code': 'ms', 'country': 'Brunei Darussalam', 'name': 'Malay'}, '🇧🇴': {'code': 'es', 'country': 'Bolivia (Plurinational State of)', 'name': 'Spanish'}, '🇧🇶': {'code': 'nl', 'country': 'Bonaire, Sint Eustatius and Saba', 'name': 'Dutch'}, '🇧🇷': {'code': 'pt', 'country': 'Brazil', 'name': 'Portuguese'}, '🇧🇸': {'code': 'en', 'country': 'Bahamas', 'name': 'English'}, '🇧🇹': {'code': 'dz', 'country': 'Bhutan', 'name': 'Dzongkha'}, '🇧🇻': {'code': 'no', 'country': 'Bouvet Island', 'name': 'Norwegian'}, '🇧🇼': {'code': 'en', 'country': 'Botswana', 'name': 'English'}, '🇧🇾': {'code': 'be', 'country': 'Belarus', 'name': 'Belarusian'}, '🇧🇿': {'code': 'en', 'country': 'Belize', 'name': 'English'}, '🇨🇦': {'code': 'en', 'country': 'Canada', 'name': 'English'}, '🇨🇨': {'code': 'en', 'country': 'Cocos (Keeling) Islands', 'name': 'English'}, '🇨🇩': {'code': 'fr', 'country': 'Congo (Democratic Republic of the)', 'name': 'French'}, '🇨🇫': {'code': 'fr', 'country': 'Central African Republic', 'name': 'French'}, '🇨🇬': {'code': 'fr', 'country': 'Congo', 'name': 'French'}, '🇨🇭': {'code': 'de', 'country': 'Switzerland', 'name': 'German'}, '🇨🇮': {'code': 'fr', 'country': "Côte d'Ivoire", 'name': 'French'}, '🇨🇰': {'code': 'en', 'country': 'Cook Islands', 'name': 'English'}, '🇨🇱': {'code': 'es', 'country': 'Chile', 'name': 'Spanish'}, '🇨🇲': {'code': 'en', 'country': 'Cameroon', 'name': 'English'}, '🇨🇳': {'code': 'zh', 'country': 'China', 'name': 'Chinese'}, '🇨🇴': {'code': 'es', 'country': 'Colombia', 'name': 'Spanish'}, '🇨🇷': {'code': 'es', 'country': 'Costa Rica', 'name': 'Spanish'}, '🇨🇺': {'code': 'es', 'country': 'Cuba', 'name': 'Spanish'}, '🇨🇻': {'code': 'pt', 'country': 'Cabo Verde', 'name': 'Portuguese'}, '🇨🇼': {'code': 'nl', 'country': 'Curaçao', 'name': 'Dutch'}, '🇨🇽': {'code': 'en', 'country': 'Christmas Island', 'name': 'English'}, '🇨🇾': {'code': 'el', 'country': 'Cyprus', 'name': 'Greek (modern)'}, '🇨🇿': {'code': 'cs', 'country': 'Czech Republic', 'name': 'Czech'}, '🇩🇪': {'code': 'de', 'country': 'Germany', 'name': 'German'}, '🇩🇯': {'code': 'fr', 'country': 'Djibouti', 'name': 'French'}, '🇩🇰': {'code': 'da', 'country': 'Denmark', 'name': 'Danish'}, '🇩🇲': {'code': 'en', 'country': 'Dominica', 'name': 'English'}, '🇩🇴': {'code': 'es', 'country': 'Dominican Republic', 'name': 'Spanish'}, '🇩🇿': {'code': 'ar', 'country': 'Algeria', 'name': 'Arabic'}, '🇪🇨': {'code': 'es', 'country': 'Ecuador', 'name': 'Spanish'}, '🇪🇪': {'code': 'et', 'country': 'Estonia', 'name': 'Estonian'}, '🇪🇬': {'code': 'ar', 'country': 'Egypt', 'name': 'Arabic'}, '🇪🇭': {'code': 'es', 'country': 'Western Sahara', 'name': 'Spanish'}, '🇪🇷': {'code': 'ti', 'country': 'Eritrea', 'name': 'Tigrinya'}, '🇪🇸': {'code': 'es', 'country': 'Spain', 'name': 'Spanish'}, '🇪🇹': {'code': 'am', 'country': 'Ethiopia', 'name': 'Amharic'}, '🇪🇺': {'code': 'EU', 'emoji': '🇪🇺', 'message': 'Not Found', 'name': 'European Union', 'status': 404, 'title': 'flag for European Union', 'unicode': 'U+1F1EA U+1F1FA', 'country': 'N/A'}, '🇫🇮': {'code': 'fi', 'country': 'Finland', 'name': 'Finnish'}, '🇫🇯': {'code': 'en', 'country': 'Fiji', 'name': 'English'}, '🇫🇰': {'code': 'en', 'country': 'Falkland Islands (Malvinas)', 'name': 'English'}, '🇫🇲': {'code': 'en', 'country': 'Micronesia (Federated States of)', 'name': 'English'}, '🇫🇴': {'code': 'fo', 'country': 'Faroe Islands', 'name': 'Faroese'}, '🇫🇷': {'code': 'fr', 'country': 'France', 'name': 'French'}, '🇬🇦': {'code': 'fr', 'country': 'Gabon', 'name': 'French'}, '🇬🇧': {'code': 'en', 'country': 'United Kingdom of Great Britain and Northern Ireland', 'name': 'English'}, '🇬🇩': {'code': 'en', 'country': 'Grenada', 'name': 'English'}, '🇬🇪': {'code': 'ka', 'country': 'Georgia', 'name': 'Georgian'}, '🇬🇫': {'code': 'fr', 'country': 'French Guiana', 'name': 'French'}, '🇬🇬': {'code': 'en', 'country': 'Guernsey', 'name': 'English'}, '🇬🇭': {'code': 'en', 'country': 'Ghana', 'name': 'English'}, '🇬🇮': {'code': 'en', 'country': 'Gibraltar', 'name': 'English'}, '🇬🇱': {'code': 'kl', 'country': 'Greenland', 'name': 'Kalaallisut'}, '🇬🇲': {'code': 'en', 'country': 'Gambia', 'name': 'English'}, '🇬🇳': {'code': 'fr', 'country': 'Guinea', 'name': 'French'}, '🇬🇵': {'code': 'fr', 'country': 'Guadeloupe', 'name': 'French'}, '🇬🇶': {'code': 'es', 'country': 'Equatorial Guinea', 'name': 'Spanish'}, '🇬🇷': {'code': 'el', 'country': 'Greece', 'name': 'Greek (modern)'}, '🇬🇸': {'code': 'en', 'country': 'South Georgia and the South Sandwich Islands', 'name': 'English'}, '🇬🇹': {'code': 'es', 'country': 'Guatemala', 'name': 'Spanish'}, '🇬🇺': {'code': 'en', 'country': 'Guam', 'name': 'English'}, '🇬🇼': {'code': 'pt', 'country': 'Guinea-Bissau', 'name': 'Portuguese'}, '🇬🇾': {'code': 'en', 'country': 'Guyana', 'name': 'English'}, '🇭🇰': {'code': 'en', 'country': 'Hong Kong', 'name': 'English'}, '🇭🇲': {'code': 'en', 'country': 'Heard Island and McDonald Islands', 'name': 'English'}, '🇭🇳': {'code': 'es', 'country': 'Honduras', 'name': 'Spanish'}, '🇭🇷': {'code': 'hr', 'country': 'Croatia', 'name': 'Croatian'}, '🇭🇹': {'code': 'fr', 'country': 'Haiti', 'name': 'French'}, '🇭🇺': {'code': 'hu', 'country': 'Hungary', 'name': 'Hungarian'}, '🇮🇩': {'code': 'id', 'country': 'Indonesia', 'name': 'Indonesian'}, '🇮🇪': {'code': 'ga', 'country': 'Ireland', 'name': 'Irish'}, '🇮🇱': {'code': 'he', 'country': 'Israel', 'name': 'Hebrew (modern)'}, '🇮🇲': {'code': 'en', 'country': 'Isle of Man', 'name': 'English'}, '🇮🇳': {'code': 'hi', 'country': 'India', 'name': 'Hindi'}, '🇮🇴': {'code': 'en', 'country': 'British Indian Ocean Territory', 'name': 'English'}, '🇮🇶': {'code': 'ar', 'country': 'Iraq', 'name': 'Arabic'}, '🇮🇷': {'code': 'fa', 'country': 'Iran (Islamic Republic of)', 'name': 'Persian (Farsi)'}, '🇮🇸': {'code': 'is', 'country': 'Iceland', 'name': 'Icelandic'}, '🇮🇹': {'code': 'it', 'country': 'Italy', 'name': 'Italian'}, '🇯🇪': {'code': 'en', 'country': 'Jersey', 'name': 'English'}, '🇯🇲': {'code': 'en', 'country': 'Jamaica', 'name': 'English'}, '🇯🇴': {'code': 'ar', 'country': 'Jordan', 'name': 'Arabic'}, '🇯🇵': {'code': 'ja', 'country': 'Japan', 'name': 'Japanese'}, '🇰🇪': {'code': 'en', 'country': 'Kenya', 'name': 'English'}, '🇰🇬': {'code': 'ky', 'country': 'Kyrgyzstan', 'name': 'Kyrgyz'}, '🇰🇭': {'code': 'km', 'country': 'Cambodia', 'name': 'Khmer'}, '🇰🇮': {'code': 'en', 'country': 'Kiribati', 'name': 'English'}, '🇰🇲': {'code': 'ar', 'country': 'Comoros', 'name': 'Arabic'}, '🇰🇳': {'code': 'en', 'country': 'Saint Kitts and Nevis', 'name': 'English'}, '🇰🇵': {'code': 'ko', 'country': "Korea (Democratic People's Republic of)", 'name': 'Korean'}, '🇰🇷': {'code': 'ko', 'country': 'Korea (Republic of)', 'name': 'Korean'}, '🇰🇼': {'code': 'ar', 'country': 'Kuwait', 'name': 'Arabic'}, '🇰🇾': {'code': 'en', 'country': 'Cayman Islands', 'name': 'English'}, '🇰🇿': {'code': 'kk', 'country': 'Kazakhstan', 'name': 'Kazakh'}, '🇱🇦': {'code': 'lo', 'country': "Lao People's Democratic Republic", 'name': 'Lao'}, '🇱🇧': {'code': 'ar', 'country': 'Lebanon', 'name': 'Arabic'}, '🇱🇨': {'code': 'en', 'country': 'Saint Lucia', 'name': 'English'}, '🇱🇮': {'code': 'de', 'country': 'Liechtenstein', 'name': 'German'}, '🇱🇰': {'code': 'si', 'country': 'Sri Lanka', 'name': 'Sinhalese'}, '🇱🇷': {'code': 'en', 'country': 'Liberia', 'name': 'English'}, '🇱🇸': {'code': 'en', 'country': 'Lesotho', 'name': 'English'}, '🇱🇹': {'code': 'lt', 'country': 'Lithuania', 'name': 'Lithuanian'}, '🇱🇺': {'code': 'fr', 'country': 'Luxembourg', 'name': 'French'}, '🇱🇻': {'code': 'lv', 'country': 'Latvia', 'name': 'Latvian'}, '🇱🇾': {'code': 'ar', 'country': 'Libya', 'name': 'Arabic'}, '🇲🇦': {'code': 'ar', 'country': 'Morocco', 'name': 'Arabic'}, '🇲🇨': {'code': 'fr', 'country': 'Monaco', 'name': 'French'}, '🇲🇩': {'code': 'ro', 'country': 'Moldova (Republic of)', 'name': 'Romanian'}, '🇲🇪': {'code': 'sr', 'country': 'Montenegro', 'name': 'Serbian'}, '🇲🇫': {'code': 'en', 'country': 'Saint Martin (French part)', 'name': 'English'}, '🇲🇬': {'code': 'fr', 'country': 'Madagascar', 'name': 'French'}, '🇲🇭': {'code': 'en', 'country': 'Marshall Islands', 'name': 'English'}, '🇲🇰': {'code': 'mk', 'country': 'Macedonia (the former Yugoslav Republic of)', 'name': 'Macedonian'}, '🇲🇱': {'code': 'fr', 'country': 'Mali', 'name': 'French'}, '🇲🇲': {'code': 'my', 'country': 'Myanmar', 'name': 'Burmese'}, '🇲🇳': {'code': 'mn', 'country': 'Mongolia', 'name': 'Mongolian'}, '🇲🇴': {'code': 'zh', 'country': 'Macao', 'name': 'Chinese'}, '🇲🇵': {'code': 'en', 'country': 'Northern Mariana Islands', 'name': 'English'}, '🇲🇶': {'code': 'fr', 'country': 'Martinique', 'name': 'French'}, '🇲🇷': {'code': 'ar', 'country': 'Mauritania', 'name': 'Arabic'}, '🇲🇸': {'code': 'en', 'country': 'Montserrat', 'name': 'English'}, '🇲🇹': {'code': 'mt', 'country': 'Malta', 'name': 'Maltese'}, '🇲🇺': {'code': 'en', 'country': 'Mauritius', 'name': 'English'}, '🇲🇻': {'code': 'dv', 'country': 'Maldives', 'name': 'Divehi'}, '🇲🇼': {'code': 'en', 'country': 'Malawi', 'name': 'English'}, '🇲🇽': {'code': 'es', 'country': 'Mexico', 'name': 'Spanish'}, '🇲🇾': {'code': None, 'country': 'Malaysia', 'name': 'Malaysian'}, '🇲🇿': {'code': 'pt', 'country': 'Mozambique', 'name': 'Portuguese'}, '🇳🇦': {'code': 'en', 'country': 'Namibia', 'name': 'English'}, '🇳🇨': {'code': 'fr', 'country': 'New Caledonia', 'name': 'French'}, '🇳🇪': {'code': 'fr', 'country': 'Niger', 'name': 'French'}, '🇳🇫': {'code': 'en', 'country': 'Norfolk Island', 'name': 'English'}, '🇳🇬': {'code': 'en', 'country': 'Nigeria', 'name': 'English'}, '🇳🇮': {'code': 'es', 'country': 'Nicaragua', 'name': 'Spanish'}, '🇳🇱': {'code': 'nl', 'country': 'Netherlands', 'name': 'Dutch'}, '🇳🇴': {'code': 'no', 'country': 'Norway', 'name': 'Norwegian'}, '🇳🇵': {'code': 'ne', 'country': 'Nepal', 'name': 'Nepali'}, '🇳🇷': {'code': 'en', 'country': 'Nauru', 'name': 'English'}, '🇳🇺': {'code': 'en', 'country': 'Niue', 'name': 'English'}, '🇳🇿': {'code': 'en', 'country': 'New Zealand', 'name': 'English'}, '🇴🇲': {'code': 'ar', 'country': 'Oman', 'name': 'Arabic'}, '🇵🇦': {'code': 'es', 'country': 'Panama', 'name': 'Spanish'}, '🇵🇪': {'code': 'es', 'country': 'Peru', 'name': 'Spanish'}, '🇵🇫': {'code': 'fr', 'country': 'French Polynesia', 'name': 'French'}, '🇵🇬': {'code': 'en', 'country': 'Papua New Guinea', 'name': 'English'}, '🇵🇭': {'code': 'en', 'country': 'Philippines', 'name': 'English'}, '🇵🇰': {'code': 'en', 'country': 'Pakistan', 'name': 'English'}, '🇵🇱': {'code': 'pl', 'country': 'Poland', 'name': 'Polish'}, '🇵🇲': {'code': 'fr', 'country': 'Saint Pierre and Miquelon', 'name': 'French'}, '🇵🇳': {'code': 'en', 'country': 'Pitcairn', 'name': 'English'}, '🇵🇷': {'code': 'es', 'country': 'Puerto Rico', 'name': 'Spanish'}, '🇵🇸': {'code': 'ar', 'country': 'Palestine, State of', 'name': 'Arabic'}, '🇵🇹': {'code': 'pt', 'country': 'Portugal', 'name': 'Portuguese'}, '🇵🇼': {'code': 'en', 'country': 'Palau', 'name': 'English'}, '🇵🇾': {'code': 'es', 'country': 'Paraguay', 'name': 'Spanish'}, '🇶🇦': {'code': 'ar', 'country': 'Qatar', 'name': 'Arabic'}, '🇷🇪': {'code': 'fr', 'country': 'Réunion', 'name': 'French'}, '🇷🇴': {'code': 'ro', 'country': 'Romania', 'name': 'Romanian'}, '🇷🇸': {'code': 'sr', 'country': 'Serbia', 'name': 'Serbian'}, '🇷🇺': {'code': 'ru', 'country': 'Russian Federation', 'name': 'Russian'}, '🇷🇼': {'code': 'rw', 'country': 'Rwanda', 'name': 'Kinyarwanda'}, '🇸🇦': {'code': 'ar', 'country': 'Saudi Arabia', 'name': 'Arabic'}, '🇸🇧': {'code': 'en', 'country': 'Solomon Islands', 'name': 'English'}, '🇸🇨': {'code': 'fr', 'country': 'Seychelles', 'name': 'French'}, '🇸🇩': {'code': 'ar', 'country': 'Sudan', 'name': 'Arabic'}, '🇸🇪': {'code': 'sv', 'country': 'Sweden', 'name': 'Swedish'}, '🇸🇬': {'code': 'en', 'country': 'Singapore', 'name': 'English'}, '🇸🇭': {'code': 'en', 'country': 'Saint Helena, Ascension and Tristan da Cunha', 'name': 'English'}, '🇸🇮': {'code': 'sl', 'country': 'Slovenia', 'name': 'Slovene'}, '🇸🇯': {'code': 'no', 'country': 'Svalbard and Jan Mayen', 'name': 'Norwegian'}, '🇸🇰': {'code': 'sk', 'country': 'Slovakia', 'name': 'Slovak'}, '🇸🇱': {'code': 'en', 'country': 'Sierra Leone', 'name': 'English'}, '🇸🇲': {'code': 'it', 'country': 'San Marino', 'name': 'Italian'}, '🇸🇳': {'code': 'fr', 'country': 'Senegal', 'name': 'French'}, '🇸🇴': {'code': 'so', 'country': 'Somalia', 'name': 'Somali'}, '🇸🇷': {'code': 'nl', 'country': 'Suriname', 'name': 'Dutch'}, '🇸🇸': {'code': 'en', 'country': 'South Sudan', 'name': 'English'}, '🇸🇹': {'code': 'pt', 'country': 'Sao Tome and Principe', 'name': 'Portuguese'}, '🇸🇻': {'code': 'es', 'country': 'El Salvador', 'name': 'Spanish'}, '🇸🇽': {'code': 'nl', 'country': 'Sint Maarten (Dutch part)', 'name': 'Dutch'}, '🇸🇾': {'code': 'ar', 'country': 'Syrian Arab Republic', 'name': 'Arabic'}, '🇸🇿': {'code': 'en', 'country': 'Swaziland', 'name': 'English'}, '🇹🇨': {'code': 'en', 'country': 'Turks and Caicos Islands', 'name': 'English'}, '🇹🇩': {'code': 'fr', 'country': 'Chad', 'name': 'French'}, '🇹🇫': {'code': 'fr', 'country': 'French Southern Territories', 'name': 'French'}, '🇹🇬': {'code': 'fr', 'country': 'Togo', 'name': 'French'}, '🇹🇭': {'code': 'th', 'country': 'Thailand', 'name': 'Thai'}, '🇹🇯': {'code': 'tg', 'country': 'Tajikistan', 'name': 'Tajik'}, '🇹🇰': {'code': 'en', 'country': 'Tokelau', 'name': 'English'}, '🇹🇱': {'code': 'pt', 'country': 'Timor-Leste', 'name': 'Portuguese'}, '🇹🇲': {'code': 'tk', 'country': 'Turkmenistan', 'name': 'Turkmen'}, '🇹🇳': {'code': 'ar', 'country': 'Tunisia', 'name': 'Arabic'}, '🇹🇴': {'code': 'en', 'country': 'Tonga', 'name': 'English'}, '🇹🇷': {'code': 'tr', 'country': 'Turkey', 'name': 'Turkish'}, '🇹🇹': {'code': 'en', 'country': 'Trinidad and Tobago', 'name': 'English'}, '🇹🇻': {'code': 'en', 'country': 'Tuvalu', 'name': 'English'}, '🇹🇼': {'code': 'zh', 'country': 'Taiwan', 'name': 'Chinese'}, '🇹🇿': {'code': 'sw', 'country': 'Tanzania, United Republic of', 'name': 'Swahili'}, '🇺🇦': {'code': 'uk', 'country': 'Ukraine', 'name': 'Ukrainian'}, '🇺🇬': {'code': 'en', 'country': 'Uganda', 'name': 'English'}, '🇺🇲': {'code': 'en', 'country': 'United States Minor Outlying Islands', 'name': 'English'}, '🇺🇸': {'code': 'en', 'country': 'United States of America', 'name': 'English'}, '🇺🇾': {'code': 'es', 'country': 'Uruguay', 'name': 'Spanish'}, '🇺🇿': {'code': 'uz', 'country': 'Uzbekistan', 'name': 'Uzbek'}, '🇻🇦': {'code': 'la', 'country': 'Holy See', 'name': 'Latin'}, '🇻🇨': {'code': 'en', 'country': 'Saint Vincent and the Grenadines', 'name': 'English'}, '🇻🇪': {'code': 'es', 'country': 'Venezuela (Bolivarian Republic of)', 'name': 'Spanish'}, '🇻🇬': {'code': 'en', 'country': 'Virgin Islands (British)', 'name': 'English'}, '🇻🇮': {'code': 'en', 'country': 'Virgin Islands (U.S.)', 'name': 'English'}, '🇻🇳': {'code': 'vi', 'country': 'Viet Nam', 'name': 'Vietnamese'}, '🇻🇺': {'code': 'bi', 'country': 'Vanuatu', 'name': 'Bislama'}, '🇼🇫': {'code': 'fr', 'country': 'Wallis and Futuna', 'name': 'French'}, '🇼🇸': {'code': 'sm', 'country': 'Samoa', 'name': 'Samoan'}, '🇾🇪': {'code': 'ar', 'country': 'Yemen', 'name': 'Arabic'}, '🇾🇹': {'code': 'fr', 'country': 'Mayotte', 'name': 'French'}, '🇿🇦': {'code': 'af', 'country': 'South Africa', 'name': 'Afrikaans'}, '🇿🇲': {'code': 'en', 'country': 'Zambia', 'name': 'English'}, '🇿🇼': {'code': 'en', 'country': 'Zimbabwe', 'name': 'English'}}
\ No newline at end of file
diff --git a/translate/info.json b/translate/info.json
new file mode 100644
index 0000000..972a711
--- /dev/null
+++ b/translate/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "Aziz",
+ "TrustyJAID"
+ ],
+ "description":"Set a server to post translated messages when a flag emoji has been reacted to the message or translate any text!",
+ "install_msg":"You must get an API key from google to set this up https://cloud.google.com/translate/?utm_source=google&utm_medium=cpc&utm_campaign=na-US-all-en-dr-bkws-all-all-trial-e-dr-1003905&utm_content=text-ad-none-any-DEV_c-CRE_164195398490-ADGP_Hybrid%20%7C%20AW%20SEM%20%7C%20BKWS%20%7C%20Multi%20~%20Translate%20API-KWID_43700006524936780-kwd-14329410560&utm_term=KW_google%20translate%20api-ST_google%20translate%20api&gclid=EAIaIQobChMIqYX17-DY2AIVDMZkCh0VuAJPEAAYASAAEgLD9vD_BwE&dclid=CJLr_PDg2NgCFc_YwAodD3QAMA",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"translate",
+ "permissions":[],
+ "requirements":[],
+ "short":"Translate messages using google translate!",
+ "tags":[
+ "utility",
+ "translation",
+ "translate"
+ ]
+}
\ No newline at end of file
diff --git a/translate/translate.py b/translate/translate.py
new file mode 100644
index 0000000..5eb29c8
--- /dev/null
+++ b/translate/translate.py
@@ -0,0 +1,171 @@
+import aiohttp
+import discord
+from redbot.core import commands
+from redbot.core import Config
+from redbot.core import checks
+from redbot.core.data_manager import bundled_data_path
+import json
+from .flags import FLAGS
+
+"""
+Translator cog
+
+Cog credit to aziz#5919 for the idea and
+
+Links
+
+Wiki https://goo.gl/3fxjSA
+Github https://goo.gl/oQAQde
+Support the developer https://goo.gl/Brchj4
+Invite the bot to your guild https://goo.gl/aQm2G7
+Join the official development guild https://discord.gg/uekTNPj
+"""
+
+
+class Translate(getattr(commands, "Cog", object)):
+ """
+ Translate messages using google translate
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.url = "https://translation.googleapis.com"
+ self.config = Config.get_conf(self, 156434873547)
+ default_guild = {"enabled":False}
+ default = {"api_key":None}
+ self.config.register_guild(**default_guild)
+ self.config.register_global(**default)
+
+ @commands.command(pass_context=True)
+ async def translate(self, ctx, to_language, *, message):
+ """
+ Translate messages with google translate
+ """
+
+ if await self.config.api_key() is None:
+ await ctx.send("The bot owner needs to set an api key first!")
+ return
+ if to_language in FLAGS:
+ language_code = FLAGS[to_language]["code"]
+ else:
+ try:
+ language_code = [FLAGS[lang]["code"] for lang in FLAGS if (FLAGS[lang]["name"].lower() in to_language.lower()) or (FLAGS[lang]["country"].lower() in to_language.lower())][0]
+ except IndexError:
+ await ctx.send("{} is not an available language!".format(to_language))
+ return
+
+ original_lang = await self.detect_language(message)
+ from_lang = original_lang[0][0]["language"].upper()
+ to_lang = language_code.upper()
+ translated_text = await self.translate_text(original_lang[0][0]["language"], language_code, message)
+ author = ctx.message.author
+ user_name = f"{author.name}#{author.discriminator}"
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = discord.Embed(colour=author.top_role.colour, description=translated_text)
+ em.set_author(name=author.display_name, icon_url=author.avatar_url)
+ em.set_footer(text=f"{from_lang} to {to_language} Requested by {user_name}")
+ await ctx.send(embed=em)
+ else:
+ await ctx.send(translated_text)
+
+ async def detect_language(self, text):
+ """
+ Detect the language from given text
+ """
+ async with self.session.get(self.url + "/language/translate/v2/detect", params={"q":text, "key":await self.config.api_key()}) as resp:
+ data = await resp.json()
+ return data["data"]["detections"]
+
+
+ async def translate_text(self, from_lang, target, text):
+ """
+ request to translate the text
+ """
+ formatting = "text"
+ params = {"q":text, "target":target,"key":await self.config.api_key(), "format":formatting, "source":from_lang}
+ try:
+ async with self.session.get(self.url + "/language/translate/v2", params=params) as resp:
+ data = await resp.json()
+ except:
+ return None
+ if "data" in data:
+ translated_text = data["data"]["translations"][0]["translatedText"]
+ return translated_text
+
+ @commands.command(pass_context=True)
+ @checks.mod_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def translatereact(self, ctx):
+ """
+ Have the bot translate messages when
+ a flag is reacted to the message
+ """
+ guild = ctx.message.guild
+ if not await self.config.guild(guild).enabled():
+ await self.config.guild(guild).enabled.set(True)
+ await ctx.send("{} has been added to post translated responses!".format(guild.name))
+ elif await self.config.guild(guild).enabled():
+ await self.config.guild(guild).enabled.set(False)
+ await ctx.send("{} has been removed from translated responses!".format(guild.name))
+
+ async def on_raw_reaction_add(self, payload):
+ """
+ Translates the message based off reactions
+ with country flags
+ """
+ channel = self.bot.get_channel(id=payload.channel_id)
+ try:
+ guild = channel.guild
+ message = await channel.get_message(id=payload.message_id)
+ except:
+ return
+ if await self.config.api_key() is None:
+ return
+ # check_emoji = lambda emoji: emoji in FLAGS
+ if str(payload.emoji) not in FLAGS:
+ return
+ if not await self.config.guild(guild).enabled():
+ return
+ if message.embeds != []:
+ to_translate = message.embeds[0].description
+ else:
+ to_translate = message.clean_content
+ num_emojis = 0
+ for reaction in message.reactions:
+ if reaction.emoji == str(payload.emoji):
+ num_emojis = reaction.count
+ if num_emojis > 1:
+ return
+ user = self.bot.get_user(payload.user_id)
+ user_name = f"{user.name}#{user.discriminator}"
+ target = FLAGS[str(payload.emoji)]["code"]
+ original_lang = await self.detect_language(to_translate)
+ translated_text = await self.translate_text(original_lang[0][0]["language"], target, to_translate)
+ author = message.author
+ em = discord.Embed(colour=author.top_role.colour, description=translated_text)
+ em.set_author(name=author.display_name, icon_url=author.avatar_url)
+ from_lang = original_lang[0][0]["language"].upper()
+ to_lang = target.upper()
+ if from_lang == to_lang:
+ # don't post anything if the detected language is the same
+ return
+ em.set_footer(text=f"{from_lang} to {to_lang} Requested by {user_name}")
+ if channel.permissions_for(guild.me).embed_links:
+ await channel.send(embed=em)
+ else:
+ msg = f"{from_lang} to {to_lang} Requested by {user_name}\n{translated_text}"
+
+ @commands.command(pass_context=True)
+ @checks.is_owner()
+ async def translateset(self, ctx, api_key):
+ """
+ You must get an API key from google to set this up
+
+ https://console.cloud.google.com/apis/library/translate.googleapis.com/
+ """
+ await self.config.api_key.set(api_key)
+ await ctx.send("API key set.")
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/trusty-cogs.sublime-project b/trusty-cogs.sublime-project
new file mode 100644
index 0000000..24db303
--- /dev/null
+++ b/trusty-cogs.sublime-project
@@ -0,0 +1,8 @@
+{
+ "folders":
+ [
+ {
+ "path": "."
+ }
+ ]
+}
diff --git a/tweets/__init__.py b/tweets/__init__.py
new file mode 100644
index 0000000..bbc1e7b
--- /dev/null
+++ b/tweets/__init__.py
@@ -0,0 +1,4 @@
+from .tweets import Tweets
+
+def setup(bot):
+ bot.add_cog(Tweets(bot))
diff --git a/tweets/info.json b/tweets/info.json
new file mode 100644
index 0000000..f7a8f07
--- /dev/null
+++ b/tweets/info.json
@@ -0,0 +1,25 @@
+{
+ "author":[
+ "palmtree5",
+ "TrustyJAID"
+ ],
+ "description":"Gets the latest Tweet from twitter accounts and posts them in the specified channels",
+ "install_msg":"[p]tweets to see commands. Make sure to do pip3 install tweepy before using this plugin. Do [p]tweetset to find commands for setting consumer key and secret and access token and secret. If you need these, visit https://apps.twitter.com/ and create an application. This plugin only needs read only permissions as it will only read public information",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Tweets",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[
+ "git+https://github.com/tweepy/tweepy.git"
+ ],
+ "short":"Cog for getting info from Twitter",
+ "tags":[
+ "twitter",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/tweets/tweet_entry.py b/tweets/tweet_entry.py
new file mode 100644
index 0000000..55d2f74
--- /dev/null
+++ b/tweets/tweet_entry.py
@@ -0,0 +1,28 @@
+from typing import Tuple
+from redbot.core import commands
+
+import discord
+
+class TweetEntry:
+ def __init__(self, twitter_id: int, twitter_name: str,
+ channel: list, last_tweet: int, replies:bool=False):
+ super().__init__()
+ self.twitter_id = twitter_id
+ self.twitter_name = twitter_name
+ self.channel = channel
+ self.last_tweet = last_tweet
+ self.replies = replies
+
+ def to_json(self) -> dict:
+ return {
+ "twitter_id": self.twitter_id,
+ "twitter_name": self.twitter_name,
+ "channel": self.channel,
+ "last_tweet": self.last_tweet,
+ "replies": self.replies
+ }
+
+ @classmethod
+ def from_json(cls, data: dict):
+ return cls(data["twitter_id"], data["twitter_name"],
+ data["channel"], data["last_tweet"], data["replies"])
diff --git a/tweets/tweets.py b/tweets/tweets.py
new file mode 100644
index 0000000..199e32a
--- /dev/null
+++ b/tweets/tweets.py
@@ -0,0 +1,746 @@
+from typing import Generator, Tuple, Iterable, Any
+from random import choice as randchoice
+from datetime import datetime as dt
+from redbot.core import commands
+import discord
+import asyncio
+import aiohttp
+from io import BytesIO
+from redbot.core import Config
+from redbot.core import checks
+from redbot.core.utils.chat_formatting import pagify
+from .tweet_entry import TweetEntry
+import tweepy as tw
+
+
+
+numbs = {
+ "next": "➡",
+ "back": "⬅",
+ "exit": "❌"
+}
+
+
+class TweetListener(tw.StreamListener):
+
+ def __init__(self, api, bot):
+ super().__init__(api=api)
+ self.bot = bot
+
+ def on_status(self, status):
+ # print(status.text)
+ self.bot.dispatch("tweet_status", status)
+ if self.bot.is_closed():
+ return False
+ else:
+ return True
+
+ def on_error(self, status_code):
+ msg = "A tweet stream error has occured! " + str(status_code)
+ print(msg)
+ self.bot.dispatch("tweet_error", msg)
+ if status_code in [420, 504, 503, 502, 500, 400, 401, 403, 404]:
+ return False
+
+ def on_disconnect(self, notice):
+ msg = "Twitter has sent a disconnect code"
+ print(msg)
+ self.bot.dispatch("tweet_error", msg)
+ return False
+
+ def on_warning(self, notice):
+ msg = "Twitter has sent a disconnection warning"
+ print(msg)
+ self.bot.dispatch("tweet_error", msg)
+ return True
+
+
+class Tweets(getattr(commands, "Cog", object)):
+ """
+ Cog for displaying info from Twitter's API
+ """
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 133926854)
+ default_global = {"api": {'consumer_key': '', 'consumer_secret': '',
+ 'access_token': '', 'access_secret': ''}, "accounts": [], "error_channel": None}
+ self.config.register_global(**default_global)
+ self.mystream = None
+ self.loop = bot.loop.create_task(self.start_stream())
+
+ ###################################################################
+ # Here is all the logic for handling tweets and tweet creation
+
+ async def start_stream(self):
+ await self.bot.wait_until_ready()
+ while self is self.bot.get_cog("Tweets"):
+ if self.mystream is None:
+ api = await self.authenticate()
+ tweet_list = [str(x["twitter_id"]) for x in await self.config.accounts()]
+ if tweet_list != []:
+ stream_start = TweetListener(api, self.bot)
+ self.mystream = tw.Stream(api.auth, stream_start, chunk_size=1024, timeout=900.0)
+ self.start_stream_loop(tweet_list)
+ if not getattr(self.mystream, "running", False):
+ api = await self.authenticate()
+ tweet_list = [str(x["twitter_id"]) for x in await self.config.accounts()]
+ stream_start = TweetListener(api, self.bot)
+ self.mystream = tw.Stream(api.auth, stream_start, chunk_size=1024, timeout=900.0)
+ self.start_stream_loop(tweet_list)
+ await asyncio.sleep(300)
+
+ def start_stream_loop(self, tweet_list):
+ self.mystream.filter(follow=tweet_list, is_async=True)
+
+ async def authenticate(self):
+ """Authenticate with Twitter's API"""
+ auth = tw.OAuthHandler(await self.config.api.consumer_key(),
+ await self.config.api.consumer_secret())
+ auth.set_access_token(await self.config.api.access_token(),
+ await self.config.api.access_secret())
+ return tw.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True, retry_count=10, retry_delay=5,
+ retry_errors=[500, 502, 503, 504])
+
+ async def autotweet_restart(self):
+ if self.mystream is not None:
+ self.mystream.disconnect()
+ self.loop.cancel()
+ self.loop = self.bot.loop.create_task(self.start_stream())
+
+ async def on_tweet_error(self, error):
+ """Posts tweet stream errors to a specified channel"""
+ if await self.config.error_channel() is not None:
+ channel = self.bot.get_channel(await self.config.error_channel())
+ await channel.send(error + "\n See here for more information ")
+ if "420" in error:
+ await channel.send("Maybe you should unload the cog for a while...")
+ return
+
+ async def build_tweet_embed(self, status):
+ username = status.user.screen_name
+ user_id = status.user.id
+ post_url = "https://twitter.com/{}/status/{}".format(status.user.screen_name, status.id)
+ em = discord.Embed(colour=discord.Colour(value=int(status.user.profile_link_color, 16)),
+ url=post_url,
+ timestamp=status.created_at)
+ if hasattr(status, "retweeted_status"):
+ em.set_author(name=status.user.name + " Retweeted", url=post_url,
+ icon_url=status.user.profile_image_url)
+ status = status.retweeted_status
+ if hasattr(status, "extended_entities"):
+ em.set_image(url=status.extended_entities["media"][0]["media_url_https"])
+ if hasattr(status, "extended_tweet"):
+ text = status.extended_tweet["full_text"]
+ if "media" in status.extended_tweet["entities"]:
+ em.set_image(url=status.extended_tweet["entities"]["media"][0]["media_url_https"])
+ else:
+ text = status.text
+ else:
+ em.set_author(name=status.user.name, url=post_url, icon_url=status.user.profile_image_url)
+ if hasattr(status, "extended_entities"):
+ em.set_image(url=status.extended_entities["media"][0]["media_url_https"])
+ if hasattr(status, "extended_tweet"):
+ text = status.extended_tweet["full_text"]
+ if "media" in status.extended_tweet["entities"]:
+ em.set_image(url=status.extended_tweet["entities"]["media"][0]["media_url_https"])
+ else:
+ text = status.text
+ em.description = text.replace("&", "\n\n")
+ em.set_footer(text="@" + username)
+ return em
+
+ async def on_tweet_status(self, status):
+ """Posts the tweets to the channel"""
+ username = status.user.screen_name
+ user_id = status.user.id
+ account = None
+ post_url = "https://twitter.com/{}/status/{}".format(status.user.screen_name, status.id)
+ for accounts in await self.get_followed_accounts():
+ if accounts.twitter_id == user_id:
+ account = accounts
+ if not account:
+ return
+ try:
+ if status.in_reply_to_screen_name is not None and not account.replies:
+ return
+ em = await self.build_tweet_embed(status)
+ channel_list = account.channel
+ for channel in channel_list:
+ try:
+ channel_send = self.bot.get_channel(int(channel))
+ if channel_send is None:
+ await self.del_account(channel, user_id, username)
+ if channel_send.permissions_for(channel_send.guild.me).embed_links:
+ await channel_send.send(post_url, embed=em)
+ elif channel_send.permissions_for(channel_send.guild.me).manage_webhooks:
+ webhook = None
+ for hook in await channel_send.webhooks():
+ if hook.name == channel_send.guild.me.name:
+ webhook = hook
+ if webhook is None:
+ webhook = await channel_send.create_webhook(name=channel_send.guild.me.name)
+ avatar = status.user.profile_image_url
+ await webhook.send(post_url, username=username, avatar_url=avatar, embed=em)
+ else:
+ await channel_send.send(post_url)
+ except Exception as e:
+ msg = "{0} from <#{1}>({1}): {2}".format(username, channel, e)
+ error_channel = self.bot.get_channel(await self.config.error_channel())
+ if "FORBIDDEN" in str(e) or "403" in str(e):
+ await error_channel.send("Removing " + msg)
+ await self.del_account(channel, user_id, username)
+ elif "NoneType" in str(e):
+ await error_channel.send("Removing " + msg)
+ await self.del_account(channel, user_id, username)
+ else:
+ await error_channel.send(msg)
+
+ except Exception as e:
+ print((f"Whoops! Something went wrong here."
+ f"The error code is {e} {username}"))
+ if await self.config.error_channel() is not None:
+ error_channel = self.bot.get_channel(await self.config.error_channel())
+ await error_channel.send(str(e) + ": Username" + username)
+ return
+
+
+ async def tweet_menu(self, ctx, post_list: list,
+ message: discord.Message = None,
+ page=0, timeout: int = 30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ s = post_list[page]
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = await self.build_tweet_embed(s)
+ else:
+ em = None
+ post_url = "https://twitter.com/{}/status/{}".format(s.user.screen_name, s.id)
+ if not message:
+ message = await ctx.send(post_url, embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(content=post_url, embed=em)
+ check = lambda react, user: user == ctx.message.author and react.emoji in ["➡", "⬅",
+ "❌"] and react.message.id == message.id
+ try:
+ react, user = await self.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ reacts = {v: k for k, v in numbs.items()}
+ react = reacts[react.emoji]
+ if react == "next":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await self.tweet_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ elif react == "back":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await self.tweet_menu(ctx, post_list, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ ###################################################################
+ # here are all the commands for getting twitter info
+
+ @commands.group(no_pm=True, name='tweets', aliases=["twitter"])
+ async def _tweets(self, ctx):
+ """Gets various information from Twitter's API"""
+ pass
+
+ @_tweets.command(name="send")
+ @checks.is_owner()
+ async def send_tweet(self, ctx, *, message: str):
+ """
+ Allows the owner to send tweets through discord
+
+ Upload an image to send an image with it as well.
+ """
+ try:
+ api = await self.authenticate()
+ if ctx.message.attachments != []:
+ temp = BytesIO()
+ filename = ctx.message.attachments[0].filename
+ file_send = await ctx.message.attachments[0].save(temp)
+ api.update_with_media(filename, status=message, file=temp)
+ else:
+ api.update_status(message)
+ except Exception as e:
+ print(e)
+ await ctx.send("An error has occured, check the console for more details.")
+ return
+ await ctx.send("Tweet sent!")
+
+ def random_colour(self):
+ """Returns a random hex colour for discord.Colour() objects"""
+ return int(''.join([randchoice('0123456789ABCDEF') for x in range(6)]), 16)
+
+ @_tweets.command(pass_context=True, name="trends")
+ async def trends(self, ctx, *, location: str = "United States"):
+ """
+ Gets twitter trends for a given location
+
+ You can provide a location and it will try to get
+ different trend information from that location
+ default is `United States`
+ """
+ api = await self.authenticate()
+ location_list = api.trends_available()
+ country_id = None
+ location_names = []
+ for locations in location_list:
+ location_names.append(locations["name"])
+ if location.lower() in locations["name"].lower():
+ country_id = locations
+ if country_id is None:
+ await ctx.send("{} Is not a correct location!".format(location))
+ return
+ trends = api.trends_place(country_id["woeid"])[0]["trends"]
+ em = discord.Embed(colour=discord.Colour(value=self.random_colour()),
+ title=country_id["name"])
+ msg = ""
+ for trend in trends[:25]:
+ # trend = trends[0]["trends"][i]
+ if trend["tweet_volume"] is not None:
+ msg += "{}. [{}]({}) Volume: {}\n".format(trends.index(trend) + 1, trend["name"], trend["url"],
+ trend["tweet_volume"])
+ else:
+ msg += "{}. [{}]({})\n".format(trends.index(trend) + 1, trend["name"], trend["url"])
+ em.description = msg[:2000]
+ em.timestamp = dt.utcnow()
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send(embed=em)
+ else:
+ await ctx.send("```\n{}```".format(msg[:1990]))
+
+ @_tweets.command(no_pm=True, name='getuser')
+ async def get_user(self, ctx, username: str):
+ """Get info about the specified user"""
+ try:
+ api = await self.authenticate()
+ user = api.get_user(username)
+ except tw.error.TweepError as e:
+ await ctx.send(e)
+ return
+ profile_url = "https://twitter.com/" + user.screen_name
+ description = str(user.description)
+ for url in user.entities["description"]["urls"]:
+ if str(url["url"]) in description:
+ description = description.replace(url["url"], str(url["expanded_url"]))
+ emb = discord.Embed(colour=discord.Colour(value=int(user.profile_link_color, 16)),
+ url=profile_url,
+ description=str(description),
+ timestamp=user.created_at)
+ emb.set_author(name=user.name, url=profile_url, icon_url=user.profile_image_url)
+ emb.set_thumbnail(url=user.profile_image_url)
+ emb.add_field(name="Followers", value=user.followers_count)
+ emb.add_field(name="Friends", value=user.friends_count)
+ if user.verified:
+ emb.add_field(name="Verified", value="Yes")
+ footer = "Created at "
+ emb.set_footer(text=footer)
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ await ctx.send("<"+profile_url+">", embed=emb)
+ else:
+ await ctx.send(profile_url)
+
+ @_tweets.command(no_pm=True, name='gettweets')
+ async def get_tweets(self, ctx, username: str, count: int = 10):
+ """
+ Display a users tweets as a scrollable message
+
+ defaults to 10 tweets
+ """
+ cnt = count
+ if count > 25:
+ cnt = 25
+ followed_accounts = [x for x in await self.config.accounts()]
+ if username.lower() in [x["twitter_name"].lower() for x in followed_accounts]:
+ account = [x for x in followed_accounts if username.lower() == x["twitter_name"].lower()]
+ replies_on = account[0]["replies"]
+ else:
+ replies_on = False
+ if username is not None:
+ msg_list = []
+ api = await self.authenticate()
+ try:
+ for status in \
+ tw.Cursor(api.user_timeline, id=username).items(cnt):
+ if status.in_reply_to_screen_name is not None and not replies_on:
+ continue
+ msg_list.append(status)
+ except tw.TweepError as e:
+ await ctx.send("Whoops! Something went wrong here. \
+ The error code is " + str(e))
+ return
+ if len(msg_list) > 0:
+ await self.tweet_menu(ctx, msg_list, page=0, timeout=30)
+ else:
+ await ctx.send("No tweets available to display!")
+ else:
+ await ctx.send("No username specified!")
+ return
+
+ @commands.group(name='autotweet')
+ @checks.admin_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def _autotweet(self, ctx):
+ """Command for setting accounts and channels for posting"""
+ pass
+
+ @_autotweet.command(name="error")
+ @checks.is_owner()
+ async def _error(self, ctx, channel: discord.TextChannel = None):
+ """Set an error channel for tweet stream error updates"""
+ if not channel:
+ channel = ctx.channel
+ await self.config.error_channel.set(channel.id)
+ await ctx.send("Twitter error channel set to {}".format(channel.mention))
+
+ @_autotweet.command(name="cleanup")
+ @checks.is_owner()
+ async def tweets_cleanup(self, ctx):
+ """Searches for unavailable channels and removes posting in those channels"""
+ account_list = await self.config.accounts()
+ for account in account_list:
+ for channel in account["channel"]:
+ chn = self.bot.get_channel(channel)
+ if chn is None:
+ print("Removing channel {}".format(channel))
+ account_list.remove(account)
+ account["channel"].remove(channel)
+ account_list.append(account)
+ if len(account["channel"]) == 0:
+ print("Removing account {}".format(account["twitter_name"]))
+ account_list.remove(account)
+ await self.config.accounts.set(account_list)
+
+ @_autotweet.command(name="restart")
+ async def restart_stream(self, ctx):
+ """Restarts the twitter stream if any issues occur."""
+ await ctx.channel.trigger_typing()
+ await self.autotweet_restart()
+ await ctx.send("Restarting the twitter stream.")
+
+ @_autotweet.command(name="replies")
+ async def _replies(self, ctx, account):
+ """
+ Toggle an accounts replies being posted
+
+ This is checked on `autotweet` as well as `gettweets`
+ """
+ account = account.lower()
+ edited_account = None
+ all_accounts = await self.config.accounts()
+ for accounts in all_accounts:
+ if accounts["twitter_name"].lower() == account:
+ edited_account = accounts
+ if edited_account is None:
+ await ctx.send("I am not tracking {}".format(account))
+ return
+ else:
+ all_accounts.remove(edited_account)
+ edited_account["replies"] = not edited_account["replies"]
+ all_accounts.append(edited_account)
+ await self.config.accounts.set(all_accounts)
+ if edited_account["replies"]:
+ await ctx.send(f"Posting {account} replies.")
+ else:
+ await ctx.send(f"No longer posting {account} replies.")
+
+ async def get_followed_accounts(self) -> Generator[TweetEntry, None, None]:
+ return (TweetEntry.from_json(d) for d in (await self.config.accounts()))
+
+ async def is_followed_account(self, twitter_id) -> Tuple[bool, Any]:
+ followed_accounts = await self.config.accounts()
+
+ for account in followed_accounts:
+ if account["twitter_id"] == twitter_id:
+ return True, account
+ return False, None
+
+ @_autotweet.command(name="add")
+ async def _add(self, ctx, account: str, channel: discord.TextChannel = None):
+ """
+ Adds a twitter account to the specified channel
+
+ `account` needs to be the @handle for the twitter account
+ `channel` has to be a valid server channel, defaults to the current channel
+ """
+ api = await self.authenticate()
+ try:
+ user_id = None
+ screen_name = None
+ last_id = None
+ for status in tw.Cursor(api.user_timeline, id=account).items(1):
+ user_id = status.user.id
+ screen_name = status.user.screen_name
+ last_id = status.id
+ except tw.TweepError as e:
+ print("Whoops! Something went wrong here. \
+ The error code is " + str(e) + account)
+ await ctx.send("That account does not exist! Try again")
+ return
+ if user_id is None:
+ await ctx.send("No status was retrieved! Try again")
+ return
+ if channel is None:
+ channel = ctx.message.channel
+ own_perms = channel.permissions_for(ctx.guild.me)
+ if not own_perms.send_messages:
+ await ctx.send("I don't have permission to post in {}".format(channel.mention))
+ return
+ if not own_perms.embed_links and not own_perms.manage_webhooks:
+ msg = (f"I do not have embed links or manage webhooks permission in {channel.mention}, "
+ "I recommend enabling that for pretty twitter posts!")
+ await ctx.send(msg)
+ in_list = True if str(user_id) in [str(x["twitter_id"]) for x in await self.config.accounts()] else False
+ added = await self.add_account(channel, user_id, screen_name)
+ if added:
+ await ctx.send("{0} Added to {1}!".format(account, channel.mention))
+ if not in_list:
+ prefix_list = await self.bot.command_prefix(self.bot, ctx.message)
+ msg = (f"Now do `{prefix_list[0]}autotweet restart` when you've "
+ "finished adding all accounts!")
+ await ctx.send(msg)
+ else:
+ await ctx.send(f"I am already posting {screen_name} tweets in {channel.mention}")
+ # await self.autotweet_restart()
+
+ @_autotweet.command(name="list")
+ @commands.bot_has_permissions(embed_links=True)
+ async def _list(self, ctx):
+ """Lists the autotweet accounts on the guild"""
+ account_list = ""
+ guild = ctx.message.guild
+
+ accounts = [x for x in await self.config.accounts()]
+ embed = discord.Embed(title="Twitter accounts posting in {}".format(guild.name),
+ colour=discord.Colour(value=self.random_colour()),
+ # description=account_list[:-2],
+ timestamp=ctx.message.created_at)
+ embed.set_author(name=guild.name, icon_url=guild.icon_url)
+ for channel in guild.channels:
+ account_list = ""
+ for account in accounts:
+ if channel.id in account["channel"]:
+ account_list += account["twitter_name"] + ", "
+ if account_list != "":
+ embed.add_field(name=channel.name, value=account_list[:-2])
+ await ctx.send(embed=embed)
+
+ async def add_account(self, channel, user_id, screen_name):
+ """
+ Adds a twitter account to the specified channel.
+ Returns False if it is already in the channel.
+ """
+ followed_accounts = await self.config.accounts()
+
+ is_followed, twitter_account = await self.is_followed_account(user_id)
+ if is_followed:
+ if channel.id in twitter_account["channel"]:
+ return False
+ else:
+ followed_accounts.remove(twitter_account)
+ twitter_account["channel"].append(channel.id)
+ followed_accounts.append(twitter_account)
+ await self.config.accounts.set(followed_accounts)
+ else:
+ twitter_account = TweetEntry(user_id, screen_name, [channel.id], 0)
+ followed_accounts.append(twitter_account.to_json())
+ await self.config.accounts.set(followed_accounts)
+ return True
+
+ @_autotweet.command(name="addlist")
+ async def add_list(self, ctx, owner, list_name, channel: discord.TextChannel = None):
+ """
+ Add an entire twitter list to a specified channel.
+
+ The list must be public or the bot owner must own it.
+ `owner` is the owner of the list's @handle
+ `list_name` is the name of the list
+ `channel` is the channel where the tweets will be posted
+ """
+ api = await self.authenticate()
+ try:
+ cursor = -1
+ list_members = []
+ member_count = api.get_list(owner_screen_name=owner, slug=list_name).member_count
+ while len(list_members) < member_count:
+ member_list = api.list_members(owner_screen_name=owner, slug=list_name, cursor=cursor)
+ for member in member_list[0]:
+ list_members.append(member)
+ cursor = member_list[1][-1]
+ print("{} members added".format(len(member_list[0])))
+
+ except Exception as e:
+ print(e)
+ await ctx.send("The owner {} and list name {} don't appear to be available!".format(owner, list_name))
+ return
+ if channel is None:
+ channel = ctx.message.channel
+ if not channel.permissions_for(ctx.guild.me).send_messages:
+ await ctx.send("I don't have permission to post in {}".format(channel.mention))
+ return
+ if not channel.permissions_for(ctx.guild.me).embed_links:
+ await ctx.send(
+ "I do not have embed links permission in {}, I recommend enabling that for pretty twitter posts!".format(
+ channel.mention))
+ added_accounts = []
+ missed_accounts = []
+ for member in list_members:
+ added = await self.add_account(channel, member.id, member.name)
+ if added:
+ added_accounts.append(member.name)
+ else:
+ missed_accounts.append(member.name)
+ if len(added_accounts) != 0:
+ msg = ", ".join(member for member in added_accounts)
+ msg_send = "Added the following accounts to {}: {}".format(channel.mention, msg)
+ for page in pagify(msg_send, ["\n"]):
+ await ctx.send(page)
+ prefix_list = await self.bot.command_prefix(self.bot, ctx.message)
+ await ctx.send("Now do `{}autotweet restart` when you've finished adding all accounts!".format(prefix_list[0]))
+ if len(missed_accounts) != 0:
+ msg = ", ".join(member for member in missed_accounts)
+ msg_send = "The following accounts could not be added to {}: {}".format(channel.mention, msg)
+ for page in pagify(msg_send, ["\n"]):
+ await ctx.send(page)
+
+ @_autotweet.command(name="remlist")
+ async def rem_list(self, ctx, owner, list_name, channel: discord.TextChannel = None):
+ """
+ Remove an entire twitter list from a specified channel.
+
+ The list must be public or the bot owner must own it.
+ `owner` is the owner of the list's @handle
+ `list_name` is the name of the list
+ `channel` is the channel where the tweets will be posted
+ """
+ api = await self.authenticate()
+ try:
+ cursor = -1
+ list_members = []
+ member_count = api.get_list(owner_screen_name=owner, slug=list_name).member_count
+ while len(list_members) < member_count:
+ member_list = api.list_members(owner_screen_name=owner, slug=list_name, cursor=cursor)
+ for member in member_list[0]:
+ list_members.append(member)
+ cursor = member_list[1][-1]
+ except:
+ await ctx.send("The owner {} and list name {} don't appear to be available!".format(owner, list_name))
+ return
+ if channel is None:
+ channel = ctx.message.channel
+ removed_accounts = []
+ missed_accounts = []
+ for member in list_members:
+ removed = await self.del_account(channel.id, member.id, member.name)
+ if removed:
+ removed_accounts.append(member.name)
+ else:
+ missed_accounts.append(member.name)
+ if len(removed_accounts) != 0:
+ msg = ", ".join(member for member in removed_accounts)
+ msg_send = "Removed the following accounts from {}: {}".format(channel.mention, msg)
+ for page in pagify(msg_send, ["\n"]):
+ await ctx.send(page)
+ if len(missed_accounts) != 0:
+ msg = ", ".join(member for member in missed_accounts)
+ msg_send = "The following accounts weren't added to {} or there was another error: {}".format(
+ channel.mention, msg)
+ for page in pagify(msg_send, ["\n"]):
+ await ctx.send(page)
+
+ async def del_account(self, channel_id, user_id, screen_name):
+ account_ids = [x["twitter_id"] for x in await self.config.accounts()]
+ if user_id not in account_ids:
+ return False
+ account_list = [x for x in await self.config.accounts()]
+ twitter_account = [x for x in account_list if user_id == x["twitter_id"]][0]
+ if channel_id in twitter_account["channel"]:
+ account_list.remove(twitter_account)
+ twitter_account["channel"].remove(channel_id)
+ account_list.append(twitter_account)
+ await self.config.accounts.set(account_list)
+ if len(twitter_account["channel"]) < 1:
+ account_list.remove(twitter_account)
+ await self.config.accounts.set(account_list)
+ return True
+
+ @_autotweet.command(name="del", aliases=["delete", "rem", "remove"])
+ async def _del(self, ctx, account, channel: discord.TextChannel = None):
+ """
+ Removes a twitter account to the specified channel
+
+ `account` must be the users @handle
+ `channel` is the channel where the account is currently being posted
+ """
+ account = account.lower()
+ api = await self.authenticate()
+ if channel is None:
+ channel = ctx.message.channel
+ try:
+ user_id = None
+ screen_name = None
+ for status in tw.Cursor(api.user_timeline, id=account).items(1):
+ user_id = status.user.id
+ screen_name = status.user.screen_name
+ except tw.TweepError as e:
+ print("Whoops! Something went wrong here. \
+ The error code is " + str(e) + account)
+ await ctx.send("Something went wrong here! Try again")
+ return
+ if user_id is None:
+ await ctx.send("No status was retrieved! Try again")
+ return
+ removed = await self.del_account(channel.id, user_id, screen_name)
+ if removed:
+ await ctx.send("{} has been removed from {}".format(account, channel.mention))
+ else:
+ await ctx.send("{0} doesn't seem to be posting in {1}!".format(account, channel.mention))
+
+ @commands.group(name='tweetset')
+ @checks.admin_or_permissions(manage_guild=True)
+ async def _tweetset(self, ctx):
+ """Command for setting required access information for the API.
+
+ 1. Visit https://apps.twitter.com and apply for a developer account.
+ 2. Once your account is approved setup an application and follout the form
+ 3. Do `[p]tweetset creds consumer_key consumer_secret access_token access_secret`
+ to the bot in a private channel (DM's preferred).
+ """
+ pass
+
+ @_tweetset.command(name='creds')
+ @checks.is_owner()
+ async def set_creds(self, ctx, consumer_key: str, consumer_secret: str, access_token: str, access_secret: str):
+ """[p]tweetset """
+ api = {'consumer_key': consumer_key, 'consumer_secret': consumer_secret,
+ 'access_token': access_token, 'access_secret': access_secret}
+ await self.config.api.set(api)
+ await ctx.send('Set the access credentials!')
+
+ def __unload(self):
+ if self.mystream is not None:
+ self.mystream.disconnect()
+ self.loop.cancel()
diff --git a/twitch/__init__.py b/twitch/__init__.py
new file mode 100644
index 0000000..9e1a9be
--- /dev/null
+++ b/twitch/__init__.py
@@ -0,0 +1,6 @@
+from .twitch import Twitch
+
+
+async def setup(bot):
+ cog = Twitch(bot)
+ bot.add_cog(cog)
diff --git a/twitch/errors.py b/twitch/errors.py
new file mode 100644
index 0000000..0a36720
--- /dev/null
+++ b/twitch/errors.py
@@ -0,0 +1,2 @@
+class TwitchError(Exception):
+ pass
diff --git a/twitch/info.json b/twitch/info.json
new file mode 100644
index 0000000..826fa20
--- /dev/null
+++ b/twitch/info.json
@@ -0,0 +1,23 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Get notified of new twitch followers and get basic profile info.",
+ "install_msg":"Setup a channel for new twitch follower notifications!",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"Twitch",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Get basic twitch account information.",
+ "tags":[
+ "general",
+ "twitch",
+ "streams"
+ ]
+}
\ No newline at end of file
diff --git a/twitch/twitch.py b/twitch/twitch.py
new file mode 100644
index 0000000..d038eb3
--- /dev/null
+++ b/twitch/twitch.py
@@ -0,0 +1,432 @@
+import discord
+from redbot.core import Config, checks, commands
+from redbot.core.commands import Context
+from .twitch_profile import TwitchProfile
+from .twitch_follower import TwitchFollower
+from .errors import *
+from datetime import datetime
+import asyncio
+import aiohttp
+import time
+
+
+
+BASE_URL = "https://api.twitch.tv/helix"
+
+class Twitch(getattr(commands, "Cog", object)):
+ """
+ Get twitch user information and post when a user gets new followers
+ """
+
+ global_defaults = {"client_id":"", "client_secret":"", "access_token":{}, "twitch_accounts":[]}
+ user_defaults = {"id": "", "login":"", "display_name":""}
+
+ def __init__(self, bot):
+ self.config = Config.get_conf(self, 1543454673)
+ self.config.register_global(**self.global_defaults, force_registration=True)
+ self.config.register_user(**self.user_defaults, force_registration=True)
+ self.bot = bot
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.rate_limit_resets = set()
+ self.rate_limit_remaining = 0
+ self.loop = bot.loop.create_task(self.check_for_new_followers())
+
+
+ #####################################################################################
+ # Logic for accessing twitch API with rate limit checks #
+ # https://github.com/tsifrer/python-twitch-client/blob/master/twitch/helix/base.py #
+ #####################################################################################
+
+ async def get_header(self):
+ header = {"Client-ID":await self.config.client_id()}
+ access_token = await self.config.access_token()
+ if access_token != {}:
+ # Return bearer token if availavble for more access
+ header["Authorization"] = "Bearer {}".format(access_token["access_token"])
+ return header
+
+ async def wait_for_rate_limit_reset(self):
+ """Check rate limits in response header and ensure we're following them
+ https://github.com/tsifrer/python-twitch-client/blob/master/twitch/helix/base.py
+ """
+ if self.rate_limit_remaining == 0:
+ current_time = int(time.time())
+ self.rate_limit_resets = set(x for x in self.rate_limit_resets if x > current_time)
+
+ if len(self.rate_limit_resets) > 0:
+ reset_time = list(self.rate_limit_resets)[0]
+ # Calculate wait time and add 0.1s to the wait time to allow Twitch to reset
+ # their counter
+ wait_time = reset_time - current_time + 0.1
+ await asyncio.sleep(wait_time)
+
+ async def oauth_check(self):
+ url = "https://id.twitch.tv/oauth2/token"
+ client_id = await self.config.client_id()
+ client_secret = await self.config.client_secret()
+ access_token = await self.config.access_token()
+ if client_secret == "":
+ # Can't get the app access token without the client secret being set
+ return
+ if access_token == {}:
+ # Attempts to acquire an app access token
+ params = {"client_id":client_id,
+ "client_secret":client_secret,
+ "grant_type":"client_credentials",
+ "scope":"analytics:read:extensions analytics:read:games bits:read clips:edit user:edit user:edit:broadcast"}
+ async with self.session.post(url, params=params) as resp:
+ access_token = await resp.json()
+ await self.config.access_token.set(access_token)
+ else:
+ if "access_token" not in access_token:
+ # Tries to re-aquire access token if set one is incorrect
+ await self.config.access_token.set({})
+ return await self.oauth_check()
+ header = {"Authorization":"OAuth {}".format(access_token["access_token"])}
+ url = "https://id.twitch.tv/oauth2/validate"
+ resp = await self.session.get(url, headers=header)
+ if resp.status == 200:
+ # Validates the access token before use
+ return
+ else:
+ await self.config.access_token.set({})
+ return await self.oauth_check()
+
+
+ async def get_response(self, url):
+ """Get responses from twitch after checking rate limits"""
+ await self.oauth_check()
+ header = await self.get_header()
+ await self.wait_for_rate_limit_reset()
+ resp = await self.session.get(url, headers=header)
+ remaining = resp.headers.get("Ratelimit-Remaining")
+ if remaining:
+ self.rate_limit_remaining = int(remaining)
+ reset = resp.headers.get("Ratelimit-Reset")
+ if reset:
+ self.rate_limit_resets.add(int(reset))
+
+ if resp.status == 429:
+ return self.get_response(url)
+
+ return await resp.json()
+
+ #####################################################################################
+
+ async def make_user_embed(self, profile):
+ # makes the embed for a twitch profile
+ em = discord.Embed(colour=int("6441A4", 16))
+ em.description = profile.description
+ url = "https://twitch.tv/{}".format(profile.login)
+ em.set_author(name="{}".format(profile.display_name), url=url, icon_url=profile.profile_image_url)
+ em.set_image(url=profile.offline_image_url)
+ em.set_thumbnail(url=profile.profile_image_url)
+ footer_text = "{} Viewer count".format(profile.view_count)
+ em.set_footer(text=footer_text, icon_url=profile.profile_image_url)
+ return em
+
+ async def make_follow_embed(self, profile, total_followers):
+ # makes the embed for a twitch profile
+ em = discord.Embed(colour=int("6441A4", 16))
+ url = "https://twitch.tv/{}".format(profile.login)
+ em.description = "[{}]({}) has just followed!".format(profile.display_name, url)
+ em.set_author(name="{} has just followed!".format(
+ profile.display_name), url=url, icon_url=profile.profile_image_url)
+ # em.set_image(url=profile.offline_image_url)
+ em.set_thumbnail(url=profile.profile_image_url)
+ footer_text = "{} followers".format(total_followers)
+ em.set_footer(text=footer_text, icon_url=profile.profile_image_url)
+ return em
+
+ async def get_all_followers(self, user_id):
+ # Get's all of a users current followers
+ url = "{}/users/follows?to_id={}&first=100".format(BASE_URL, user_id)
+ data = await self.get_response(url)
+ follows = [x["from_id"] for x in data["data"]]
+ total = data["total"]
+ print("{} of {}".format(len(follows), total))
+ count = 0
+ while len(follows) < total:
+ count += 1
+ cursor = data["pagination"]["cursor"]
+ data = await self.get_response(url+"&after="+cursor)
+ for user in data["data"]:
+ if user["from_id"] not in follows:
+ follows.append(user["from_id"])
+ print("{} of {}".format(len(follows), total))
+ if count == (int(total/100)+(total%100>0)):
+ # Break the loop if we've gone over the total we could theoretically get
+ break
+ return follows, total
+
+ async def get_profile_from_name(self, twitch_name):
+ url = "{}/users?login={}".format(BASE_URL, twitch_name)
+ return TwitchProfile.from_json(await self.get_response(url))
+
+ async def get_profile_from_id(self, twitch_id):
+ url = "{}/users?id={}".format(BASE_URL, twitch_id)
+ return TwitchProfile.from_json(await self.get_response(url))
+
+ async def get_new_followers(self, user_id):
+ # Gets the last 100 followers from twitch
+ url = "{}/users/follows?to_id={}&first=100".format(BASE_URL, user_id)
+ data = await self.get_response(url)
+ follows = [TwitchFollower.from_json(x) for x in data["data"]]
+ total = data["total"]
+ return follows, total
+
+ async def maybe_get_twitch_profile(self, ctx, twitch_name:str):
+ if twitch_name is not None:
+ # Search for twitch login name
+ try:
+ profile = await self.get_profile_from_name(twitch_name)
+ except Exception as e:
+ print(e)
+ raise TwitchError("{} is not a valid Twitch username".format(twitch_name))
+ else:
+ # User has set their twitch ID on the bot
+ twitch_id = await self.config.user(ctx.author).id()
+ if twitch_id == "":
+ raise TwitchError("You must set a twitch ID")
+ else:
+ profile = await self.get_profile_from_id(twitch_id)
+ return profile
+
+ async def check_account_added(self, account_list, profile):
+ # Checks if the account is in the config and returns only that one
+ account_return = None
+ for account in account_list:
+ if account["id"] == profile.id:
+ account_return = account
+ return account_return
+
+ async def check_for_new_followers(self):
+ # Checks twitch every minute for new followers
+ await self.bot.wait_until_ready()
+ while self is self.bot.get_cog("Twitch"):
+ check_accounts = await self.config.twitch_accounts()
+ for account in check_accounts:
+ followers, total = await self.get_new_followers(account["id"])
+ for follow in reversed(followers):
+ if follow.from_id not in account["followers"]:
+ try:
+ profile = await self.get_profile_from_id(follow.from_id)
+ except Exception as e:
+ print(e)
+ print("{} Followed! You have {} followers now.".format(profile.login, total))
+ em = await self.make_follow_embed(profile, total)
+ for channel_id in account["channels"]:
+ channel = self.bot.get_channel(id=channel_id)
+ await channel.send(embed=em)
+ check_accounts.remove(account)
+ account["followers"].append(follow.from_id)
+ check_accounts.append(account)
+ await self.config.twitch_accounts.set(check_accounts)
+
+ await asyncio.sleep(60)
+
+ @commands.group(aliases=["t", "twi"])
+ async def twitchhelp(self, ctx):
+ """Twitch related commands"""
+ if await self.config.client_id() == "":
+ await ctx.send("You need to set the twitch token first!")
+ return
+ pass
+
+ @twitchhelp.command(name="setfollow")
+ @checks.admin_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def set_follow(self, ctx, twitch_name=None, channel:discord.TextChannel=None):
+ """
+ Setup a channel for automatic follow notifications
+ """
+ if channel is None:
+ channel = ctx.channel
+ try:
+ profile = await self.maybe_get_twitch_profile(ctx, twitch_name)
+ except TwitchError as e:
+ await ctx.send(e)
+ return
+ cur_accounts = await self.config.twitch_accounts()
+ user_data = await self.check_account_added(cur_accounts, profile)
+ if user_data is None:
+ followers, total = await self.get_all_followers(profile.id)
+ user_data = {"id":profile.id, "login":profile.login, "display_name":profile.display_name,
+ "followers":followers, "total_followers":total, "channels":[channel.id]}
+
+ cur_accounts.append(user_data)
+ await self.config.twitch_accounts.set(cur_accounts)
+ else:
+ cur_accounts.remove(user_data)
+ user_data["channels"].append(channel.id)
+ cur_accounts.append(user_data)
+ await self.config.twitch_accounts.set(cur_accounts)
+ await ctx.send("{} has been setup for twitch follow notifications in {}".format(
+ profile.display_name, channel.mention))
+
+ @twitchhelp.command(name="remfollow", aliases=["remove", "delete", "del"])
+ @checks.admin_or_permissions(manage_channels=True)
+ @commands.guild_only()
+ async def remove_follow(self, ctx, twitch_name=None, channel:discord.TextChannel=None):
+ """
+ Remove an account from follow notifications in the specified channel
+ defaults to the current channel
+ """
+ if channel is None:
+ channel = ctx.channel
+ try:
+ profile = await self.maybe_get_twitch_profile(ctx, twitch_name)
+ except TwitchError as e:
+ await ctx
+ cur_accounts = await self.config.twitch_accounts()
+ user_data = await self.check_account_added(cur_accounts, profile)
+ if user_data is None:
+ await ctx.send("{} is not currently posting follow notifications in {}".format(
+ profile.login, channel.mention))
+ return
+ else:
+ if channel.id not in user_data["channels"]:
+ await ctx.send("{} is not currently posting follow notifications in {}".format(
+ profile.login, channel.mention))
+ return
+ else:
+ cur_accounts.remove(user_data)
+ user_data["channels"].remove(channel.id)
+ if len(user_data["channels"]) == 0:
+ # We don't need to be checking if there's no channels to post in
+ await self.config.twitch_accounts.set(cur_accounts)
+ else:
+ cur_accounts.append(user_data)
+ await self.config.twitch_accounts.set(cur_accounts)
+ await ctx.send("Done, {}'s new followers won't be posted in {} anymore.".format(
+ profile.login, channel.mention))
+
+
+ @twitchhelp.command(name="set")
+ async def twitch_set(self, ctx, twitch_name):
+ """
+ Sets the twitch user info for individual users to make commands easier
+ """
+ profile = await self.get_profile_from_name(twitch_name)
+ await self.config.user(ctx.author).id.set(profile.id)
+ await self.config.user(ctx.author).login.set(profile.login)
+ await self.config.user(ctx.author).display_name.set(profile.display_name)
+ await ctx.send("{} set for you.".format(profile.display_name))
+
+ @twitchhelp.command(name="follows", aliases=["followers"])
+ async def get_user_follows(self, ctx, twitch_name:str=None):
+ """
+ Get latest Twitch followers
+ """
+ try:
+ profile = await self.maybe_get_twitch_profile(ctx, twitch_name)
+ except TwitchError as e:
+ await ctx.send(e)
+ return
+ new_url = "{}/users/follows?to_id={}&first=100".format(BASE_URL, profile.id)
+ data = await self.get_response(new_url)
+ follows = [TwitchFollower.from_json(x) for x in data["data"]]
+ total = data["total"]
+ await self.twitch_menu(ctx, follows, total)
+
+ @twitchhelp.command(name="user", aliases=["profile"])
+ async def get_user(self, ctx, twitch_name=None):
+ """
+ Shows basic Twitch profile information
+ """
+ try:
+ profile = await self.maybe_get_twitch_profile(ctx, twitch_name)
+ except TwitchError as e:
+ await ctx.send(e)
+ return
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = await self.make_user_embed(profile)
+ await ctx.send(embed=em)
+ else:
+ await ctx.send("https://twitch.tv/{}".format(profile.login))
+
+
+ async def twitch_menu(self, ctx: Context, post_list: list, total_followers=0,
+ message: discord.Message=None,
+ page=0, timeout: int=30):
+ """menu control logic for this taken from
+ https://github.com/Lunar-Dust/Dusty-Cogs/blob/master/menu/menu.py"""
+ user_id = post_list[page].from_id
+ followed_at = post_list[page].followed_at
+ url = "{}/users?id={}".format(BASE_URL, user_id)
+ header = {"Client-ID":await self.config.client_id()}
+ async with self.session.get(url, headers=header) as resp:
+ data = await resp.json()
+
+ profile = TwitchProfile.from_json(data)
+ if ctx.channel.permissions_for(ctx.me).embed_links:
+ em = await self.make_user_embed(profile)
+ em.timestamp = datetime.strptime(followed_at, "%Y-%m-%dT%H:%M:%SZ")
+ else:
+ em = None
+ prof_url = "https://twitch.tv/{}".format(profile.login)
+
+
+ if not message:
+ message = await ctx.send(prof_url, embed=em)
+ await message.add_reaction("⬅")
+ await message.add_reaction("❌")
+ await message.add_reaction("➡")
+ else:
+ # message edits don't return the message object anymore lol
+ await message.edit(content=prof_url, embed=em)
+ check = lambda react, user:user == ctx.message.author and react.emoji in ["➡", "⬅", "❌"] and react.message.id == message.id
+ try:
+ react, user = await ctx.bot.wait_for("reaction_add", check=check, timeout=timeout)
+ except asyncio.TimeoutError:
+ await message.remove_reaction("⬅", ctx.me)
+ await message.remove_reaction("❌", ctx.me)
+ await message.remove_reaction("➡", ctx.me)
+ return None
+ else:
+ if react.emoji == "➡":
+ next_page = 0
+ if page == len(post_list) - 1:
+ next_page = 0 # Loop around to the first item
+ else:
+ next_page = page + 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("➡", ctx.message.author)
+ return await self.twitch_menu(ctx, post_list, total_followers, message=message,
+ page=next_page, timeout=timeout)
+ elif react.emoji == "⬅":
+ next_page = 0
+ if page == 0:
+ next_page = len(post_list) - 1 # Loop around to the last item
+ else:
+ next_page = page - 1
+ if ctx.channel.permissions_for(ctx.me).manage_messages:
+ await message.remove_reaction("⬅", ctx.message.author)
+ return await self.twitch_menu(ctx, post_list, total_followers, message=message,
+ page=next_page, timeout=timeout)
+ else:
+ return await message.delete()
+
+ @commands.command(name="twitchcreds")
+ @checks.is_owner()
+ async def twitch_creds(self, ctx, client_id:str, client_secret:str=None):
+ """
+ Set twitch client_id and client_secret if required for larger followings
+
+ 1. Go to https://glass.twitch.tv/console/apps login and select Register Your Application
+ 2. Fillout the form with the OAuth redirect URL set to https://localhost
+ 3. Supply the client_id and client_secret to the bot
+ **Note:** client_secret is only necessary if you have more than 3000 followers
+ or you expect to be making more than 30 calls per minute to the API
+ """
+ await self.config.client_id.set(client_id)
+ if client_secret is not None:
+ await self.config.client_secret.set(client_secret)
+ await ctx.send("Twitch token set.")
+
+ def __unload(self):
+ if getattr(self, "loop", None) is not None:
+ self.loop.cancel()
+ self.bot.loop.create_task(self.session.close())
+
+ __del__ = __unload
diff --git a/twitch/twitch_follower.py b/twitch/twitch_follower.py
new file mode 100644
index 0000000..08d70dc
--- /dev/null
+++ b/twitch/twitch_follower.py
@@ -0,0 +1,10 @@
+class TwitchFollower:
+
+ def __init__(self, from_id:int, to_id:int, followed_at:str):
+ self.from_id = from_id
+ self.to_id = to_id
+ self.followed_at = followed_at
+
+ @classmethod
+ def from_json(cls, data:dict):
+ return cls(data["from_id"], data["to_id"], data["followed_at"])
\ No newline at end of file
diff --git a/twitch/twitch_profile.py b/twitch/twitch_profile.py
new file mode 100644
index 0000000..4c896ee
--- /dev/null
+++ b/twitch/twitch_profile.py
@@ -0,0 +1,40 @@
+class TwitchProfile:
+
+ def __init__(self, id:str, login:str, display_name:str, acc_type:str, broadcaster_type:str,
+ description:str, profile_image_url:str, offline_image_url:str, view_count:int):
+ self.id = id
+ self.login = login
+ self.display_name = display_name
+ self.acc_type = acc_type
+ self.broadcaster_type = broadcaster_type
+ self.description = description
+ self.profile_image_url = profile_image_url
+ self.offline_image_url = offline_image_url
+ self.view_count = view_count
+
+ def to_json(self, id:str, login:str, display_name:str, acc_type:str, broadcaster_type:str,
+ description:str, profile_image_url:str, offline_image_url:str, view_count:int):
+ return {
+ "id" : self.id,
+ "login" : self.login,
+ "display_name" : self.display_name,
+ "acc_type" : self.acc_type,
+ "broadcaster_type" : self.broadcaster_type,
+ "description" : self.description,
+ "profile_image_url" : self.profile_image_url,
+ "offline_image_url" : offline_image_url,
+ "view_count" : self.view_count
+ }
+
+ @classmethod
+ def from_json(cls, data:dict):
+ data = data["data"][0]
+ return cls(data["id"],
+ data["login"],
+ data["display_name"],
+ data["type"],
+ data["broadcaster_type"],
+ data["description"],
+ data["profile_image_url"],
+ data["offline_image_url"],
+ data["view_count"])
\ No newline at end of file
diff --git a/weather/__init__.py b/weather/__init__.py
new file mode 100644
index 0000000..90c06c9
--- /dev/null
+++ b/weather/__init__.py
@@ -0,0 +1,5 @@
+from .weather import Weather
+
+def setup(bot):
+ n = Weather(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/weather/info.json b/weather/info.json
new file mode 100644
index 0000000..0cbae4d
--- /dev/null
+++ b/weather/info.json
@@ -0,0 +1,22 @@
+{
+ "author":[
+ "TrustyJAID"
+ ],
+ "description":"Gathers weather data for a city.",
+ "install_msg":"gathers weather data.",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"weather",
+ "permissions":[
+ "embed_links"
+ ],
+ "requirements":[],
+ "short":"Weather",
+ "tags":[
+ "weather",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/weather/weather.py b/weather/weather.py
new file mode 100644
index 0000000..0ad8eee
--- /dev/null
+++ b/weather/weather.py
@@ -0,0 +1,134 @@
+import discord
+from redbot.core import commands, Config
+import datetime
+import aiohttp
+
+
+class Weather(getattr(commands, "Cog", object)):
+ """Get weather data from https://openweathermap.org"""
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 138475464)
+ default = {"units" : None}
+ self.config.register_guild(**default)
+ self.config.register_user(**default)
+ self.session = aiohttp.ClientSession(loop=self.bot.loop)
+ self.unit = {
+ "imperial": {"code": ["i", "f"], "speed": "mph", "temp": "°F"},
+ "metric": {"code": ["m", "c"], "speed": "km/h", "temp": "°C"},
+ "kelvin": {"code": ["k", "s"], "speed": "km/h", "temp": "°K"}}
+
+ @commands.command(name="weather", aliases=["we"])
+ async def weather(self, ctx, *, location):
+ """
+ Display weather in a given location
+
+ `location` must take the form of `city, Country Code`
+ example: `[p]weather New York,US`
+ """
+ await ctx.trigger_typing()
+ await self.get_weather(ctx, location)
+
+ @commands.group(name="weatherset")
+ async def weather_set(self, ctx):
+ """Set user or guild default units"""
+ pass
+
+ @weather_set.command(name="guild")
+ async def set_guild(self, ctx, units):
+ """
+ Sets the guild default weather units
+
+ `units` must be one of imperial, metric, or kelvin
+ """
+ guild = ctx.message.guild
+ if units.lower() in ["f", "imperial", "mph"]:
+ new_units = "imperial"
+ elif units.lower() in ["c", "metric", "kph"]:
+ new_units = "metric"
+ elif units.lower() in ["k", "kelvin"]:
+ new_units = "kelvin"
+ else:
+ await ctx.send(f"{units} is not a vaild option!")
+ return
+
+ await self.config.guild(guild).units.set(new_units)
+ await ctx.send("Default units set to {} in {}.".format(new_units, guild.name))
+
+ @weather_set.command(name="user")
+ async def set_user(self, ctx, units):
+ """
+ Sets the user default weather units
+
+ `units` must be one of imperial, metric, or kelvin
+ Note: User settings override guild settings.
+ """
+ author = ctx.message.author
+ if units.lower() in ["f", "imperial", "mph"]:
+ new_units = "imperial"
+ elif units.lower() in ["c", "metric", "kph"]:
+ new_units = "metric"
+ elif units.lower() in ["k", "kelvin"]:
+ new_units = "kelvin"
+ else:
+ await ctx.send(f"{units} is not a vaild option!")
+ return
+
+ await self.config.user(author).units.set(new_units)
+ await ctx.send("Default units set to {} in {}.".format(new_units, author.name))
+
+ async def get_weather(self, ctx, location):
+ guild = ctx.message.guild
+ author = ctx.message.author
+ guild_units = await self.config.guild(guild).units()
+ user_units = await self.config.user(author).units()
+ units = "imperial"
+ if guild_units != units and guild_units is not None:
+ units = guild_units
+ if user_units != units and user_units is not None:
+ units = user_units
+
+ if units == "kelvin":
+ url = "http://api.openweathermap.org/data/2.5/weather?q={0}&appid=88660f6af079866a3ef50f491082c386&units=metric".format(location)
+ else:
+ url = "http://api.openweathermap.org/data/2.5/weather?q={0}&appid=88660f6af079866a3ef50f491082c386&units={1}".format(location, units)
+ async with self.session.get(url) as resp:
+ data = await resp.json()
+ try:
+ if data["message"] == "city not found":
+ await ctx.send("City not found.")
+ return
+ except:
+ pass
+ currenttemp = data["main"]["temp"]
+ mintemp = data["main"]["temp_min"]
+ maxtemp = data["main"]["temp_max"]
+ city = data["name"]
+ country = data["sys"]["country"]
+ lat, lon = data["coord"]["lat"], data["coord"]["lon"]
+ condition = ', '.join(info["main"] for info in data["weather"])
+ windspeed = str(data["wind"]["speed"]) + " " + self.unit[units]["speed"]
+ if units == "kelvin":
+ currenttemp = abs(currenttemp - 273.15)
+ mintemp = abs(maxtemp - 273.15)
+ maxtemp = abs(maxtemp - 273.15)
+ sunrise = datetime.datetime.fromtimestamp(data["sys"]["sunrise"]).strftime("%H:%M")
+ sunset = datetime.datetime.fromtimestamp(data["sys"]["sunset"]).strftime("%H:%M")
+ embed = discord.Embed(colour=discord.Colour.blue())
+ embed.add_field(name="🌍 **Location**", value="{0}, {1}".format(city, country))
+ embed.add_field(name="📏 **Lat,Long**", value="{0}, {1}".format(lat, lon))
+ embed.add_field(name="☁ **Condition**", value=condition)
+ embed.add_field(name="😓 **Humidity**", value=data["main"]["humidity"])
+ embed.add_field(name="💨 **Wind Speed**", value="{0}".format(windspeed))
+ embed.add_field(name="🌡 **Temperature**", value="{0:.2f}{1}"
+ .format(currenttemp, self.unit[units]["temp"]))
+ embed.add_field(name="🔆 **Min - Max**", value="{0:.2f}{1} to {2:.2f}{3}"
+ .format(mintemp, self.unit[units]["temp"], maxtemp, self.unit[units]["temp"]))
+ embed.add_field(name="🌄 **Sunrise (UTC)**", value=sunrise)
+ embed.add_field(name="🌇 **Sunset (UTC)**", value=sunset)
+ embed.set_footer(text="Powered by https://openweathermap.org")
+ await ctx.send(embed=embed)
+
+ def __unload(self):
+ self.bot.loop.create_task(self.session.close())
diff --git a/welcome/__init__.py b/welcome/__init__.py
new file mode 100644
index 0000000..b805f47
--- /dev/null
+++ b/welcome/__init__.py
@@ -0,0 +1,5 @@
+from .welcome import Welcome
+
+def setup(bot):
+ n = Welcome(bot)
+ bot.add_cog(n)
\ No newline at end of file
diff --git a/welcome/info.json b/welcome/info.json
new file mode 100644
index 0000000..6ec7cdc
--- /dev/null
+++ b/welcome/info.json
@@ -0,0 +1,21 @@
+{
+ "author":[
+ "irdumb",
+ "TrustyJAID"
+ ],
+ "description":"Welcome new users to the server",
+ "install_msg":"welcome",
+ "min_python_version":[
+ 3,
+ 6,
+ 2
+ ],
+ "name":"welcome",
+ "permissions":[],
+ "requirements":[],
+ "short":"Welcome new users to the server",
+ "tags":[
+ "welcome",
+ "utility"
+ ]
+}
\ No newline at end of file
diff --git a/welcome/welcome.py b/welcome/welcome.py
new file mode 100644
index 0000000..4b7ccd2
--- /dev/null
+++ b/welcome/welcome.py
@@ -0,0 +1,356 @@
+import discord
+from redbot.core import commands
+from redbot.core import Config
+from redbot.core import checks
+from redbot.core.utils.chat_formatting import pagify
+from copy import deepcopy
+import os
+from random import choice as rand_choice
+
+
+default_greeting = "Welcome {0.name} to {1.name}!"
+default_settings = {"GREETING": [default_greeting], "ON": False,
+ "CHANNEL": None, "WHISPER": False,
+ "BOTS_MSG": None, "BOTS_ROLE": None, "EMBED":False}
+settings_path = "data/welcome/settings.json"
+
+
+class Welcome(getattr(commands, "Cog", object)):
+ """Welcomes new members to the guild in the default channel rewritten for V3 from
+ https://github.com/irdumbs/Dumb-Cogs/blob/master/welcome/welcome.py"""
+
+ def __init__(self, bot):
+ self.bot = bot
+ self.config = Config.get_conf(self, 144465786453)
+ self.config.register_guild(**default_settings)
+
+ @commands.group(no_pm=True)
+ @checks.admin_or_permissions(manage_channels=True)
+ async def welcomeset(self, ctx):
+ """Sets welcome module settings"""
+ guild = ctx.message.guild
+ if ctx.invoked_subcommand is None:
+ msg = "```"
+ msg += "Random GREETING: {}\n".format(rand_choice(await self.config.guild(guild).GREETING()))
+ msg += "CHANNEL: #{}\n".format(await self.config.guild(guild).CHANNEL())
+ msg += "ON: {}\n".format(await self.config.guild(guild).ON())
+ msg += "WHISPER: {}\n".format(await self.config.guild(guild).WHISPER())
+ msg += "BOTS_MSG: {}\n".format(await self.config.guild(guild).BOTS_MSG())
+ msg += "BOTS_ROLE: {}\n".format(await self.config.guild(guild).BOTS_ROLE())
+ msg += "EMBED: {}\n".format(await self.config.guild(guild).EMBED())
+ msg += "```"
+ await ctx.send(msg)
+
+ @welcomeset.group(name="msg")
+ async def welcomeset_msg(self, ctx):
+ """Manage welcome messages
+ """
+ if ctx.invoked_subcommand is None or \
+ isinstance(ctx.invoked_subcommand, commands.Group):
+ return
+
+ @welcomeset_msg.command(name="add", no_pm=True)
+ async def welcomeset_msg_add(self, ctx, *, format_msg):
+ """Adds a welcome message format for the guild to be chosen at random
+
+ {0} is user
+ {1} is guild
+ Default is set to:
+ Welcome {0.name} to {1.name}!
+
+ Example formats:
+ {0.mention}.. What are you doing here?
+ {1.name} has a new member! {0.name}#{0.discriminator} - {0.id}
+ Someone new joined! Who is it?! D: IS HE HERE TO HURT US?!"""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).GREETING()
+ guild_settings.append(format_msg)
+ await self.config.guild(guild).GREETING.set(guild_settings)
+ await ctx.send("Welcome message added for the guild.")
+ await self.send_testing_msg(ctx, msg=format_msg)
+
+ @welcomeset_msg.command(name="del", no_pm=True)
+ async def welcomeset_msg_del(self, ctx):
+ """Removes a welcome message from the random message list
+ """
+ guild = ctx.message.guild
+ author = ctx.message.author
+ guild_settings = await self.config.guild(guild).GREETING()
+ msg = 'Choose a welcome message to delete:\n\n'
+ for c, m in enumerate(guild_settings):
+ msg += " {}. {}\n".format(c, m)
+ for page in pagify(msg, ['\n', ' '], shorten_by=20):
+ await ctx.send("```\n{}\n```".format(page))
+ check = lambda message:message.author == ctx.message.author and message.channel == ctx.message.channel
+ try:
+ answer = await self.bot.wait_for("message", check=check, timeout=120)
+ except asyncio.TimeoutError:
+ return
+ try:
+ num = int(answer.content)
+ choice = guild_settings.pop(num)
+ except:
+ await ctx.send("That's not a number in the list :/")
+ return
+ if not guild_settings:
+ guild_settings = [default_greeting]
+ await self.config.guild(guild).GREETING.set(guild_settings)
+ await ctx.send("**This message was deleted:**\n{}".format(choice))
+
+ @welcomeset_msg.command(name="list", no_pm=True)
+ async def welcomeset_msg_list(self, ctx):
+ """Lists the welcome messages of this guild
+ """
+ guild = ctx.message.guild
+ msg = 'Welcome messages:\n\n'
+ guild_settings = await self.config.guild(guild).GREETING()
+ for c, m in enumerate(guild_settings):
+ msg += " {}. {}\n".format(c, m)
+ for page in pagify(msg, ['\n', ' '], shorten_by=20):
+ await ctx.send("```\n{}\n```".format(page))
+
+ @welcomeset.command(pass_context=True)
+ async def toggle(self, ctx):
+ """Turns on/off welcoming new users to the guild"""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).ON()
+ guild_settings = not guild_settings
+ if guild_settings:
+ await ctx.send("I will now welcome new users to the guild.")
+ await self.send_testing_msg(ctx)
+ else:
+ await ctx.send("I will no longer welcome new users.")
+ await self.config.guild(guild).ON.set(guild_settings)
+
+ @welcomeset.command(pass_context=True)
+ async def channel(self, ctx, channel : discord.TextChannel=None):
+ """Sets the channel to send the welcome message
+
+ If channel isn't specified, the guild's default channel will be used"""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).CHANNEL()
+ if channel is None:
+ channel = ctx.message.channel
+ if not guild.get_member(self.bot.user.id
+ ).permissions_in(channel).send_messages:
+ await ctx.send("I do not have permissions to send "
+ "messages to {0.mention}".format(channel))
+ return
+ guild_settings = channel.id
+ await self.config.guild(guild).CHANNEL.set(guild_settings)
+ channel = self.get_welcome_channel(guild, guild_settings)
+ await channel.send("I will now send welcome "
+ "messages to {0.mention}".format(channel))
+ await self.send_testing_msg(ctx)
+
+ @welcomeset.group(name="bot", no_pm=True)
+ async def welcomeset_bot(self, ctx):
+ """Special welcome for bots"""
+ if ctx.invoked_subcommand is None or \
+ isinstance(ctx.invoked_subcommand, commands.Group):
+ return
+
+ @welcomeset_bot.command(name="msg", no_pm=True)
+ async def welcomeset_bot_msg(self, ctx, *, format_msg=None):
+ """Set the welcome msg for bots.
+
+ Leave blank to reset to regular user welcome"""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).BOTS_MSG()
+ guild_settings = format_msg
+ await self.config.guild(guild).BOTS_MSG.set(guild_settings)
+ if format_msg is None:
+ await ctx.send("Bot message reset. Bots will now be welcomed as regular users.")
+ else:
+ await ctx.send("Bot welcome message set for the guild.")
+ await self.send_testing_msg(ctx, bot=True, msg=format_msg)
+
+ # TODO: Check if have permissions
+ @welcomeset_bot.command(name="role", no_pm=True)
+ async def welcomeset_bot_role(self, ctx, role: discord.Role=None):
+ """Set the role to put bots in when they join.
+
+ Leave blank to not give them a role."""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).BOTS_ROLE()
+ guild_settings = role.id if role else role
+ await self.config.guild(guild).BOTS_ROLE.set(guild_settings)
+ await ctx.send("Bots that join this guild will "
+ "now be put into the {} role".format(role.name))
+
+ @welcomeset.command(pass_context=True)
+ async def whisper(self, ctx, choice: str=None):
+ """Sets whether or not a DM is sent to the new user
+
+ Options:
+ off - turns off DMs to users
+ only - only send a DM to the user, don't send a welcome to the channel
+ both - send a message to both the user and the channel
+
+ If Option isn't specified, toggles between 'off' and 'only'
+ DMs will not be sent to bots"""
+ options = {"off": False, "only": True, "both": "BOTH"}
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).WHISPER()
+ if choice is None:
+ guild_settings = not guild_settings
+ elif choice.lower() not in options:
+ await ctx.send_help()
+ return
+ else:
+ guild_settings = options[choice.lower()]
+ await self.config.guild(guild).WHISPER.set(guild_settings)
+ channel = self.get_welcome_channel(guild, guild_settings)
+ if not guild_settings:
+ await ctx.send("I will no longer send DMs to new users")
+ elif guild_settings == "BOTH":
+ await ctx.send("I will now send welcome "
+ "messages to {0.mention} as well as to "
+ "the new user in a DM".format(ctx.channel))
+ else:
+ await ctx.send("I will now only send "
+ "welcome messages to the new user "
+ "as a DM")
+ await self.send_testing_msg(ctx)
+
+ @welcomeset.command(pass_context=True)
+ async def embed(self, ctx):
+ """Turns on/off embed messages"""
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).EMBED()
+ guild_settings = not guild_settings
+ if guild_settings:
+ await self.config.guild(guild).EMBED.set(guild_settings)
+ await ctx.send("I will now welcome new users to the guild in embeds.")
+ await self.send_testing_msg(ctx)
+ else:
+ await self.config.guild(guild).EMBED.set(guild_settings)
+ await ctx.send("I will test without embedds.")
+ await self.send_testing_msg(ctx)
+
+ async def make_embed(self, member:discord.Member, msg:str):
+ em = discord.Embed(description=msg.format(member, member.guild),timestamp=member.joined_at)
+ em.set_author(name=member.name+"#"+member.discriminator, icon_url=member.avatar_url)
+ em.set_thumbnail(url=member.avatar_url_as(format='png'))
+ return em
+
+
+ async def on_member_join(self, member):
+ guild = member.guild
+ if not await self.config.guild(guild).ON():
+ return
+ if guild is None:
+ print("guild is None. Private Message or some new fangled "
+ "Discord thing?.. Anyways there be an error, "
+ "the user was {}".format(member.name))
+ return
+
+ only_whisper = await self.config.guild(guild).WHISPER() is True
+ bot_welcome = member.bot and await self.config.guild(guild).BOTS_MSG()
+ bot_role = member.bot and await self.config.guild(guild).BOTS_ROLE()
+ msg = bot_welcome or rand_choice(await self.config.guild(guild).GREETING())
+ is_embed = await self.config.guild(guild).EMBED()
+
+ # whisper the user if needed
+ if not member.bot and await self.config.guild(guild).WHISPER():
+ try:
+ if is_embed:
+ em = await self.make_embed(member, msg)
+ await member.send(embed=em)
+ else:
+ await member.send(msg.format(member, guild))
+ except:
+ print("welcome.py: unable to whisper {}. Probably "
+ "doesn't want to be PM'd".format(member))
+ # grab the welcome channel
+ #guild_settings = await self.config.guild(guild).guild_settings()
+ channel = self.bot.get_channel(await self.config.guild(guild).CHANNEL())
+ if channel is None: # complain even if only whisper
+ print('welcome.py: Channel not found. It was most '
+ 'likely deleted. User joined: {}'.format(member.name))
+ return
+ # we can stop here
+
+ if not self.speak_permissions(guild, channel.id):
+ print("Permissions Error. User that joined: "
+ "{0.name}".format(member))
+ print("Bot doesn't have permissions to send messages to "
+ "{0.name}'s #{1.name} channel".format(guild, channel))
+ return
+ # try to add role if needed
+ if bot_role:
+ try:
+ role = guild.get_role(bot_role)
+ await member.add_roles(role)
+ except Exception as e:
+ print(e)
+ print('welcome.py: unable to add {} role to {}. '
+ 'Role was deleted, network error, or lacking '
+ 'permissions'.format(bot_role, member))
+ else:
+ print('welcome.py: added {} role to '
+ 'bot, {}'.format(role, member))
+
+ if only_whisper and not bot_welcome:
+ return
+ if bot_welcome:
+ # finally, welcome them
+ if is_embed:
+ em = await self.make_embed(member, bot_welcome)
+ await channel.send(embed=em)
+ else:
+ await channel.send(bot_welcome.format(member, guild))
+ elif not member.bot:
+ if is_embed:
+ em = await self.make_embed(member, msg)
+ await channel.send(embed=em)
+ else:
+ await channel.send(msg.format(member, guild))
+
+ def get_welcome_channel(self, guild, guild_settings):
+ try:
+ return guild.get_channel(guild_settings)
+ except:
+ return None
+
+ def speak_permissions(self, guild, guild_settings):
+ channel = self.get_welcome_channel(guild, guild_settings)
+ if channel is None:
+ return False
+ return guild.get_member(self.bot.user.id
+ ).permissions_in(channel).send_messages
+
+ async def send_testing_msg(self, ctx, bot=False, msg=None):
+ guild = ctx.message.guild
+ guild_settings = await self.config.guild(guild).guild_settings()
+ # print(guild_settings)
+ channel = self.get_welcome_channel(guild, await self.config.guild(guild).CHANNEL())
+ rand_msg = msg or rand_choice(await self.config.guild(guild).GREETING())
+ is_embed = await self.config.guild(guild).EMBED()
+ member = ctx.message.author
+ whisper_settings = await self.config.guild(guild).WHISPER()
+ if channel is None and whisper_settings not in ["BOTH", True]:
+ await ctx.send("I can't find the specified channel. "
+ "It might have been deleted.")
+ return
+ await ctx.send("`Sending a testing message to "
+ "`{0.mention}".format(channel))
+ if self.speak_permissions(guild, await self.config.guild(guild).CHANNEL()):
+ msg = await self.config.guild(guild).BOTS_MSG() if bot else rand_msg
+ print(msg)
+ if not bot and await self.config.guild(guild).WHISPER():
+ if is_embed:
+ em = await self.make_embed(member, msg)
+ await ctx.author.send(embed=em)
+ else:
+ await ctx.author.send(msg.format(member, guild))
+ if bot or whisper_settings is not True:
+ if is_embed:
+ em = await self.make_embed(member, msg)
+ await channel.send(embed=em)
+ else:
+ await channel.send(msg.format(member, guild))
+ else:
+ await ctx.send("I do not have permissions "
+ "to send messages to "
+ "{0.mention}".format(channel))