<commit_before>
import discord
from discord import app_commands
from discord.ext import commands

import asyncio

from modules import utilities
from utilities import checks

async def setup(bot):
	
	def emoji_wrapper(emoji):
		async def emoji_command(self, ctx):
			await ctx.embed_reply(f":{emoji}:")
		return emoji_command
	
	for emoji in (
		"frog", "turtle", "gun", "tomato", "cucumber", "eggplant", "lizard",
		"minidisc", "horse", "penguin", "dragon", "eagle", "bird"
	):
		command = commands.Command(
			emoji_wrapper(emoji), name = emoji,
			help = emoji.capitalize() + " emoji",
			checks = [checks.not_forbidden().predicate]
		)
		setattr(Misc, emoji, command)
		Misc.__cog_commands__.append(command)
	for name, emoji in (("cow", "cow2"), ("panda", "panda_face")):
		command = commands.Command(
			emoji_wrapper(emoji), name = name,
			help = name.capitalize() + " emoji",
			checks = [checks.not_forbidden().predicate]
		)
		setattr(Misc, name, command)
		Misc.__cog_commands__.append(command)
	
	await bot.add_cog(Misc(bot))

class Misc(commands.Cog):
	
	def __init__(self, bot):
		self.bot = bot
	
	async def cog_load(self):
		await self.bot.connect_to_database()
		await self.bot.db.execute("CREATE SCHEMA IF NOT EXISTS pokes")
		await self.bot.db.execute(
			"""
			CREATE TABLE IF NOT EXISTS pokes.pokes (
				poker			BIGINT, 
				pokee			BIGINT, 
				count			INT, 
				PRIMARY KEY		(poker, pokee)
			)
			"""
		)
	
	async def cog_check(self, ctx):
		return await checks.not_forbidden().predicate(ctx)
	
	@commands.command(aliases = ["bigmote"])
	async def bigmoji(self, ctx, emoji: discord.PartialEmoji):<commit_msg>[Discord] Update and improve emoji commands implementation<commit_after>
import discord
from discord import app_commands
from discord.ext import commands

import asyncio

from modules import utilities
from utilities import checks

def emoji_wrapper(emoji):
	async def emoji_command(self, ctx):
		await ctx.embed_reply(f":{emoji}:")
	return emoji_command

class EmojiCommand(commands.Command):
	
	def __init__(self, *args, emoji = None, name = None):
		super().__init__(
			emoji_wrapper(emoji),
			name = name or emoji,
			help = (name or emoji).capitalize() + " emoji",
			checks = [checks.not_forbidden().predicate]
		)
		self.params = {}

async def setup(bot):
	
	for emoji in (
		"frog", "turtle", "gun", "tomato", "cucumber", "eggplant", "lizard",
		"minidisc", "horse", "penguin", "dragon", "eagle", "bird"
	):
		command = EmojiCommand(emoji = emoji)
		setattr(Misc, emoji, command)
		Misc.__cog_commands__.append(command)
	for name, emoji in (("cow", "cow2"), ("panda", "panda_face")):
		command = EmojiCommand(emoji = emoji, name = name)
		setattr(Misc, name, command)
		Misc.__cog_commands__.append(command)
	
	await bot.add_cog(Misc(bot))

class Misc(commands.Cog):
	
	def __init__(self, bot):
		self.bot = bot
	
	async def cog_load(self):
		await self.bot.connect_to_database()
		await self.bot.db.execute("CREATE SCHEMA IF NOT EXISTS pokes")
		await self.bot.db.execute(
			"""
			CREATE TABLE IF NOT EXISTS pokes.pokes (
				poker			BIGINT, 
				pokee			BIGINT, 
				count			INT, 
				PRIMARY KEY		(poker, pokee)
			)
			"""
		)
	
	async def cog_check(self, ctx):
		return await checks.not_forbidden().predicate(ctx)
	
	@commands.command(aliases = ["bigmote"])
	async def bigmoji(self, ctx, emoji: discord.PartialEmoji):
{'fraction_non_alphanumeric': 0.13428401663695783, 'fraction_numerical': 0.0005941770647653001, 'mean_word_length': 4.244548286604362, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '71874', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1254, 'n_words': 296}