Compare commits
2 Commits
eabaa99471
...
de4369afb0
| Author | SHA1 | Date | |
|---|---|---|---|
| de4369afb0 | |||
| 47b349322b |
@ -1,8 +1,11 @@
|
||||
# ToDo
|
||||
- [ ] Wikipedia speedrun timer a leaderboard
|
||||
|
||||
# Token Security
|
||||
- [ ] how to import it
|
||||
|
||||
|
||||
# Docs by
|
||||
- [Discrod.py](https://discordpy.readthedocs.io/en/stable/index.html)
|
||||
- [Wikiipedia.py](ttps://wikipedia.readthedocs.io/en/latest/code.html)
|
||||
- [Wikipedia.py](ttps://wikipedia.readthedocs.io/en/latest/code.html)
|
||||
|
||||
|
||||
12
wikibot.py
12
wikibot.py
@ -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")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user