Testing/CI #21
+9
-4
@@ -28,6 +28,14 @@ class General(commands.Cog):
|
|||||||
def __check(self, ctx): #Todo: Is dit het porno kanaal?
|
def __check(self, ctx): #Todo: Is dit het porno kanaal?
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def get_emoji_embed(self, tag: str):
|
||||||
|
emoji = re.search(".*\<\:([A-z]*)\:(\d*)\>.*", tag)
|
||||||
|
embed = discord.Embed(title=emoji.group(1), type='photo')
|
||||||
|
hugemoji = 'https://cdn.discordapp.com/emojis/' + emoji.group(2) + '.png'
|
||||||
|
embed.set_image(url=hugemoji)
|
||||||
|
return embed
|
||||||
|
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def huge(self, ctx, *, arg):
|
def huge(self, ctx, *, arg):
|
||||||
@@ -35,10 +43,7 @@ class General(commands.Cog):
|
|||||||
Bijvoorbeeld:
|
Bijvoorbeeld:
|
||||||
!huge :ancilla:
|
!huge :ancilla:
|
||||||
"""
|
"""
|
||||||
id = re.search("\<\:([A-z]*)\:(\d*)\>", arg)
|
em = self.get_emoji_embed(arg)
|
||||||
hugemoji = 'https://cdn.discordapp.com/emojis/' + id.group(2) + '.png'
|
|
||||||
em = discord.Embed(title=id.group(1), type='photo')
|
|
||||||
em.set_image(url=hugemoji)
|
|
||||||
try:
|
try:
|
||||||
yield from ctx.message.delete()
|
yield from ctx.message.delete()
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import random
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import dotenv
|
import dotenv
|
||||||
|
import re
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
@@ -42,3 +43,7 @@ class TestGeneral(unittest.TestCase):
|
|||||||
post = self.cog.get_kopieerpasta()
|
post = self.cog.get_kopieerpasta()
|
||||||
self.assertIsInstance(post.url, str)
|
self.assertIsInstance(post.url, str)
|
||||||
|
|
||||||
|
def test_huge(self):
|
||||||
|
embed = self.cog.get_emoji_embed("<:test:123456789>")
|
||||||
|
self.assertIsInstance(embed, discord.Embed)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user