-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from sopel-irc/verb-config
Support configuring the list of verbs used for slapping
- Loading branch information
Showing
4 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"""Configuration definitions | ||
Part of `sopel-slap`. | ||
Copyright 2024, dgw, technobabbl.es | ||
https://sopel.chat | ||
""" | ||
from __future__ import annotations | ||
|
||
from sopel.config import types | ||
|
||
VERBS = ( | ||
'annihilates', | ||
'destroys', | ||
'kicks', | ||
'owns', | ||
'punches', | ||
'pwns', | ||
'roundhouse kicks', | ||
'slaps', | ||
) | ||
|
||
|
||
class SlapSection(types.StaticSection): | ||
verbs = types.ListAttribute('verbs', default=VERBS) | ||
|
||
|
||
def do_configure(section: types.StaticSection): | ||
section.configure_setting( | ||
'verbs', | ||
"\nEnter verbs to choose from when slapping someone, one per line.\n\n" | ||
"Alternatively, press Enter twice without typing anything to write\n" | ||
"the current list (shown below) to your bot's .cfg file, where it\n" | ||
"can be edited using your favorite text editor.\n\n" | ||
"Current verb list:", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters