Conversation
|
resolves #8 |
jspayne
left a comment
There was a problem hiding this comment.
Overall, looks like a pretty straightforward port. I added some notes about making use of the changes I made for redditAuth and URL config.
I feel like this could be a combined reddit/lemmy script. Given that it already supports two different formats (old and new reddit), adding lemmy could (in most cases) just be a matter of adding a third. The fact that it doesn't have the complexity of the MLB bot is a case for just changing the existing bot (it should't be too hard) as well as a case for keeping it separate (re-use just isn't that beneficial). I'm fine with it either way.
| self.shutdown() | ||
|
|
||
| def bot_state(self): | ||
| community_url = self.community['actor_id'] |
There was a problem hiding this comment.
I'll double check this, but I don't see where self.community is initialized.
| instance_name = self.settings.get("Lemmy", {}).get("INSTANCE_NAME", "") | ||
| username = self.settings.get("Lemmy", {}).get("USERNAME", "") | ||
| password = self.settings.get("Lemmy", {}).get("PASSWORD", "") | ||
| community = self.settings.get("Bot", {}).get("COMMUNITY_NAME") |
There was a problem hiding this comment.
I'd move COMMUNITY_NAME to the Lemmy configuration group for consistency with the MLB bot. Then you can use the same code for grabbing the login info as in that bot, using the redditAuth changes in redball:
| instance_name = self.settings.get("Lemmy", {}).get("INSTANCE_NAME", "") | |
| username = self.settings.get("Lemmy", {}).get("USERNAME", "") | |
| password = self.settings.get("Lemmy", {}).get("PASSWORD", "") | |
| community = self.settings.get("Bot", {}).get("COMMUNITY_NAME") | |
| # Check for Lemmy | |
| instance_name = self.settings.get("Lemmy Auth", {}).get("lemmy_instance", "") | |
| username = self.settings.get("Lemmy Auth", {}).get("lemmy_username", "") | |
| password = self.settings.get("Lemmy Auth", {}).get("lemmy_password", "") | |
| community = self.settings.get("Lemmy", {}).get("COMMUNITY_NAME") |
| current_week, | ||
| ) | ||
|
|
||
| mlb_team_subs = { |
There was a problem hiding this comment.
Maybe we can alter my URL config to move the json file(s) to a directory under bots where the urls can be shared across all the bots.
Context
The redball bot knows how to update subreddits' sidebars with a certain division's standings. This PR brings that functionality to lemmy.
Notes
plemmyinstead ofplaw