Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to play a bell sound on as soon as a link is opened #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added bell.wav
Binary file not shown.
6 changes: 6 additions & 0 deletions open.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from discord.ext.commands import Bot
from discord.ext import commands
import re
import winsound

'''
by cleary#6546 // @preorderd
Expand All @@ -26,6 +27,9 @@
#enter token of discord account that has access to watch specified channels
token = ''

#whether you would like to hear a bell sound as soon as a link is opened
playBellSound = True

global start_count
start_count = 0

Expand All @@ -35,6 +39,8 @@ async def check_urls(urls):
if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):
#enter path to chrome here, for windows 10, this should work
webbrowser.get("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s").open(url)
if playBellSound:
winsound.PlaySound('bell.wav', winsound.SND_FILENAME)
print(f'Opened {url}')

@client.event
Expand Down