Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"grinning": { | |
"emoji": "\ud83d\ude00" | |
}, | |
"smiley": { | |
"emoji": "\ud83d\ude03" | |
}, | |
"smile": { | |
"emoji": "\ud83d\ude04" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from discord.ext import commands | |
#cogs must now subclass commands.Cog | |
class MyCog(commands.Cog): | |
def __init__(self, bot): | |
self.bot = bot | |
#listeners now must have a decorator | |
@commands.Cog.listener() | |
async def on_message(self, message): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(?:\U0001f1e6[\U0001f1e8-\U0001f1ec\U0001f1ee\U0001f1f1\U0001f1f2\U0001f1f4\U0001f1f6-\U0001f1fa\U0001f1fc\U0001f1fd\U0001f1ff])|(?:\U0001f1e7[\U0001f1e6\U0001f1e7\U0001f1e9-\U0001f1ef\U0001f1f1-\U0001f1f4\U0001f1f6-\U0001f1f9\U0001f1fb\U0001f1fc\U0001f1fe\U0001f1ff])|(?:\U0001f1e8[\U0001f1e6\U0001f1e8\U0001f1e9\U0001f1eb-\U0001f1ee\U0001f1f0-\U0001f1f5\U0001f1f7\U0001f1fa-\U0001f1ff])|(?:\U0001f1e9[\U0001f1ea\U0001f1ec\U0001f1ef\U0001f1f0\U0001f1f2\U0001f1f4\U0001f1ff])|(?:\U0001f1ea[\U0001f1e6\U0001f1e8\U0001f1ea\U0001f1ec\U0001f1ed\U0001f1f7-\U0001f1fa])|(?:\U0001f1eb[\U0001f1ee-\U0001f1f0\U0001f1f2\U0001f1f4\U0001f1f7])|(?:\U0001f1ec[\U0001f1e6\U0001f1e7\U0001f1e9-\U0001f1ee\U0001f1f1-\U0001f1f3\U0001f1f5-\U0001f1fa\U0001f1fc\U0001f1fe])|(?:\U0001f1ed[\U0001f1f0\U0001f1f2\U0001f1f3\U0001f1f7\U0001f1f9\U0001f1fa])|(?:\U0001f1ee[\U0001f1e8-\U0001f1ea\U0001f1f1-\U0001f1f4\U0001f1f6-\U0001f1f9])|(?:\U0001f1ef[\U0001f1ea\U0001f1f2\U0001f1f4\U0001f1f5])|(?:\U0001f1f0[\U0001f1ea\U0001f1ec-\U0001f1ee\U0001f1f2\U0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
import sys, traceback | |
"""This is a multi file example showcasing many features of the command extension and the use of cogs. | |
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic | |
understanding and platform for creating your own bot. | |
These examples make use of Python 3.6.2 and the rewrite version on the lib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"grinning": "\ud83d\ude00", | |
"smiley": "\ud83d\ude03", | |
"smile": "\ud83d\ude04", | |
"grin": "\ud83d\ude01", | |
"laughing": "\ud83d\ude06", | |
"satisfied": "\ud83d\ude06", | |
"face_holding_back_tears": "\ud83e\udd79", | |
"sweat_smile": "\ud83d\ude05", | |
"joy": "\ud83d\ude02", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import asyncio | |
import re | |
from discord.ext import commands | |
import sys | |
import traceback | |
time_regex = re.compile("(?:(\d{1,5})(h|s|m|d))+?") | |
time_dict = {"h":3600, "s":1, "m":60, "d":86400} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
import sys | |
from discord.ext import commands | |
import discord | |
class CommandErrorHandler: | |
def __init__(self, bot): | |
self.bot = bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from discord.ext import commands | |
from PIL import Image, ImageDraw, ImageFont | |
import aiohttp | |
import io | |
import re | |
@commands.command(pass_context=True) | |
async def angry(self, ctx, *, string='missing\n arguments'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import aiohttp | |
import re | |
def nexus_json_to_embed(json_data, game_name): | |
title = json_data.get('name', '')[:256] | |
# replace html escapes with ascii values. ex- " turns into quotes | |
description = re.sub(r'&#(\d{2});', lambda x: chr(int(x.group(1))), json_data.get('summary', '')[:1024]) | |
url = json_data.get('mod_page_uri', '') |
NewerOlder