Et hop
This commit is contained in:
parent
8bb5a46f24
commit
7d972d9009
33 changed files with 58 additions and 39 deletions
13
cogs/admin.py
Normal file → Executable file
13
cogs/admin.py
Normal file → Executable file
|
@ -1,10 +1,8 @@
|
|||
from discord.ext import commands
|
||||
from random import choice, shuffle
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import time
|
||||
import discord
|
||||
import platform
|
||||
from .utils import checks
|
||||
|
||||
class Admin:
|
||||
|
@ -33,7 +31,7 @@ class Admin:
|
|||
self.bot.unload_extension(module)
|
||||
self.bot.load_extension(module)
|
||||
await self.bot.say("Nice !")
|
||||
except Exception as e:
|
||||
except Exception as e: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(':( Erreur :')
|
||||
await self.bot.say('{}: {}'.format(type(e).__name__, e))
|
||||
else:
|
||||
|
@ -46,17 +44,16 @@ class Admin:
|
|||
number = number + 1
|
||||
await self.bot.purge_from(ctx.message.channel, limit=number)
|
||||
await self.bot.say("Hello World !")
|
||||
except Exception as e:
|
||||
except Exception as e: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(':sob: Une erreur est survenue : \n {}: {}'.format(type(e).__name__, e))
|
||||
|
||||
@checks.is_owner()
|
||||
@commands.command(name='say', pass_context=True, hidden=True)
|
||||
async def _say(self, ctx, dire):
|
||||
async def _say(self, ctx, *dire:str):
|
||||
try:
|
||||
arg = ctx.message.content.split("say ")
|
||||
await self.bot.say(arg[1])
|
||||
await self.bot.say(dire)
|
||||
await self.bot.delete_message(ctx.message)
|
||||
except Exception as e:
|
||||
except Exception as e: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(':sob: Une erreur est survenue : \n {}: {}'.format(type(e).__name__, e))
|
||||
|
||||
@checks.is_owner()
|
||||
|
|
0
cogs/basics.py
Normal file → Executable file
0
cogs/basics.py
Normal file → Executable file
16
cogs/ci.py
Normal file → Executable file
16
cogs/ci.py
Normal file → Executable file
|
@ -84,6 +84,22 @@ class Identity:
|
|||
conn.commit()
|
||||
await self.bot.say(":clap: Bievenue à toi {} dans le communisme {} ! Fait ``.ci`` pour plus d'informations !".format(ctx.message.author.name, ctx.message.server.name))
|
||||
|
||||
@_ci.command(pass_context=True, name="upimage")
|
||||
async def ci_image(self, ctx):
|
||||
try:
|
||||
cursor.execute("""SELECT id, userid FROM users WHERE userid=?""", (ctx.message.author.id,))
|
||||
existansw = cursor.fetchone()
|
||||
|
||||
if existansw != None:
|
||||
cursor.execute("""UPDATE users SET useravatar = ? WHERE userid = ?""", (ctx.message.author.avatar_url, ctx.message.author.id))
|
||||
conn.commit()
|
||||
await self.bot.say(ctx.message.author.mention + "> :ok_hand: Carte d'identité mise à jour; Sympa ton nouvel avatar :wink: !")
|
||||
else:
|
||||
await self.bot.say(ctx.message.author.mention + "> :x: Veuillez enregistrer votre carte d'identité pour commencer !")
|
||||
except Exception as e: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(':( Erreur veuillez contacter votre administrateur :')
|
||||
await self.bot.say('{}: {}'.format(type(e).__name__, e))
|
||||
|
||||
@_ci.command(pass_context=True, name="setconfig")
|
||||
async def ci_setconfig(self, ctx, args_):
|
||||
try:
|
||||
|
|
11
cogs/funs.py
Normal file → Executable file
11
cogs/funs.py
Normal file → Executable file
|
@ -22,6 +22,11 @@ class Funs:
|
|||
embed.set_thumbnail(url=user.avatar_url)
|
||||
await self.bot.say(embed=embed)
|
||||
|
||||
@commands.command(pass_context=True)
|
||||
async def poke(self, user : discord.Member):
|
||||
"""Poke quelqu'un"""
|
||||
await self.bot.say(":clap: Hey {0} tu t'es fait poker par {1}.".format(user.mention, ctx.message.author))
|
||||
|
||||
@commands.command()
|
||||
async def btcprice(self):
|
||||
"""Le prix du BTC"""
|
||||
|
@ -56,7 +61,7 @@ class Funs:
|
|||
@commands.command()
|
||||
async def ethylotest(self):
|
||||
"""Ethylotest simulator 2018"""
|
||||
results_poulet = ["Désolé mais mon ethylotest est sous Windows Vista, merci de patienter...", "_(ethylotest)_ ``Une erreur est survenue. Windows cherche une solution à se prolbème...``", "Mais j'l'ai foutu où ce p*** d'ethylotest de m..... bordel fait ch..... tab....", "C'est pas possible z'avez cassé l'ethylotest !"]
|
||||
results_poulet = ["Désolé mais mon ethylotest est sous Windows Vista, merci de patienter...", "_(ethylotest)_ ``Une erreur est survenue. Windows cherche une solution à se problème...``", "Mais j'l'ai foutu où ce p*** d'ethylotest de m*** bordel fait ch*** tab***", "C'est pas possible z'avez cassé l'ethylotest !"]
|
||||
results_client = ["D'accord, il n'y a pas de problème à cela je suis complètement clean", "Bien sur si c'est votre devoir !", "Suce bi** !", "J'ai l'air d'être bourré ?", "_laissez moi prendre un bonbon à la menthe..._"]
|
||||
|
||||
result_p = random.choice(results_poulet)
|
||||
|
@ -71,8 +76,8 @@ class Funs:
|
|||
@commands.command()
|
||||
async def coin(self):
|
||||
"""Coin flip simulator 2025"""
|
||||
starts_msg = ["Je lance la pièce !", "C'est partit !", "C'est une pièce de d'un cent faut pas la perdre", "C'est une pièce de d'un euro faut pas la perdre", "Je lance !"]
|
||||
results_coin = ["{0} pile", "{0} face", "{1} Heu c'est quoi pile c'est quoi face enfaite ?", "{1} How shit, je crois que je l'ai perdu", "{1} Et bim je te vol ta pièce !", "{0} Oh une erreur d'impression y'a ni pile ni face !"]
|
||||
starts_msg = ["Je lance la pièce !", "C'est parti !", "C'est une pièce d'un cent faut pas la perdre", "C'est une pièce d'un euro faut pas la perdre", "Je lance !"]
|
||||
results_coin = ["{0} pile", "{0} face", "{1} Heu c'est quoi pile c'est quoi face enfaite ?", "{1} Oh shit, je crois que je l'ai perdue", "{1} Et bim je te vol ta pièce !", "{0} Oh une erreur d'impression il n'y a ni pile ni face !"]
|
||||
|
||||
start = random.choice(starts_msg)
|
||||
result = random.choice(results_coin)
|
||||
|
|
6
cogs/search.py
Normal file → Executable file
6
cogs/search.py
Normal file → Executable file
|
@ -69,7 +69,7 @@ class Search:
|
|||
@_search.command(pass_context=True, name="wikipedia")
|
||||
async def search_wikipedia(self, ctx, args):
|
||||
"""Fait une recherche sur wikipd"""
|
||||
try:
|
||||
try: # C'est quoi ce try-except de la mort ?
|
||||
wait = await self.bot.say("_Je cherche..._")
|
||||
results = wikipedia.search(args)
|
||||
nbmr = 0
|
||||
|
@ -109,11 +109,11 @@ class Search:
|
|||
await self.bot.delete_message(wait)
|
||||
await self.bot.say(embed=em)
|
||||
|
||||
except wikipedia.exceptions.PageError:
|
||||
except wikipedia.exceptions.PageError: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(":open_mouth: Une **erreur interne** est survenue, si cela ce reproduit contactez votre administrateur ou faites une Issue sur ``github`` !")
|
||||
except UnboundLocalError:
|
||||
await self.bot.say(":interrobang: Veuillez choisir une réaction valide !")
|
||||
except:
|
||||
except DisambiguationError: #TODO : A virer dans l'event on_error
|
||||
await self.bot.say(":open_mouth: Une **erreur interne** est survenue, si cela ce reproduit contactez votre administrateur ou faites une Issue sur ``github`` !")
|
||||
except IndexError:
|
||||
await self.bot.say(" :interrobang: Veuillez entrer un terme de recherche !")
|
||||
|
|
0
cogs/utility.py
Normal file → Executable file
0
cogs/utility.py
Normal file → Executable file
0
cogs/utils/__init__.py
Normal file → Executable file
0
cogs/utils/__init__.py
Normal file → Executable file
0
cogs/utils/__pycache__/__init__.cpython-35.pyc
Normal file → Executable file
0
cogs/utils/__pycache__/__init__.cpython-35.pyc
Normal file → Executable file
0
cogs/utils/__pycache__/checks.cpython-35.pyc
Normal file → Executable file
0
cogs/utils/__pycache__/checks.cpython-35.pyc
Normal file → Executable file
0
cogs/utils/checks.py
Normal file → Executable file
0
cogs/utils/checks.py
Normal file → Executable file
0
cogs/utils/config.py
Normal file → Executable file
0
cogs/utils/config.py
Normal file → Executable file
0
cogs/utils/formats.py
Normal file → Executable file
0
cogs/utils/formats.py
Normal file → Executable file
0
cogs/utils/maps.py
Normal file → Executable file
0
cogs/utils/maps.py
Normal file → Executable file
0
cogs/utils/paginator.py
Normal file → Executable file
0
cogs/utils/paginator.py
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue