This commit is contained in:
ggodot 2025-01-07 00:42:28 +01:00
parent eabaa99471
commit 47b349322b

View File

@ -63,4 +63,16 @@ async def search(ctx, search: Option(str, description = "What do you want to get
@bot.slash_command(guild_ids=g_ids, name = "random", description="Returns a random Wikipedia article")
async def search(ctx):
await ctx.channel.trigger_typing() # shows that bot is typing
ran_article = wikipedia.random().replace(" ", "_").replace(" ", "_")
try:
await ctx.respond(f"https://en.wikipedia.org/wiki/{ran_article}")
except:
await ctx.send(f"https://en.wikipedia.org/wiki/{ran_article}")
bot.run("MTMyNTk1Mzg4OTcyNzQxNDM0Mw.G2Tgo0.2OhbgaVYhys0BhxJMVgGDnG0W5qvxH-soJML3M") bot.run("MTMyNTk1Mzg4OTcyNzQxNDM0Mw.G2Tgo0.2OhbgaVYhys0BhxJMVgGDnG0W5qvxH-soJML3M")