Is it possible to let my discord bot interact with its users?
Before asking this question I've tried :
import webbrowser
import discord
client = discord.client()
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('open stackoverflow'):
webbrowser.open('www.stackoverflow.com')
But this code opens up the website on the my device whenever someone commands my bot to do so, how can I code my bot such that it can open up websites on the user device?
Like if a user commands the bot to open 'stackoverflow' then can it open it up in their device instead of mine?
Discord has no interaction, as far as bots are concerned, with any users computers, as such, your bot can not open your friends web browser. What you could do, is send a URL in a Discord message that your friends can click on and then the discord application will proceed to ask the user if they would like to open their browser and head to the webpage, but your bot can not just open someone's browser.
This idea could be expanded with something like a switch statement to check string values and be able to send full urls with shorthanded ones.