added variables for discord ids to improve readability

This commit is contained in:
2025-04-09 19:30:28 +10:00
parent f06350e0ee
commit 343f888503

View File

@@ -22,6 +22,13 @@ formatter.default_msec_format = None
ch.setFormatter(formatter) ch.setFormatter(formatter)
logger.addHandler(ch) logger.addHandler(ch)
########################################## ##########################################
#Discord ID resource
bot_id = 1094991519812956270
fiery_eagle_id = 345153972765720577
dodi_id = 468866369782415360
torrent_link_channel_id = 862039084683624468
new_release_tag_channel = 918559776269553756
##########################################
load_dotenv() load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN') TOKEN = os.getenv('DISCORD_TOKEN')
@@ -102,14 +109,14 @@ async def on_ready():
@bot.slash_command() @bot.slash_command()
async def update_rss(ctx): async def update_rss(ctx):
if ctx.user.id == 345153972765720577 or ctx.user.id == 468866369782415360: if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id:
update_rss_feed() update_rss_feed()
await ctx.respond("Sucessfully updated RSS feed") await ctx.respond("Sucessfully updated RSS feed")
@bot.slash_command() @bot.slash_command()
async def upload(ctx): async def upload(ctx):
messagechannel = bot.get_channel(862039084683624468) messagechannel = bot.get_channel(torrent_link_channel_id)
if ctx.user.id == 345153972765720577 or ctx.user.id == 468866369782415360: if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id:
files = files_to_upload(".") files = files_to_upload(".")
try: try:
assert len(files) > 0 assert len(files) > 0
@@ -127,13 +134,13 @@ async def on_message(message):
user_message = str(message.content) user_message = str(message.content)
if message.author.id == 1094991519812956270: if message.author.id == bot_id:
return return
messagechannel = bot.get_channel(862039084683624468) messagechannel = bot.get_channel(torrent_link_channel_id)
logger.debug(f"{user_message}") logger.debug(f"{user_message}")
if ("http" in user_message and (message.channel.id == 918559776269553756 or message.author.id == 345153972765720577)): #and 1081399528265089125 in [roles.id for roles in username.roles]) # noqa: E501 if ("http" in user_message and (message.channel.id == new_release_tag_channel or message.author.id == fiery_eagle_id)):
links = user_message.replace("\n", " ") links = user_message.replace("\n", " ")
links = links.split(" ") links = links.split(" ")
for i in links: for i in links: