added variables for discord ids to improve readability
This commit is contained in:
@@ -22,6 +22,13 @@ formatter.default_msec_format = None
|
||||
ch.setFormatter(formatter)
|
||||
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()
|
||||
TOKEN = os.getenv('DISCORD_TOKEN')
|
||||
@@ -102,14 +109,14 @@ async def on_ready():
|
||||
|
||||
@bot.slash_command()
|
||||
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()
|
||||
await ctx.respond("Sucessfully updated RSS feed")
|
||||
|
||||
@bot.slash_command()
|
||||
async def upload(ctx):
|
||||
messagechannel = bot.get_channel(862039084683624468)
|
||||
if ctx.user.id == 345153972765720577 or ctx.user.id == 468866369782415360:
|
||||
messagechannel = bot.get_channel(torrent_link_channel_id)
|
||||
if ctx.user.id == fiery_eagle_id or ctx.user.id == dodi_id:
|
||||
files = files_to_upload(".")
|
||||
try:
|
||||
assert len(files) > 0
|
||||
@@ -127,13 +134,13 @@ async def on_message(message):
|
||||
|
||||
user_message = str(message.content)
|
||||
|
||||
if message.author.id == 1094991519812956270:
|
||||
if message.author.id == bot_id:
|
||||
return
|
||||
|
||||
messagechannel = bot.get_channel(862039084683624468)
|
||||
messagechannel = bot.get_channel(torrent_link_channel_id)
|
||||
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 = links.split(" ")
|
||||
for i in links:
|
||||
|
||||
Reference in New Issue
Block a user