Code Monkey home page Code Monkey logo

discord-link-opener's People

Contributors

clearyy avatar elevul avatar lander-parren avatar sabifa avatar smidelis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord-link-opener's Issues

Not reading urls from bots

Hi, i'm trying to read part links from a bot on the PartAlert server, however I can't seem to get it so that it reads the links and opens it.

Modifying to Search Embed Descriptions?

Hello, the current version works well with PartAlert's notifications, however, I am attempting to modify the code to search for URL's in embedded descriptions. I believe the part of modification will need to be in lines 125-125. Any guidance would be greatly appreciated!

Suggestion: modular browser choice

I modified my local open.py to make it more modular & easier to pick a browser to use

Declare a new variable:

# Browser path
mybrowser = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'

And then the main loop just calls this new variable

# Check for keywords and blacklisted words in message urls and open browser if conditions are met
async def check_urls(urls, channel_name):
for url in urls:
if any(x in url.lower() for x in keywords) and all(x not in url.lower() for x in blacklist):
# Check if url contains partalert.net. If true, direct amazon link will be built.
if "partalert.net" in url:
amazon_url = get_amazon_url(url)
# Enter path to your browser
webbrowser.get( mybrowser ).open(amazon_url)
print_time(f'Link opened from #{channel_name}: {amazon_url}')
else:
# Enter path to your browser
webbrowser.get( mybrowser ).open(url)
print_time(f'Link opened from #{channel_name}: {url}')
if playBellSound:
winsound.PlaySound('bell.wav', winsound.SND_FILENAME)

This way only the variable on top needs to be modified when deciding to use Chrome or Edge or Firefox etc

CMD Issue? **TypeError: sequence item 0: expected str instance, int found**

When I run open.py I get this message, last row error...any idea how to solve it? Thanks.

[INFO] USER#1234 is ready to watch for links.
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\site-packages\discord\client.py", line 343, in _run_event
await coro(*args, **kwargs)
File "C:\Users\User123\Desktop\discord-link-opener-master\open.py", line 116, in on_ready
print_time('Watching for keywords {}.'.format(', '.join(keywords)))
TypeError: sequence item 0: expected str instance, int found

EMBED not work anymore.

Hi,
I try to use with embed msg.
Without embed all work fine.

Nothing happens, then i cannot send any bad logs.

It does not open new tabs

Great program, however I ran into some problems.

The program opens the links only when Edge is closed, if the browser is open when the notification from part alert arrives, the browser (edge) does not open any new tab. The only way to fix this is to manually close edge.
The bell sound is only heard when Edge is closed after opening the Link.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.