Kamoulox 2.0 correction
This commit is contained in:
parent
9f4106a5b5
commit
f0f182560f
3 changed files with 19 additions and 19 deletions
|
@ -195,24 +195,24 @@ class Mybot(commands.Cog):
|
||||||
|
|
||||||
@commands.command(help="Je menotte une cornemuse et je fume Eddy Malou")
|
@commands.command(help="Je menotte une cornemuse et je fume Eddy Malou")
|
||||||
async def kamoulox(self, ctx):
|
async def kamoulox(self, ctx):
|
||||||
sans_verbe = get_word('nom').text + " " + get_word('complement').get('m') + " et " + get_word('nom').text + " " + get_word('complement').get('m') + "."
|
sans_verbe = get_word('nom').text + " " + get_word('complement').get('m') + " et " + get_word('nom').text + " " + get_word('complement').get('m') + "."
|
||||||
nom1 = get_word('nom')
|
nom1 = get_word('nom')
|
||||||
nom2 = get_word('nom')
|
nom2 = get_word('nom')
|
||||||
un1 = "un"
|
un1 = "un"
|
||||||
un2 = "un"
|
un2 = "un"
|
||||||
if nom1.get('gender') == 'F':
|
if nom1.get('gender') == 'F':
|
||||||
un1 = "une"
|
un1 = "une"
|
||||||
if nom2.get('gender') == 'F':
|
if nom2.get('gender') == 'F':
|
||||||
un2 = "une"
|
un2 = "une"
|
||||||
phrase1 = get_word('verbe').text + " " + un1 + " " + nom1.text + " " + random.choice([get_word('complement').get('m'), ""])
|
phrase1 = get_word('verbe').text + " " + un1 + " " + nom1.text + " " + random.choice([get_word('complement').get('m'), ""])
|
||||||
phrase2 = get_word('verbe').text + " " + un2 + " " + nom2.text + " " + random.choice([get_word('complement').get('m'), ""])
|
phrase2 = get_word('verbe').text + " " + un2 + " " + nom2.text + " " + random.choice([get_word('complement').get('m'), ""])
|
||||||
avec_verbe = phrase1 + " et " + phrase2 + "."
|
avec_verbe = phrase1 + " et " + phrase2 + "."
|
||||||
piece = random.choice(['pile', 'face'])
|
piece = random.choice(['pile', 'face'])
|
||||||
if piece == "pile":
|
if piece == "pile":
|
||||||
sans_verbe
|
sans_verbe
|
||||||
elif piece == "face":
|
elif piece == "face":
|
||||||
avec_verbe
|
avec_verbe
|
||||||
await ctx.send(piece)
|
await ctx.send(piece)
|
||||||
|
|
||||||
@tasks.loop(seconds=1.5)
|
@tasks.loop(seconds=1.5)
|
||||||
async def play_next(self):
|
async def play_next(self):
|
||||||
|
@ -230,7 +230,7 @@ class Mybot(commands.Cog):
|
||||||
|
|
||||||
def get_word(word_type):
|
def get_word(word_type):
|
||||||
content = []
|
content = []
|
||||||
with open("base_kml.xml", "r") as file:
|
with open("/home/mika/kabot/kabot/kabot/ressources/base_kml.xml", "r") as file:
|
||||||
content = file.readlines()
|
content = file.readlines()
|
||||||
content = "".join(content)
|
content = "".join(content)
|
||||||
bs_content = bs(content, 'lxml')
|
bs_content = bs(content, 'lxml')
|
||||||
|
|
Loading…
Reference in a new issue