Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
mockk committed Nov 27, 2018
1 parent f108f94 commit c4efc88cae33c1c59ccc515ffbf4f11099f3cfd3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
@@ -28,6 +28,7 @@ def commands():
commandList += "!name\n"
commandList += "!hangman\n"
commandList += "weather\n"
commandList += "web\n"
return commandList


@@ -105,9 +106,18 @@ async def on_message(message):
elif message.content.lower().startswith('!help'):
await client.send_message(message.channel, commands())

##################################################
# Kelvin Mock
elif message.content.lower().startswith('weather'):
await weather_realtime.weather(client,message)

elif message.content.lower().startswith('web'):
await web.YouTubeBrowser(client,message)

elif message.content.lower().startswith('social'):
await
##################################################

# sorry bout that, this part is causing some errors with stackoverflow module
# elif message.content.lower().startswith('!'):
# await client.send_message(message.channel, "Unknown command! Use `!help` for a command/usage list.")
44 web.py
@@ -1,22 +1,24 @@
import requests
from bs4 import BeautifulSoup
import webbrowser

page=requests.get("https://www.youtube.com/")

soup=BeautifulSoup(page.text,"html.parser")


webbrowser.open("https://www.youtube.com/",new=2)
if webbrowser.open("https://www.youtube.com/",new=2)==True: #status printing
print("Successful browser, see in a few seconds.")
print("Status: ",page)
else:
print("I'm sorry. The browser isn't working though.")
print("Status: ",page)


#artist_name_list=soup.find(class_="BodyText")

#artist_name_list_items=artist_name_list.find_all("a")
async def YouTubeBrowser(client,message):
import requests
from bs4 import BeautifulSoup
import webbrowser

page=requests.get("https://www.youtube.com/")

soup=BeautifulSoup(page.text,"html.parser")


webbrowser.open("https://www.youtube.com/",new=2)
if webbrowser.open("https://www.youtube.com/",new=2)==True: #status printing
print("Successful browser, see in a few seconds.")
await client.send_message(message.channel,"Successful browser, see in a few seconds.")
print("Status: ",page)
msg="Status: "+str(page)
await client.send_message(message.channel,msg)
else:
print("I'm sorry. The browser isn't working though.")
await client.send_message(message.channel,"I'm sorry. The browser isn't working though.")
print("Status: ",page)
msg="Status: "+str(page)
await client.send_message(message.channel,msg)

0 comments on commit c4efc88

Please sign in to comment.