diff options
author | NoirPi <34034616+NoirPi@users.noreply.github.com> | 2019-04-27 13:49:23 +0200 |
---|---|---|
committer | NoirPi <34034616+NoirPi@users.noreply.github.com> | 2019-04-27 13:49:23 +0200 |
commit | 9fad5eaa97d20479c1a4a105fe47277968f67469 (patch) | |
tree | 5366c0371e179c199351c69b6083b3f0b767a91f /modules/execute.py | |
parent | 55c6967967c91a3259e9af67ba61dcfdaaff5f9e (diff) | |
download | evalbot-9fad5eaa97d20479c1a4a105fe47277968f67469.tar.gz evalbot-9fad5eaa97d20479c1a4a105fe47277968f67469.tar.bz2 evalbot-9fad5eaa97d20479c1a4a105fe47277968f67469.zip |
Updated Bot to latest github.com Version of discord.py
Version Number: 1.1.0a1886+ga7f3300
Added guild variable
Added print if reload throws Exceptions
Signed-off-by: NoirPi <34034616+NoirPi@users.noreply.github.com>
Diffstat (limited to 'modules/execute.py')
-rw-r--r-- | modules/execute.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/execute.py b/modules/execute.py index 21e8fa3..2f7b293 100644 --- a/modules/execute.py +++ b/modules/execute.py @@ -3,13 +3,15 @@ from collections import defaultdict from datetime import datetime, timedelta from typing import Pattern -from discord import Embed, Message, Guild, TextChannel, Member +from discord import Embed, Guild, Member, Message, TextChannel +from discord.ext import commands from discord.ext.commands import Bot from compile_api import execute CODE_BLOCK_REGEX: Pattern = re.compile("```(?P<lang>.*)\n(?P<code>[\\s\\S]*?)```") -INPUT_BLOCK_REGEX: Pattern = re.compile("input[: \t\n]*```(?P<lang>.*)?\n(?P<text>[\\s\\S]*?)```", re.IGNORECASE) +INPUT_BLOCK_REGEX: Pattern = \ + re.compile("input[: \t\n]*```(?P<lang>.*)?\n(?P<text>[\\s\\S]*?)```", re.IGNORECASE) PYTHON_3 = 24 NODEJS = 17 @@ -56,7 +58,7 @@ languages = { } -class ExecuteCog(object): +class ExecuteCog(commands.Cog, object): def __init__(self, bot: Bot): self.bot: Bot = bot self.last_messaged = defaultdict(lambda: datetime.fromtimestamp(0)) @@ -89,7 +91,7 @@ class ExecuteCog(object): embed=Embed( description=f"You are not allowed to eval code again. Check again in " f"{(timedelta(seconds=30)-delta).seconds}secs")) - if not author.guild_permissions.manage_messages and not author.id == 310702108997320705: + if not author.guild_permissions.manage_messages and not author.id == 280766063472541697: self.last_messaged[author.id] = datetime.now() language = languages[lang] print(language) |