added slash command for rss

This commit is contained in:
2025-04-07 02:39:21 +10:00
parent a91df8a506
commit 657b05c479
2 changed files with 10 additions and 2 deletions

View File

@@ -94,6 +94,14 @@ async def on_ready():
logger.info(f'{bot.user} has connected to Discord!') logger.info(f'{bot.user} has connected to Discord!')
logger.info(f"Websocket latency is {bot.latency*1000} ms") logger.info(f"Websocket latency is {bot.latency*1000} ms")
@bot.slash_command()
async def upload(ctx):
if ctx.user.id == 345153972765720577 or ctx.user.id == 468866369782415360:
df = rss_gen.create_df()
rss_gen.create_48h_latest(df)
rss_gen.create_25_recent_feed(df)
await ctx.respond(f"Sucessfully uploaded 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(862039084683624468)

View File

@@ -11,14 +11,14 @@ XML_BEGIN_RECENT = """<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"
<description>Torfiles RSS Feed</description> <description>Torfiles RSS Feed</description>
<language>en</language> <language>en</language>
<ttl>5</ttl> <ttl>5</ttl>
<atom:link href="http://rss.torfiles.fieryeagle.org" rel="self" type="application/rss+xml" />""" <atom:link href="https://rss.torfiles.fieryeagle.org/recent_25.xml" rel="self" type="application/rss+xml" />"""
XML_BEGIN_LAST = """<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Torfiles Last 48h</title> XML_BEGIN_LAST = """<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Torfiles Last 48h</title>
<link>https://torfiles.fieryeagle.org</link> <link>https://torfiles.fieryeagle.org</link>
<description>Torfiles RSS Feed</description> <description>Torfiles RSS Feed</description>
<language>en</language> <language>en</language>
<ttl>5</ttl> <ttl>5</ttl>
<atom:link href="http://rss48h.torfiles.fieryeagle.org" rel="self" type="application/rss+xml" />""" <atom:link href="https://rss.torfiles.fieryeagle.org/latest_48h.xml" rel="self" type="application/rss+xml" />"""
XML_END = """</channel></rss>""" XML_END = """</channel></rss>"""