From 31b0d8b0f0ab2fd0a28adfaccf07cae8ee84270f Mon Sep 17 00:00:00 2001 From: sgoudham Date: Tue, 7 Jul 2020 19:31:29 +0100 Subject: [PATCH] Checking if the server works on the bot --- cogs/fun/homies.py | 8 +++++++- db.py | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cogs/fun/homies.py b/cogs/fun/homies.py index 4aa9e0f1..cb02e20e 100644 --- a/cogs/fun/homies.py +++ b/cogs/fun/homies.py @@ -5,6 +5,8 @@ from PIL import Image, ImageDraw, ImageFont from discord.ext import commands from discord.ext.commands import command, cooldown, BucketType +import db + def generate_meme(image_path, top_text, bottom_text='', font_path='homies/impact/impacted.ttf', font_size=9): get_image = Image.open(image_path) @@ -50,10 +52,14 @@ class Fun(commands.Cog): self.bot = bot @command(name="homies", aliases=["Homies", "homie", "Homie"]) - @cooldown(1, 180, BucketType.channel) + @cooldown(1, 25, BucketType.guild) async def homies(self, ctx, *, user_word): """Allows people to summon the homies""" + conn = db.connection() + if conn: + print("Yes server is working!") + if len(user_word) >= 20: await ctx.send("Please make sure the prompt is below **20** characters!") return diff --git a/db.py b/db.py index 83324cac..1702993d 100644 --- a/db.py +++ b/db.py @@ -10,13 +10,14 @@ def connection(): # Connect to MariaDB Platform try: conn = mariadb.connect( - user="u67_i1Lq7r8fQ2", + user="root", password=password, - host="216.155.135.248", + host="173.208.202.20", port=3306, - database="s67_Enso" - + database="enso" ) + if conn: + print("working") except mariadb.Error as e: print(f"Error connecting to MariaDB Platform: {e}") sys.exit(1) @@ -24,6 +25,8 @@ def connection(): return conn +connection() + """if conn: print("Connected to MySQL Server version ") cursor = conn.cursor()