blob: 20ae77c1f32282ef8ce5147004747b895fff0d44 (
plain)
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
|
import discord
from discord.ext import commands
from discord.ext.commands import Context as CommandContext
from query import parse
class StreamCog(object):
def __init__(self, bot):
self.bot: commands.Bot = bot
@commands.command()
async def stream(self, ctx: CommandContext, *, to_eval):
val = parse(to_eval,
guild=ctx.guild,
channel=ctx.channel,
author=ctx.author,
bot=self.bot,
client=self.bot,
discord=discord,
)
await ctx.send(repr(val))
def setup(bot: commands.Bot):
bot.add_cog(StreamCog(bot))
|