diff options
author | nico <nico@magicbroccoli.de> | 2018-11-06 23:43:11 +0100 |
---|---|---|
committer | nico <nico@magicbroccoli.de> | 2018-11-06 23:43:11 +0100 |
commit | 0c313565f2b649366f7382dc1b3f28a3e80f4ffc (patch) | |
tree | 953d5ccff11b3954794d3ed713239e16b3be6b19 /common/strings.py | |
parent | 559ab280ca705bca200823a0493308b10aba1dd4 (diff) |
simplification and major rework
* updated gitignore file
* partly reworked servercontact implementation
* complete rework of uptime, version
* part rework of xep requests
+ added more comments to xep requests
+ added opt_arg to version, xep and contact
* complete rework of validate function
* updated HandleError function
* part rework of StaticStrings function
+ implemented data dictionary to hold all data in main bot
+ added message_ids
* complete rework of queue building and deduplication
Diffstat (limited to 'common/strings.py')
-rw-r--r-- | common/strings.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/common/strings.py b/common/strings.py index 6866a31..faac65c 100644 --- a/common/strings.py +++ b/common/strings.py @@ -29,14 +29,13 @@ class StaticAnswers: "number_keywords": ["!xep"] } - def keys(self, arg="", keyword='keywords'): - if arg == 'list': - try: - return self.keywords[keyword] - except KeyError: - return self.keywords['keywords'] + def keys(self, key=""): + # if specific keyword in referenced return that + if key in self.keywords.keys(): + return self.keywords[key] + # in any other case return the whole dict else: - return self.keywords + return self.keywords["keywords"] def gen_help(self): helpdoc = "\n".join(['%s' % value for (_, value) in self.helpfile.items()]) |