diff --git a/EnsoBot.py b/EnsoBot.py index 37155cc1..f1e89bc5 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -82,3 +82,81 @@ async def users(ctx): await ctx.send(f"""Number of Members: {server_id.member_count}""") ''' + +""" +@client.event +async def on_message(message, target: discord.Member,): + player1 = message.author.mention + player2 = target.mention + channel = message.channel + + if message.content.startswith('~punch'): + channel = message.channel + await channel.send(f"**Deathmatch started! {player1} vs {player2}**" + f"\n What do you want to do {message.author}?" + f"\n 1) Punch" + f"\n 2) Kick") + + def check(m): + return m.content == 'punch' and m.channel == channel + + msg = await client.wait_for('f"**{player1} punched {player2} for {punch(p2)} damage!**"', check=check) + await channel.send(msg) + + +@client.event +async def on_message(message): + if message.content.startswith('~hello'): + channel = message.channel + await channel.send('Say hello!') + + def check(m): + return m.content == 'hello' and m.channel == channel + + msg = await client.wait_for('message', check=check) + await channel.send('Hello {.author}!'.format(msg)) + + +def check(author): +def inner_check(message): + return message.author == author and message.content == "Hello" + +return inner_check + +msg = await client.wait_for('message', check=check(ctx.author), timeout=30) +await ctx.send(msg) + +# def check(m): +# return m.content == 'punch' and m.channel == channel + +# = await client.wait_for('message', check=check) +# await channel.send(f"**{player1} punched {player2} for {punch(p2)} damage!**") +except Exception as e: +print(e) + + +@client.command(aliases=["dm"]) +async def deathmatch(ctx, target: discord.Member): + player1 = ctx.author.mention + player2 = target.mention + channel = ctx.channel + + p1 = 100 + p2 = 100 + + await ctx.send(f"**Deathmatch started! {player1} vs {player2}**" + f"\n What do you want to do {ctx.author}?" + f"\n 1) Punch" + f"\n 2) Kick") + + def check(m): + return m.content == 'punch' and m.channel == channel + + msg = await client.wait_for('message', check=check) + await channel.send(msg) + +def punch(p2, player1, player2): + damage = random.randint(1, 100) + p2 -= damage + return f"**{player1} punched {player2} for {punch(p2)} damage!**" +""" diff --git a/cogs/FunCommands.py b/cogs/FunCommands.py index 9aa37a2c..0bcee29d 100644 --- a/cogs/FunCommands.py +++ b/cogs/FunCommands.py @@ -156,13 +156,6 @@ class Fun(commands.Cog): await ctx.send(f"{ctx.author.mention} {random.choice(responses)}") - @commands.command() - async def death(self, ctx, target: discord.member): - player1 = ctx.author.mention - player2 = target.mention - - await ctx.send(f"Deathmatch started! **{player1}** vs **{player2}**") - def setup(bot): bot.add_cog(Fun(bot)) @@ -181,4 +174,25 @@ def setup(bot): await ctx.send("Deathmatch") + @commands.command() + async def death(self, ctx, target: discord.Member): + player1 = ctx.author.mention + player2 = target.mention + channel = ctx.channel + + p1 = 100 + p2 = 100 + + await ctx.send(f"**Deathmatch started! {player1} vs {player2}**" + f"\n What do you want to do {ctx.author}?" + f"\n 1) Punch" + f"\n 2) Kick") + + msg = await client.wait_for(f"**{player1} punched {player2} for {punch(p2)} damage!**", check=check) + # await channel.send('Hello {.author}!'.format(msg)) + # await ctx.send(f"**{player1} punched {player2} for {punch(p2)} damage!**") + await ctx.send(f"{msg}") + + + """