This commit is contained in:
Mylloon 2021-08-22 15:50:27 +02:00
parent 4ec7313a72
commit 79a1630d4b
11 changed files with 23 additions and 23 deletions

View file

@ -78,7 +78,7 @@ class Citation(commands.Cog):
else: else:
edit = "" edit = ""
messageDuBas = f"Posté le {timestampScreen(msgID.created_at)}{edit}" messageDuBas = f"Posté le {timestampScreen(msgID.created_at)}{edit}"
if auteur == "Auteur": if auteur == "Auteur":
messageDuBas = messageDuBas + f"\nCité par {userOrNick(message.author)} le {timestampScreen(message.created_at)}" messageDuBas = messageDuBas + f"\nCité par {userOrNick(message.author)} le {timestampScreen(message.created_at)}"
embed.set_footer(icon_url = icon_url, text = messageDuBas) embed.set_footer(icon_url = icon_url, text = messageDuBas)

View file

@ -69,7 +69,7 @@ class ConfrerieDuKassoulait(commands.Cog):
async for entry in message.guild.audit_logs(limit=1): async for entry in message.guild.audit_logs(limit=1):
if (intToDatetime(nowCustom()) - entry.created_at).seconds < 5 and str(entry.action) == 'AuditLogAction.message_delete': if (intToDatetime(nowCustom()) - entry.created_at).seconds < 5 and str(entry.action) == 'AuditLogAction.message_delete':
user_suppressed = entry.user user_suppressed = entry.user
channel = self.client.get_channel(742588187456831659) channel = self.client.get_channel(742588187456831659)
embed = discord.Embed(description = f"{message.content}") embed = discord.Embed(description = f"{message.content}")
@ -77,9 +77,9 @@ class ConfrerieDuKassoulait(commands.Cog):
if not user_suppressed: if not user_suppressed:
embed.set_footer(text = f"Channel: #{message.channel.name} | Date : {timestampScreen(message.created_at)}\nSupprimé le {timestampScreen(intToDatetime(nowUTC()))}") embed.set_footer(text = f"Channel: #{message.channel.name} | Date : {timestampScreen(message.created_at)}\nSupprimé le {timestampScreen(intToDatetime(nowUTC()))}")
else: else:
embed.set_footer(icon_url = user_suppressed.avatar_url, text = f"Channel: #{message.channel.name} | Date : {timestampScreen(message.created_at)}\nSupprimé par {userOrNick(user_suppressed)} le {timestampScreen(intToDatetime(nowUTC()))}") embed.set_footer(icon_url = user_suppressed.avatar_url, text = f"Channel: #{message.channel.name} | Date : {timestampScreen(message.created_at)}\nSupprimé par {userOrNick(user_suppressed)} le {timestampScreen(intToDatetime(nowUTC()))}")
await channel.send(embed = embed) await channel.send(embed = embed)
# ne fonctionne pas quand un message a été supprimé avant que le bot ai démarré # ne fonctionne pas quand un message a été supprimé avant que le bot ai démarré
# info sur la personne qui a supprimé ne fonctionne pas si il a supprimé un message auparavant (les logs se rajoute a un log deja existant) # info sur la personne qui a supprimé ne fonctionne pas si il a supprimé un message auparavant (les logs se rajoute a un log deja existant)
@ -91,7 +91,7 @@ class ConfrerieDuKassoulait(commands.Cog):
"""Triggered a message is received""" """Triggered a message is received"""
if message.author.id == 869726667294248970 and message.author.bot: # Autopublish if message.author.id == 869726667294248970 and message.author.bot: # Autopublish
await message.publish() await message.publish()
# autre serveur # autre serveur
if message.channel.id == 770805818487865404 or message.channel.id == 772239638240165928: # Le groupe de l'amour ❤❤ -- channel chien/chat if message.channel.id == 770805818487865404 or message.channel.id == 772239638240165928: # Le groupe de l'amour ❤❤ -- channel chien/chat
chiens = ["dog", "chien", "potichien", "doggo"] chiens = ["dog", "chien", "potichien", "doggo"]

View file

@ -164,7 +164,7 @@ class Fun(commands.Cog):
if message.author != ctx.author: if message.author != ctx.author:
final_message = message.content final_message = message.content
suite_auteur = message.author suite_auteur = message.author
urls = findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', final_message) urls = findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', final_message)
for i in range (0, len(urls)): for i in range (0, len(urls)):
final_message = final_message.replace(urls[i], '') final_message = final_message.replace(urls[i], '')
@ -194,7 +194,7 @@ class Fun(commands.Cog):
async def _random(self, ctx, *n): async def _random(self, ctx, *n):
"""Tire au hasard un chiffre entre 1 et n (par défaut n=10)\n ➡ Syntaxe: {PREFIX}random/randint [n]""" """Tire au hasard un chiffre entre 1 et n (par défaut n=10)\n ➡ Syntaxe: {PREFIX}random/randint [n]"""
n, fromSlash, _ = isSlash(n) n, fromSlash, _ = isSlash(n)
if n: if n:
try: try:
n = int(n) n = int(n)
@ -202,7 +202,7 @@ class Fun(commands.Cog):
return await mySendHidden(ctx, fromSlash, "Veuillez renseigner un chiffre valide.") return await mySendHidden(ctx, fromSlash, "Veuillez renseigner un chiffre valide.")
else: else:
n = 10 n = 10
x = 1 x = 1
if x > n: if x > n:
x, n = n, x x, n = n, x

View file

@ -42,7 +42,7 @@ class Games(commands.Cog):
description = (f"{choix_jeu[choix][:-1]} VS {choix_jeu[ordi][:-1]}\n\n**" description = (f"{choix_jeu[choix][:-1]} VS {choix_jeu[ordi][:-1]}\n\n**"
f"{('Égalité !', 'Tu as perdu !', 'Tu as gagné !')[(choix != ordi) + ((choix > ordi and ordi +1 == choix) or (choix < ordi and choix + ordi == 2))]}**") f"{('Égalité !', 'Tu as perdu !', 'Tu as gagné !')[(choix != ordi) + ((choix > ordi and ordi +1 == choix) or (choix < ordi and choix + ordi == 2))]}**")
embed = discord.Embed(title = f"{choix_jeu[choix][-1:]}VS {choix_jeu[ordi][-1:]}", description = description) embed = discord.Embed(title = f"{choix_jeu[choix][-1:]}VS {choix_jeu[ordi][-1:]}", description = description)
embed.set_author(name = ctx.author.name, icon_url = ctx.author.avatar_url) embed.set_author(name = ctx.author.name, icon_url = ctx.author.avatar_url)
if fromSlash != True: if fromSlash != True:
@ -69,7 +69,7 @@ class Games(commands.Cog):
number = randint(1, 100) number = randint(1, 100)
message = f"Choisis un nombre entre 1 et 100 {ctx.author.mention}." message = f"Choisis un nombre entre 1 et 100 {ctx.author.mention}."
await ctx.send(message) await ctx.send(message)
while self.guessing_game[str(ctx.author.id)] != 0: while self.guessing_game[str(ctx.author.id)] != 0:
try: try:
msg = await self.client.wait_for('message', check = lambda message: str(message.author.id) in self.guessing_game if message.author.bot == False else None, timeout = 30) msg = await self.client.wait_for('message', check = lambda message: str(message.author.id) in self.guessing_game if message.author.bot == False else None, timeout = 30)
except asyncio.TimeoutError: except asyncio.TimeoutError:

View file

@ -28,7 +28,7 @@ class Internet(commands.Cog):
'educationalmemes', 'funny', 'marvelmemes', 'me_irl', 'meme', 'MemeEconomy', 'Memes_Of_The_Dank', 'MinecraftMemes', 'educationalmemes', 'funny', 'marvelmemes', 'me_irl', 'meme', 'MemeEconomy', 'Memes_Of_The_Dank', 'MinecraftMemes',
'physicsmemes', 'blackpeopletwitter', 'metal_me_irl', '195', 'shittyadviceanimals', 'meirl', 'physicsmemes', 'blackpeopletwitter', 'metal_me_irl', '195', 'shittyadviceanimals', 'meirl',
'2meirl4meirl', 'AdviceAnimals', 'weirdmemes', 'LeagueOfMemes']) '2meirl4meirl', 'AdviceAnimals', 'weirdmemes', 'LeagueOfMemes'])
if fromSlash != None and subredditchoix == "nsfw": # demande de nsfw sans passé par la commande appropriée if fromSlash != None and subredditchoix == "nsfw": # demande de nsfw sans passé par la commande appropriée
return await mySendHidden(ctx, fromSlash, f"Désolé, tu demandes du nsfw... Fais plutôt **{ctx.prefix}sexe**.") return await mySendHidden(ctx, fromSlash, f"Désolé, tu demandes du nsfw... Fais plutôt **{ctx.prefix}sexe**.")
@ -170,7 +170,7 @@ class Internet(commands.Cog):
} }
choix_site = choice([key for key in rss_website.keys()]) choix_site = choice([key for key in rss_website.keys()])
if arg.lower() in rss_website: # si on specifie la source if arg.lower() in rss_website: # si on specifie la source
choix_site = arg.lower() choix_site = arg.lower()

View file

@ -334,7 +334,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
if not hasattr(bot, 'wavelink'): if not hasattr(bot, 'wavelink'):
self.bot.wavelink = wavelink.Client(bot = bot) self.bot.wavelink = wavelink.Client(bot = bot)
if self.keys["DOCKER_KASSOUBOT"] == True: if self.keys["DOCKER_KASSOUBOT"] == True:
self.url = "lavalink" # name of the service, working fine with the DNS in docker self.url = "lavalink" # name of the service, working fine with the DNS in docker
else: else:
@ -373,7 +373,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
else: else:
timeout -= 1 timeout -= 1
sleep(1) # Port is open -> no service behind, retrying in 1 second... sleep(1) # Port is open -> no service behind, retrying in 1 second...
if timeout <= 0: if timeout <= 0:
fileName = __file__.split("\\") # split for windows fileName = __file__.split("\\") # split for windows
if len(fileName) == 1: # if it wasn't windows if len(fileName) == 1: # if it wasn't windows
@ -543,7 +543,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin):
for track in tracks.tracks: for track in tracks.tracks:
track = Track(track.id, track.info, requester=ctx.author) track = Track(track.id, track.info, requester=ctx.author)
await player.queue.put(track) await player.queue.put(track)
lenghtTracks = len(tracks.tracks) lenghtTracks = len(tracks.tracks)
await ctx.send(f"```ini\nAjout de la playlist {tracks.data['playlistInfo']['name']}" await ctx.send(f"```ini\nAjout de la playlist {tracks.data['playlistInfo']['name']}"
f" ({lenghtTracks} son{'s' if lenghtTracks > 1 else ''}) à la file d'attente.```", delete_after=15) f" ({lenghtTracks} son{'s' if lenghtTracks > 1 else ''}) à la file d'attente.```", delete_after=15)

View file

@ -15,7 +15,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"):
def __init__(self, client): def __init__(self, client):
self.client = client self.client = client
self._reminderLoop.start() self._reminderLoop.start()
@tasks.loop(minutes = 1) @tasks.loop(minutes = 1)
async def _reminderLoop(self): async def _reminderLoop(self):
"""Méthode qui se répète toute les minutes pour vérifier si des rappels n'ont pas expirés, si expirés, les envoient.""" """Méthode qui se répète toute les minutes pour vérifier si des rappels n'ont pas expirés, si expirés, les envoient."""
@ -69,7 +69,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"):
async def __avant_reminderLoop(self): async def __avant_reminderLoop(self):
"""Wait to start the loop until the whole bot is ready""" """Wait to start the loop until the whole bot is ready"""
await self.client.wait_until_ready() await self.client.wait_until_ready()
async def reminderCheckDM(self, userID, reminderID): async def reminderCheckDM(self, userID, reminderID):
user = self.client.get_user(userID) user = self.client.get_user(userID)
if user == None: # si l'utilisateur n'est pas trouvé if user == None: # si l'utilisateur n'est pas trouvé
@ -161,7 +161,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"):
if fromSlash != True: if fromSlash != True:
await addReaction(ctx.message, 0) await addReaction(ctx.message, 0)
embed, pageMAX, refresh = await embedListeReminder(utilisateur, ctx.guild.id, page) embed, pageMAX, refresh = await embedListeReminder(utilisateur, ctx.guild.id, page)
message = await ctx.send(embed = embed) message = await ctx.send(embed = embed)
if refresh: if refresh:

View file

@ -68,7 +68,7 @@ async def on_message(message):
if message.author == client.user: if message.author == client.user:
return return
"""informations concernant le bot lorsqu'il est mentionner""" """informations concernant le bot lorsqu'il est mentionner"""
if client.user.mention == message.content.replace("!",""): if client.user.mention == message.content.replace("!",""):
ctx = await client.get_context(message) ctx = await client.get_context(message)

View file

@ -67,7 +67,7 @@ def getURLsInString(string):
for findingMention in findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', string): # récupération URLs dans le string for findingMention in findall(r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', string): # récupération URLs dans le string
findedURLs.append(findingMention) findedURLs.append(findingMention)
return findedURLs return findedURLs
def removeStartEndSpacesString(string): def removeStartEndSpacesString(string):
"""Retire les espaces en trop au début et à la fin d'un string""" """Retire les espaces en trop au début et à la fin d'un string"""
while string.startswith(" "): while string.startswith(" "):

View file

@ -31,7 +31,7 @@ class Database:
if valeurs: if valeurs:
if type(valeurs) not in [list, tuple]: if type(valeurs) not in [list, tuple]:
valeurs = [valeurs] valeurs = [valeurs]
curseur.execute(requete, valeurs) curseur.execute(requete, valeurs)
else: else:
curseur.execute(requete) curseur.execute(requete)
self.connexion.commit() self.connexion.commit()

View file

@ -22,7 +22,7 @@ class Reminder(Database):
); );
""" """
self.requete(requete) self.requete(requete)
def ajoutReminder(self, messageID: int, channelID: int, extrarg: int, reminder: str, creation: int, expiration: int, userID: int, guildID: int): def ajoutReminder(self, messageID: int, channelID: int, extrarg: int, reminder: str, creation: int, expiration: int, userID: int, guildID: int):
"""Ajoute un reminder.""" """Ajoute un reminder."""
requete = """ requete = """
@ -34,7 +34,7 @@ class Reminder(Database):
""" """
self.requete(requete, [messageID, channelID, extrarg, reminder, creation, expiration, userID, guildID]) self.requete(requete, [messageID, channelID, extrarg, reminder, creation, expiration, userID, guildID])
return self.affichageResultat(self.requete("SELECT last_insert_rowid();")) return self.affichageResultat(self.requete("SELECT last_insert_rowid();"))
def suppressionReminder(self, id: int): def suppressionReminder(self, id: int):
"""Supprime un reminder.""" """Supprime un reminder."""
requete = """ requete = """