From 7cadd3f2c8399f0d88e54a811be7ac03bf3e1d82 Mon Sep 17 00:00:00 2001 From: Luke Robles <98352913+lrobles-iterable@users.noreply.github.com> Date: Thu, 13 Oct 2022 08:28:14 -0700 Subject: [PATCH] Adding a semi global var for my user ID and guild IDs --- app/bot.py | 2 +- app/cogs/actual_utils.py | 8 ++++---- app/cogs/cheeky_functions.py | 2 +- app/cogs/server_utils.py | 4 ++-- app/core_utils.py | 3 +++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/bot.py b/app/bot.py index 9bc2c1cc..e88df377 100755 --- a/app/bot.py +++ b/app/bot.py @@ -90,7 +90,7 @@ async def on_command_completion(ctx): value="**(** [%s](%s) **)**" % (ctx.channel, ctx.message.jump_url), ) embed.add_field(name="Server:", value=f"{ctx.guild} **( <#{ctx.channel.id}> )**") - if ctx.message.author.id != 144986109804412928: + if ctx.message.author.id != core_utils.my_id: await channel.send(embed=embed) diff --git a/app/cogs/actual_utils.py b/app/cogs/actual_utils.py index 9e80b5ad..63b80171 100644 --- a/app/cogs/actual_utils.py +++ b/app/cogs/actual_utils.py @@ -70,7 +70,7 @@ class ActualUtils(commands.Cog): @commands.command(name="openai") async def openai(self, ctx: commands.Context, *, query): - if ctx.message.author.id != 144986109804412928: + if ctx.message.author.id != core_utils.my_id: await ctx.send("Sorry, this is a paid dale-bot feature") return import questions @@ -81,7 +81,7 @@ class ActualUtils(commands.Cog): @commands.has_role("stable-diffuser") @commands.slash_command( - guild_ids=[826547484632678450, 152921472304676865], + guild_ids=core_utils.my_guilds, name="sd", description="Pass a prompt and optinal negative prompt to stable diffusion", ) @@ -107,7 +107,7 @@ class ActualUtils(commands.Cog): steps = 20 # Send my requests to my gaming computer with the 3080 (if its up) - if ctx.author.id == 144986109804412928: + if ctx.author.id == core_utils.my_id: ip = "192.168.1.188" steps = 60 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) @@ -145,7 +145,7 @@ class ActualUtils(commands.Cog): @commands.has_role("Track day gamers") @commands.slash_command( - guild_ids=None, + guild_ids=core_utils.my_guilds, name="trackdays", description="Query motorsportsreg.com for a list of trackdays going on at Buttonwillow and Thunderhill", ) diff --git a/app/cogs/cheeky_functions.py b/app/cogs/cheeky_functions.py index d842d822..f10d9ca0 100644 --- a/app/cogs/cheeky_functions.py +++ b/app/cogs/cheeky_functions.py @@ -25,7 +25,7 @@ class Cheeky(commands.Cog): @commands.command(name="coom", pass_context=True) async def coom(self, ctx: commands.Context, id=None): - if ctx.message.author.id != 144986109804412928: + if ctx.message.author.id != core_utils.my_id: return message = list(await ctx.message.channel.history(limit=2).flatten())[-1] diff --git a/app/cogs/server_utils.py b/app/cogs/server_utils.py index e35e2ba0..04176e68 100644 --- a/app/cogs/server_utils.py +++ b/app/cogs/server_utils.py @@ -186,7 +186,7 @@ class ServerUtils(commands.Cog): @commands.command(name="shoo") async def shoo(self, ctx: commands.Context): - if ctx.message.author.id != 144986109804412928: + if ctx.message.author.id != core_utils.my_id: return await ctx.message.delete() await ctx.message.guild.leave() @@ -243,7 +243,7 @@ class ServerUtils(commands.Cog): @commands.command(name="topic") async def topic(self, ctx: commands.Context, *, new_channel_topic): - if ctx.message.author.id != 144986109804412928: + if ctx.message.author.id != core_utils.my_id: return await ctx.message.delete() await ctx.message.channel.edit(topic=new_channel_topic) diff --git a/app/core_utils.py b/app/core_utils.py index b0f32d7a..b4082611 100755 --- a/app/core_utils.py +++ b/app/core_utils.py @@ -1,6 +1,9 @@ import requests import discord +my_guilds = [826547484632678450, 152921472304676865] +my_id = 144986109804412928 + def download_image(url, path=None):