From 79a1630d4b7a163425893983e6bd5e13ed41bf8d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 22 Aug 2021 15:50:27 +0200 Subject: [PATCH] nothing --- src/cogs/citation.py | 2 +- src/cogs/confreriedukassoulait.py | 8 ++++---- src/cogs/fun.py | 6 +++--- src/cogs/games.py | 4 ++-- src/cogs/internet.py | 4 ++-- src/cogs/music.py | 6 +++--- src/cogs/reminder.py | 6 +++--- src/main.py | 2 +- src/utils/core.py | 2 +- src/utils/db.py | 2 +- src/utils/reminder.py | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/cogs/citation.py b/src/cogs/citation.py index d80a85d..378de1c 100644 --- a/src/cogs/citation.py +++ b/src/cogs/citation.py @@ -78,7 +78,7 @@ class Citation(commands.Cog): else: edit = "" messageDuBas = f"Posté le {timestampScreen(msgID.created_at)}{edit}" - + if auteur == "Auteur": messageDuBas = messageDuBas + f"\nCité par {userOrNick(message.author)} le {timestampScreen(message.created_at)}" embed.set_footer(icon_url = icon_url, text = messageDuBas) diff --git a/src/cogs/confreriedukassoulait.py b/src/cogs/confreriedukassoulait.py index 93f431a..84dcc4a 100644 --- a/src/cogs/confreriedukassoulait.py +++ b/src/cogs/confreriedukassoulait.py @@ -69,7 +69,7 @@ class ConfrerieDuKassoulait(commands.Cog): 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': user_suppressed = entry.user - + channel = self.client.get_channel(742588187456831659) embed = discord.Embed(description = f"{message.content}") @@ -77,9 +77,9 @@ class ConfrerieDuKassoulait(commands.Cog): if not user_suppressed: 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()))}") - + await channel.send(embed = embed) # 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) @@ -91,7 +91,7 @@ class ConfrerieDuKassoulait(commands.Cog): """Triggered a message is received""" if message.author.id == 869726667294248970 and message.author.bot: # Autopublish await message.publish() - + # autre serveur if message.channel.id == 770805818487865404 or message.channel.id == 772239638240165928: # Le groupe de l'amour ❤❤ -- channel chien/chat chiens = ["dog", "chien", "potichien", "doggo"] diff --git a/src/cogs/fun.py b/src/cogs/fun.py index 7102911..c994a1f 100644 --- a/src/cogs/fun.py +++ b/src/cogs/fun.py @@ -164,7 +164,7 @@ class Fun(commands.Cog): if message.author != ctx.author: final_message = message.content suite_auteur = message.author - + 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)): final_message = final_message.replace(urls[i], '') @@ -194,7 +194,7 @@ class Fun(commands.Cog): 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]""" n, fromSlash, _ = isSlash(n) - + if n: try: n = int(n) @@ -202,7 +202,7 @@ class Fun(commands.Cog): return await mySendHidden(ctx, fromSlash, "Veuillez renseigner un chiffre valide.") else: n = 10 - + x = 1 if x > n: x, n = n, x diff --git a/src/cogs/games.py b/src/cogs/games.py index 9147fcf..2152925 100644 --- a/src/cogs/games.py +++ b/src/cogs/games.py @@ -42,7 +42,7 @@ class Games(commands.Cog): 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))]}**") - + 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) if fromSlash != True: @@ -69,7 +69,7 @@ class Games(commands.Cog): number = randint(1, 100) message = f"Choisis un nombre entre 1 et 100 {ctx.author.mention}." await ctx.send(message) - while self.guessing_game[str(ctx.author.id)] != 0: + while self.guessing_game[str(ctx.author.id)] != 0: 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) except asyncio.TimeoutError: diff --git a/src/cogs/internet.py b/src/cogs/internet.py index d44f6a7..a98c81f 100644 --- a/src/cogs/internet.py +++ b/src/cogs/internet.py @@ -28,7 +28,7 @@ class Internet(commands.Cog): 'educationalmemes', 'funny', 'marvelmemes', 'me_irl', 'meme', 'MemeEconomy', 'Memes_Of_The_Dank', 'MinecraftMemes', 'physicsmemes', 'blackpeopletwitter', 'metal_me_irl', '195', 'shittyadviceanimals', 'meirl', '2meirl4meirl', 'AdviceAnimals', 'weirdmemes', 'LeagueOfMemes']) - + 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**.") @@ -170,7 +170,7 @@ class Internet(commands.Cog): } choix_site = choice([key for key in rss_website.keys()]) - + if arg.lower() in rss_website: # si on specifie la source choix_site = arg.lower() diff --git a/src/cogs/music.py b/src/cogs/music.py index 26f79fb..ef434ea 100644 --- a/src/cogs/music.py +++ b/src/cogs/music.py @@ -334,7 +334,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin): if not hasattr(bot, 'wavelink'): self.bot.wavelink = wavelink.Client(bot = bot) - + if self.keys["DOCKER_KASSOUBOT"] == True: self.url = "lavalink" # name of the service, working fine with the DNS in docker else: @@ -373,7 +373,7 @@ class Music(commands.Cog, wavelink.WavelinkMixin): else: timeout -= 1 sleep(1) # Port is open -> no service behind, retrying in 1 second... - + if timeout <= 0: fileName = __file__.split("\\") # split for 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: track = Track(track.id, track.info, requester=ctx.author) await player.queue.put(track) - + lenghtTracks = len(tracks.tracks) 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) diff --git a/src/cogs/reminder.py b/src/cogs/reminder.py index 53ba899..a47afc6 100644 --- a/src/cogs/reminder.py +++ b/src/cogs/reminder.py @@ -15,7 +15,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"): def __init__(self, client): self.client = client self._reminderLoop.start() - + @tasks.loop(minutes = 1) 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.""" @@ -69,7 +69,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"): async def __avant_reminderLoop(self): """Wait to start the loop until the whole bot is ready""" await self.client.wait_until_ready() - + async def reminderCheckDM(self, userID, reminderID): user = self.client.get_user(userID) if user == None: # si l'utilisateur n'est pas trouvé @@ -161,7 +161,7 @@ class ReminderDiscord(commands.Cog, name="Reminder"): if fromSlash != True: await addReaction(ctx.message, 0) - + embed, pageMAX, refresh = await embedListeReminder(utilisateur, ctx.guild.id, page) message = await ctx.send(embed = embed) if refresh: diff --git a/src/main.py b/src/main.py index 44fd143..2704bbd 100644 --- a/src/main.py +++ b/src/main.py @@ -68,7 +68,7 @@ async def on_message(message): if message.author == client.user: return - + """informations concernant le bot lorsqu'il est mentionner""" if client.user.mention == message.content.replace("!",""): ctx = await client.get_context(message) diff --git a/src/utils/core.py b/src/utils/core.py index b39ac26..21b8d14 100644 --- a/src/utils/core.py +++ b/src/utils/core.py @@ -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 findedURLs.append(findingMention) return findedURLs - + def removeStartEndSpacesString(string): """Retire les espaces en trop au début et à la fin d'un string⁢⁢⁢⁢⁢⁢⁢⁢⁢⁢""" while string.startswith(" "): diff --git a/src/utils/db.py b/src/utils/db.py index 275171b..d6484b0 100644 --- a/src/utils/db.py +++ b/src/utils/db.py @@ -31,7 +31,7 @@ class Database: if valeurs: if type(valeurs) not in [list, tuple]: valeurs = [valeurs] - curseur.execute(requete, valeurs) + curseur.execute(requete, valeurs) else: curseur.execute(requete) self.connexion.commit() diff --git a/src/utils/reminder.py b/src/utils/reminder.py index c5fbcda..018a9bf 100644 --- a/src/utils/reminder.py +++ b/src/utils/reminder.py @@ -22,7 +22,7 @@ class Reminder(Database): ); """ self.requete(requete) - + def ajoutReminder(self, messageID: int, channelID: int, extrarg: int, reminder: str, creation: int, expiration: int, userID: int, guildID: int): """Ajoute un reminder.""" requete = """ @@ -34,7 +34,7 @@ class Reminder(Database): """ self.requete(requete, [messageID, channelID, extrarg, reminder, creation, expiration, userID, guildID]) return self.affichageResultat(self.requete("SELECT last_insert_rowid();")) - + def suppressionReminder(self, id: int): """Supprime un reminder.""" requete = """