From a6717f597c2fddf1df81e37098cecb5c3216b05c Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 12 Aug 2023 17:05:35 +1000 Subject: [PATCH] bot: Fixed errors with int types --- README.md | 9 ++++++++- bot.py | 6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b76c3c3..cba3097 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,14 @@ Discord bot for the Woodburn server. This bot adds some Handshake related commands to the server. ## Commands -- `/shortlink ` - Shorten a URL using Kutt.it (requires a Kutt API key) only allowed for specied user + +- `/ping` - Check if the bot is online +- `/dig ` - Get the DNS records for a domain +- `/curl ` - Get the HTTPS response headers for a URL +- `/shortlink ` - Shorten a URL using Kutt.it (requires a Kutt API key & admin role) +- `/botstatus` - Update the bot status (requires admin role) +- `/invite` - Get an invite link for the Bot (not implemented properly dynamically yet) + # Setup diff --git a/bot.py b/bot.py index e46c9f6..2d167ee 100644 --- a/bot.py +++ b/bot.py @@ -7,10 +7,10 @@ import dns.resolver load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') -ADMINID = os.getenv('ADMIN_ID') +ADMINID = int(os.getenv('ADMIN_ID')) KUTT_APIKEY=os.getenv('LINK_API_KEY') KUTT_URL=os.getenv('LINK_URL') -LOG_CHANNEL = os.getenv('LOG_CHANNEL') +LOG_CHANNEL = int(os.getenv('LOG_CHANNEL')) intents = discord.Intents.default() client = discord.Client(intents=intents) @@ -31,7 +31,7 @@ async def shortlink(ctx, link: str, name: str = None): await log("User: " + str(ctx.user.name) + " tried to use the shortlink command") await ctx.response.send_message("You don't have permission to use this command",ephemeral=True) else: - url=f"https://{KUTT_URL}/api/v2/links" + url=f"{KUTT_URL}/api/v2/links" headers = {'X-API-KEY' : KUTT_APIKEY} data = {'target' : link, 'customurl' : name}