Add new command: options

This commit is contained in:
Schimon Jehudah 2024-03-09 23:31:06 +00:00
parent ffa002cfa0
commit ba61250f84
5 changed files with 22 additions and 3 deletions

View file

@ -1190,6 +1190,7 @@ async def view_entry(url, num):
return response
# TODO get all active feeds of active accounts and scan the feed with the earliest scanned time
# TODO Rename function name (idea: scan_and_populate)
async def scan(self, jid_bare, db_file, url):
"""

View file

@ -203,6 +203,12 @@ stop
Disable bot and stop updates.
"""
[options]
options = """
options
List options.
"""
[preview]
read = """
read <url>

View file

@ -1,2 +1,2 @@
__version__ = '0.1.35'
__version_info__ = (0, 1, 35)
__version__ = '0.1.36'
__version_info__ = (0, 1, 36)

View file

@ -2126,7 +2126,6 @@ class Slixfeed(slixmpp.ClientXMPP):
e_key = e_key.capitalize()
# form.add_field(ftype='fixed',
# value=e_val)
print(type(e_val))
if e_key == 'Name':
form.add_field(ftype='fixed',
value=e_val)

View file

@ -829,6 +829,19 @@ async def message(self, message):
db_file, key, val)
response = 'All items of newly added feeds be delivered.'
XmppMessage.send_reply(self, message, response)
case 'options':
response = 'Options:\n```'
for key in self.settings[jid_bare]:
val = self.settings[jid_bare][key] or self.settings['default'][key]
# val = Config.get_setting_value(self.settings, jid_bare, key)
steps = 11 - len(key)
pulse = ''
for step in range(steps):
pulse += ' '
response += '\n' + key + pulse + ': ' + str(val)
print(response)
response += '\n```'
XmppMessage.send_reply(self, message, response)
case _ if message_lowercase.startswith('quantum'):
key = message_text[:7]
val = message_text[8:]