-2

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?

CopyrightC
  • 857
  • 2
  • 7
  • 15
  • 1
    what is the problem exactly, what do you want to achieve? Your title ask something about a google search, do you want a google search to open up _instead_ of the stackoverflow page? – Pac0 Aug 04 '20 at 06:36
  • As a sketch of answer, doing a google search is basically open the page `https://www.google.com/search?q=example` and replacing "example" by the search terms. – Pac0 Aug 04 '20 at 06:37
  • Do you want an API that you can request from and I gives you the top X results or do you want to open a tab in the browser for the google search?? – Ahmed Khaled Aug 04 '20 at 10:51
  • I want that if my friends type 'open stackoverflow' then it should get opened up in the browser. – CopyrightC Aug 04 '20 at 10:56
  • Currently, if the type 'open stackoverflow' then it gets opened up in my pc not in theirs. I want it to be get opened up in their pc not in mine – CopyrightC Aug 04 '20 at 10:58
  • Not possible. For this to work you would have to remotely execute code on the client computers. – Benjin Aug 04 '20 at 11:30

2 Answers2

0

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.

Adam Kerik
  • 481
  • 6
  • 15
-1

You can't just interact with the users that way. that is not allowed in terms and conditions of discord you might use it to help others but some people can use that thing in malicious way.