Checking if the server works on the bot

pull/4/head
sgoudham 4 years ago
parent e4f15ba1b7
commit 31b0d8b0f0

@ -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

11
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()

Loading…
Cancel
Save