mirror of
https://github.com/Nick80835/microbot
synced 2025-08-22 10:09:40 +00:00
bot-ify redb
This commit is contained in:
parent
eeb8870d94
commit
7799a9e789
@ -87,8 +87,6 @@ async def titlefetcher(event, sub):
|
|||||||
|
|
||||||
|
|
||||||
async def bodyfetcher(event, sub):
|
async def bodyfetcher(event, sub):
|
||||||
await event.edit(f"`Fetching from `**r/{sub}**`…`")
|
|
||||||
|
|
||||||
for _ in range(10):
|
for _ in range(10):
|
||||||
post = REDDIT.subreddit(sub).random()
|
post = REDDIT.subreddit(sub).random()
|
||||||
|
|
||||||
@ -101,10 +99,10 @@ async def bodyfetcher(event, sub):
|
|||||||
if not body:
|
if not body:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
await event.edit(f"**{title}**\n\n{body}")
|
await event.reply(f"**{title}**\n\n{body}")
|
||||||
return
|
return
|
||||||
|
|
||||||
await event.edit(f"`Failed to find any valid content on `**r/{sub}**`!`")
|
await event.reply(f"`Failed to find any valid content on `**r/{sub}**`!`")
|
||||||
|
|
||||||
|
|
||||||
@ldr.add(pattern="redi")
|
@ldr.add(pattern="redi")
|
||||||
@ -134,7 +132,7 @@ async def redbod(event):
|
|||||||
if sub:
|
if sub:
|
||||||
await bodyfetcher(event, sub)
|
await bodyfetcher(event, sub)
|
||||||
else:
|
else:
|
||||||
await event.edit("Syntax: .redb <subreddit name>")
|
await event.reply("Syntax: .redb <subreddit name>")
|
||||||
|
|
||||||
|
|
||||||
@ldr.add(pattern="suffer")
|
@ldr.add(pattern="suffer")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user