diff --git a/Garou.py b/Garou.py index c7fb8e3..5155ab3 100644 --- a/Garou.py +++ b/Garou.py @@ -2,13 +2,15 @@ import discord from discord.ext import commands game = 0 -djouers = 0 +djoueurs = 0 +joueurs = str("0") -def is_jouers(author, jouers): - for i in range(len(jouers)): - if author == jouers[i]: +def is_joueurs(author): + global joueurs + for i in range(len(joueurs)): + if author == joueurs[i]: return True - + else: return False @@ -16,6 +18,7 @@ class Garou: def __init__(self, bot): self.bot = bot + #Commande de démarrage du Garou @commands.command(pass_context=True) async def gstart(self, ctx): @@ -29,59 +32,62 @@ class Garou: gm = ctx.message.author print("L'ancement d'une partie de Garou par: "+str(ctx.message.author)) await self.bot.say("Lancmeent d'une partie !") - await self.bot.say("Veuiller specifier les joueurs avec la commande gjouers") - + await self.bot.say("Veuiller specifier les joueurs avec la commande gjoueurs") + #Commande pour definir les participant du Garou @commands.command(pass_context=True) - async def gjouers(self, ctx, *, jouers): + async def gjoueurs(self, ctx, *, CMDjoueurs): + global djoueurs + global joueurs if game == 0: - print("Commande gjouers lancer par: "+str(ctx.message.author)+" refuser, aucune partie lancer !") + print("Commande gjoueurs lancer par: "+str(ctx.message.author)+" refuser, aucune partie lancer !") await self.bot.say("Désoler mais aucune partie n'est lancer.") - + elif game == 1: - if djouers == 1: - print("Commande gjouers lancer par: "+str(ctx.message.author)+" refuser, partie deja lacer !") + if djoueurs == 1: + print("Commande gjoueurs lancer par: "+str(ctx.message.author)+" refuser, partie deja lacer !") await slef.bot.say("Désoler mais une partie est deja en cours !") - - elif djouers == 0: - djouers = 1 - print("Commande gjouers lancer par: "+str(ctx.message.author)+" argument: "+str(jouers)) - await self.bot.say("Les jouer de cette partie sont: "+str(jouers)) - + + elif djoueurs == 0: + djoueurs = 1 + joueurs = CMDjoueurs + print("Commande gjoueurs lancer par: "+str(ctx.message.author)+" argument: "+str(CMDjoueurs)) + await self.bot.say("Les jouer de cette partie sont: "+str(joueurs)) + #Commande de test @commands.command(pass_content=True) async def gtest(self, ctx): - if is_jouers(ctx.message.author, jouers) == True: - async self.bot.say("Vous ete bien un jouers !") - + if is_joueurs(ctx.message.author) == True: + await self.bot.say("Vous ete bien un joueurs !") + elif gm == ctx.message.author: - async self.bot.say("Vous ete le GM !") - - + await self.bot.say("Vous ete le GM !") + + else: - async self.bot.say("Vous n'ete pas un jouers !") - + await self.bot.say("Vous n'ete pas un joueurs !") + #Commande pour annuler le Garou @commands.command(pass_context=True) async def gstop(self, ctx): - global game,djouers + global game,djoueurs if game == 0: print("Commande gstop lancer par: "+str(ctx.message.author)+" refuser, aucune partie lancer !") await self.bot.say("Désoler mais aucune partie n'est lancer.") - + elif game == 1: if gm == ctx.message.author: #reset de toutes les variables game = 0 - djouers = 0 + djoueurs = 0 gm = 0 print("Partie de garou annuler !") await self.bot.say("La partie de garou est annuler !") - + else: print("Commande gstop mancer par: "+str(ctx.message.author)+" refuser car ce n'est pas le gm !") await self.bot.say("Désoler mais vous n'avez pas le droit de faire ça, vous n'étes pas le gm !") - + def setup(bot): bot.add_cog(Garou(bot)) diff --git a/__pycache__/Benne_a_ordure.cpython-36.pyc b/__pycache__/Benne_a_ordure.cpython-36.pyc new file mode 100644 index 0000000..5ad596c Binary files /dev/null and b/__pycache__/Benne_a_ordure.cpython-36.pyc differ diff --git a/__pycache__/DefaultCMD.cpython-36.pyc b/__pycache__/DefaultCMD.cpython-36.pyc new file mode 100644 index 0000000..94eb446 Binary files /dev/null and b/__pycache__/DefaultCMD.cpython-36.pyc differ diff --git a/__pycache__/ExampleRepl.cpython-36.pyc b/__pycache__/ExampleRepl.cpython-36.pyc new file mode 100644 index 0000000..ac0493e Binary files /dev/null and b/__pycache__/ExampleRepl.cpython-36.pyc differ diff --git a/__pycache__/Garou.cpython-36.pyc b/__pycache__/Garou.cpython-36.pyc new file mode 100644 index 0000000..3485c4c Binary files /dev/null and b/__pycache__/Garou.cpython-36.pyc differ diff --git a/__pycache__/Reactionner.cpython-36.pyc b/__pycache__/Reactionner.cpython-36.pyc new file mode 100644 index 0000000..75a37bf Binary files /dev/null and b/__pycache__/Reactionner.cpython-36.pyc differ diff --git a/bot.py b/bot.py index 5a58fe3..63422ad 100644 --- a/bot.py +++ b/bot.py @@ -16,19 +16,19 @@ def is_owner(id): async def on_ready(): print("Démarrage de DefaultCMD") bot.load_extension("DefaultCMD") - + print("Démarrage de ExampleRepl") bot.load_extension("ExampleRepl") - + print("Démarrage de Benne_a_ordure") bot.load_extension("Benne_a_ordure") - + print("Démarrage de Reactionner") bot.load_extension("Reactionner") - + print("Démarrage de Garou") bot.load_extension("Garou") - + print("FTW's Bot operationelle") @bot.command(pass_context = True) @@ -71,4 +71,4 @@ async def on_message(msg): print(msg.content) """ -bot.run("Mzg0MDk0ODcyODIwMjUyNjc0.DPt74w.2t6XZoFVYgk-7eMeS702dqyvoP4") +bot.run("bot") diff --git a/log_test.txt b/log_test.txt new file mode 100644 index 0000000..3e496e5 --- /dev/null +++ b/log_test.txt @@ -0,0 +1,35 @@ + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + + + + +Début de l'enregistrement des réactions. + +