1515from sopel .config import types
1616
1717
18+ BACKEND = 'https://pronouns.sopel.chat'
1819LOGGER = logging .getLogger (__name__ )
1920
2021
2122class PronounsSection (types .StaticSection ):
2223 fetch_complete_list = types .BooleanAttribute ('fetch_complete_list' , default = True )
23- """Whether to attempt fetching the complete list pronoun.is uses, at bot startup."""
24+ """Whether to attempt fetching the complete list the web backend uses, at bot startup."""
2425
2526
2627def configure (settings ):
2728 """
2829 | name | example | purpose |
2930 | ---- | ------- | ------- |
30- | fetch_complete_list | True | Whether to attempt fetching the complete pronoun list from pronoun.is at startup. |
31+ | fetch_complete_list | True | Whether to attempt fetching the complete pronoun list from the web backend at startup. |
3132 """
3233 settings .define_section ('pronouns' , PronounsSection )
3334 settings .pronouns .configure_setting (
3435 'fetch_complete_list' ,
35- 'Fetch the current pronoun.is list at startup?' )
36+ 'Fetch the most current list of pronoun sets at startup?' )
3637
3738
3839def setup (bot ):
3940 bot .config .define_section ('pronouns' , PronounsSection )
4041
41- # Copied from pronoun.is , leaving a *lot* out.
42+ # Copied from svelte-pronounisland , leaving a *lot* out.
4243 # If ambiguous, the earlier one will be used.
4344 # This basic set is hard-coded to guarantee that the ten most(ish) common sets
44- # will work, even if fetching the current pronoun.is set from GitHub fails.
45+ # will work, even if fetching the current set from GitHub fails.
4546 bot .memory ['pronoun_sets' ] = {
4647 'ze/hir' : 'ze/hir/hir/hirs/hirself' ,
4748 'ze/zir' : 'ze/zir/zir/zirs/zirself' ,
@@ -58,12 +59,11 @@ def setup(bot):
5859 if not bot .config .pronouns .fetch_complete_list :
5960 return
6061
61- # and now try to get the current one
62- # who needs an API that might never exist?
63- # (https://github.com/witch-house/pronoun.is/pull/96)
62+ # and now try to get the current list our fork of the backend uses
63+ # (https://github.com/sopel-irc/pronoun-service)
6464 try :
6565 r = requests .get (
66- 'https://github.com/witch-house /pronoun.is /raw/master/resources /pronouns.tab' )
66+ 'https://github.com/sopel-irc /pronoun-service /raw/main/src/lib/data /pronouns.tab' )
6767 r .raise_for_status ()
6868 fetched_pairs = _process_pronoun_sets (r .text .splitlines ())
6969 except requests .exceptions .RequestException :
@@ -152,7 +152,7 @@ def pronouns(bot, trigger):
152152 # gender, but like… it's a bot.
153153 bot .say (
154154 "I am a bot. Beep boop. My pronouns are it/it/its/its/itself. "
155- "See https://pronoun.is/ it for examples."
155+ "See {}/ it for examples." . format ( BACKEND )
156156 )
157157 else :
158158 bot .reply ("I don't know {}'s pronouns. They can set them with "
@@ -166,8 +166,15 @@ def say_pronouns(bot, nick, pronouns):
166166 break
167167 short = pronouns
168168
169- bot .say ("{}'s pronouns are {}. See https://pronoun.is/{} for "
170- "examples." .format (nick , pronouns , short ))
169+ bot .say (
170+ "{nick}'s pronouns are {pronouns}. See {BACKEND}/{short} for examples."
171+ .format (
172+ nick = nick ,
173+ pronouns = pronouns ,
174+ BACKEND = BACKEND ,
175+ short = short ,
176+ )
177+ )
171178
172179
173180@plugin .command ('setpronouns' )
0 commit comments