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

Option to restrict urls.detection events to specific desired plugins? #188

Closed
lailoken503 opened this issue Apr 18, 2021 · 7 comments
Closed
Labels

Comments

@lailoken503
Copy link

I have the bot in a channel where members pastes youtube link, and Cardinal handle those pasted links very well: it shows the title, views and all that stuff. It's great.

But, it relies on the urls plugin for the urls.detection event, and we cannot seem to get the urls plugin to not listen for anything else BUT the youtube links. For example, if someone pastes a link to a CNN article, urls kicks in and lists the title of the article. Handy, for some, I suppose, but not necessarily a desired trait, at least, in our case.

Is there a way to have urls.detection only fire on youtube links and nothing else? Perhaps a settings in urls config,json?

@johnmaguire
Copy link
Owner

I've just pushed a commit and a new release 3.2.1 which adds an option handle_generic_urls boolean to the urls config.json. Hope that helps!

@lailoken503
Copy link
Author

I've just pushed a commit and a new release 3.2.1 which adds an option handle_generic_urls boolean to the urls config.json. Hope that helps!

Not sure why but the youtube plugin isn't firing at all, all I see are
cardinal | 2021-04-19 01:49:21,579 - cardinal.bot - DEBUG - lailoken503!~lailo@i.welcome.our.palmtop.tiger.supreme.overlord to #lailoken: https://youtube.com/watch?v=etAIpkdhU9Q cardinal | 2021-04-19 01:49:21,579 - cardinal.plugins - DEBUG - Attempting to fire event: irc.privmsg cardinal | 2021-04-19 01:49:21,579 - cardinal.plugins - DEBUG - Calling 1 callbacks for event: irc.privmsg cardinal | 2021-04-19 01:49:21,581 - cardinal.plugins - DEBUG - Callback LSGMKU accepted event 'irc.privmsg'
Not sure what I'm doing wrong, but I have "handle_generic_urls": false set in plugins\urls\config.json

@johnmaguire
Copy link
Owner

Can you tell me what plugins you have in your main config file?

@johnmaguire johnmaguire reopened this Apr 19, 2021
@lailoken503
Copy link
Author

Can you tell me what plugins you have in your main config file?

"plugins": [ "admin", "google", "help", "join_on_invite", "movies", "ping", "seen", "tv", "urbandict", "weather", "wolframalpha", "youtube" ],

@lailoken503
Copy link
Author

Can you tell me what plugins you have in your main config file?

"plugins": [ "admin", "google", "help", "join_on_invite", "movies", "ping", "seen", "tv", "urbandict", "weather", "wolframalpha", "youtube" ],

D'oh.

@lailoken503
Copy link
Author

Can you tell me what plugins you have in your main config file?

"plugins": [ "admin", "google", "help", "join_on_invite", "movies", "ping", "seen", "tv", "urbandict", "weather", "wolframalpha", "youtube" ],

D'oh.

Thats what I get for trying to fix stuff in the middle of a screaming kids birthday party after a long day at work and getting my first covid-19 shot. Everything's working as expected, I somehow removed the urls plugin when I was removing the other unwanted plugins.

@johnmaguire
Copy link
Owner

No worries, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants