sopel-irc / sopel-reddit

A reddit plugin for Sopel IRC bots.
Other
0 stars 1 forks source link

Plugin should allow overriding default user agent #12

Open dgw opened 1 year ago

dgw commented 1 year ago

Reddit prefers that applications specify a user agent of the format <platform>:<app ID>:<version string> (by u/<Reddit username>).

This plugin uses the default USER_AGENT from sopel.tools.web, which isn't exactly designed for this use case. (It's generally based on some kind of consumer web browser, not an API client. In fact, Reddit's old, now-archived API wiki page says they heavily discourage spoofing popular browsers and might even ban clients for lying about their user agent string.)

Best approach for this plugin is probably to use something like python:sopel-reddit:<plugin_version>, and append (by u/<Reddit username>) conditionally based on an optional config setting.

Should probably remove the default key, eventually, and make both the app ID and username required.