better emojis (in-progress)

howdoi
bobloy 7 years ago
parent 2bee857145
commit 129eb38f8d

@ -20,4 +20,3 @@ def setup(bot):
# check_files() # check_files()
n = Fight(bot) n = Fight(bot)
bot.add_cog(n) bot.add_cog(n)
bot.add_listener(n._on_react, "on_reaction_add")

@ -19,7 +19,7 @@ T_TYPES = {0: "Round Robin", 1: "Single Elimination",
2: "Double Elimination", 3: "Triple Elimination", 2: "Double Elimination", 3: "Triple Elimination",
4: "3 Game Guarentee", 5: "Compass Draw"} 4: "3 Game Guarentee", 5: "Compass Draw"}
E_REACTS = {"WIN": ,"LOSS": , "DISPUTE": }
class Fight: class Fight:
@ -32,7 +32,10 @@ class Fight:
# self.the_data = dataIO.load_json(self.file_path) # self.the_data = dataIO.load_json(self.file_path)
self.config = Config.get_conf(self, identifier=49564952847684) self.config = Config.get_conf(self, identifier=49564952847684)
default_global = { default_global = {
"srtracker": {} "srtracker": {},
"win": None,
"loss": None,
"dispute": None
} }
default_guild = { default_guild = {
"current": None, "current": None,
@ -75,7 +78,7 @@ class Fight:
"TID": None, "TID": None,
"MID": None, "MID": None,
"RID": None, "RID": None,
"GUILDID", None "GUILDID": None
} }
self.config.register_global(**default_global) self.config.register_global(**default_global)
self.config.register_guild(**default_guild) self.config.register_guild(**default_guild)
@ -90,6 +93,8 @@ class Fight:
# return m.author == ctx.author and m.channel == ctx.channel # return m.author == ctx.author and m.channel == ctx.channel
# ************************Fight command group start************************ # ************************Fight command group start************************
@commands.group() @commands.group()
@commands.guild_only() @commands.guild_only()
async def fight(self, ctx): async def fight(self, ctx):
@ -230,6 +235,27 @@ class Fight:
await ctx.send_help() await ctx.send_help()
# await ctx.send("I can do stuff!") # await ctx.send("I can do stuff!")
@fightset.command(name="emoji")
async def fightset_emoji(self, ctx, winEmoji: discord.Emoji, lossEmoji: discord.Emoji, disputeEmoji: discord.Emoji):
"""Set the global emojis for reactions"""
message = await ctx.send("Testing emojis")
# try:
await ctx.send(str(winEmoji) + " | " + str(lossEmoji) + " | " + str(disputeEmoji))
await message.add_reaction(str(winEmoji))
await message.add_reaction(str(lossEmoji))
await message.add_reaction(str(disputeEmoji))
# except:
# await ctx.send("Emoji failure")
# return
await self.config.win.set(str(winEmoji))
await self.config.loss.set(str(lossEmoji))
await self.config.dispute.set(str(lossEmoji))
await ctx.send("Success")
@fightset.command(name="reset") @fightset.command(name="reset")
async def fightset_reset(self, ctx): async def fightset_reset(self, ctx):
"""Clears all data, be careful!""" """Clears all data, be careful!"""
@ -738,7 +764,7 @@ class Fight:
outembed=discord.Embed(title="Match ID: " + mID, color=0x0000bf) outembed=discord.Embed(title="Match ID: " + mID, color=0x0000bf)
outembed.add_field(name="Team 1", value=mention1, inline=True) outembed.add_field(name="Team 1", value=mention1, inline=True)
outembed.add_field(name="Team 2", value=mention2, inline=True) outembed.add_field(name="Team 2", value=mention2, inline=True)
outembed.set_footer(text=E_REACTS["WIN"]+" Report Win || "E_REACTS["LOSS"]+" Report Loss || "E_REACTS["DISPUTE"]+" Dispute Result") outembed.set_footer(text=(await self.config.win())+" Report Win || "(await self.config.loss())+" Report Loss || "(await self.config.dispute())+" Dispute Result")
if await self._guildsettings(ctx)["REPORTCHNNL"]: if await self._guildsettings(ctx)["REPORTCHNNL"]:
# message = await self.bot.send_message( # message = await self.bot.send_message(

Loading…
Cancel
Save