Commit graph

926 commits

Author SHA1 Message Date
jesopo
6f8338b7b5 allow users to set command-method for PMs with them 2019-12-10 17:11:44 +00:00
jesopo
b4b998b7d4 default command responses in PM to use NOTICE 2019-12-10 16:59:00 +00:00
jesopo
cffbcad430 support bot-wide aliases with !balias
closes #212
2019-12-10 11:28:09 +00:00
jesopo
734aec179f move aliases.py to core_modules 2019-12-10 11:23:34 +00:00
jesopo
a3bde5e682 fix ModuleManager.find_module() - don't set path until it's actually found 2019-12-10 11:08:44 +00:00
jesopo
58c09f7342 fix typos, type hinting and missed changes in ModuleManager 2019-12-10 05:32:55 +00:00
jesopo
638eee0d68 move core modules to src/core_modules, make them uneffected by white/black list 2019-12-10 05:27:35 +00:00
jesopo
9d16f7d523 move sys.exit() codes to an enum in utils.consts 2019-12-10 05:26:16 +00:00
jesopo
3028759c86 use get_list and set_list to move dynamic module en/disabling to bot.conf 2019-12-07 11:07:43 +00:00
jesopo
3bf2f86702 added get_list() and set_list() to src/Config.py 2019-12-07 11:05:32 +00:00
jesopo
e08bac9312 add src/Config.py.__delitem__ 2019-12-07 11:05:13 +00:00
jesopo
a98dc6e0a6 add src/Config.py.__setitem__ 2019-12-07 10:51:04 +00:00
jesopo
fc069d6da2 fix src/Config.py type hinting 2019-12-07 10:50:50 +00:00
jesopo
7274d1bf28 add ability to save config file 2019-12-07 10:42:43 +00:00
jesopo
374cc307b1 remove -m/-M and BaseModule.command_line - it doesn't work any more 2019-12-07 10:23:17 +00:00
jesopo
b212714561 Revert "add utils.parse.shortencode() and utils.parse.shortdecode - effectively base62"
This reverts commit e71f3bbc36.
2019-12-06 14:29:26 +00:00
jesopo
e71f3bbc36 add utils.parse.shortencode() and utils.parse.shortdecode - effectively base62 2019-12-06 12:10:41 +00:00
jesopo
b889a9f841 add utils.http.Session object, to preserve cookies across requests 2019-12-03 13:00:43 +00:00
jesopo
499e83a1cb refactor karma to be per-user. added data migration script for this 2019-12-01 07:07:28 +00:00
jesopo
3ce947bb77 add database.users.get_nickname, to get nickname from ID 2019-12-01 07:05:17 +00:00
jesopo
b385323386 fix database.user_settings.find logic 2019-12-01 07:05:01 +00:00
jesopo
91c3688018 only add BufferLine to buffer *after* received.message.* callback 2019-11-30 20:25:52 +00:00
jesopo
d688636909 rework permissions module to precompile hostmasks 2019-11-30 19:32:38 +00:00
jesopo
411f66324d use ANSI_RESET in utils.irc.parse_format, not all the different resets 2019-11-28 15:42:12 +00:00
jesopo
c79bd6d0ba utils.http.Response.decode() should default to detected encoding 2019-11-28 07:35:16 +00:00
jesopo
747ba5c646 add IRCLine.parse_human() to allow for "!raw /msg jesopo hello" 2019-11-27 17:38:17 +00:00
jesopo
40a459a83c add Buffer.get_all 2019-11-27 12:59:50 +00:00
jesopo
2139c99562 fix BufferLine.notes definition 2019-11-27 12:59:36 +00:00
jesopo
710b711c70 dataclass-ify IRCBuffer.BufferLine, add .notes={} 2019-11-27 12:07:15 +00:00
jesopo
9972125b24 remove IRCBuffer.skip_next (not used), pass buffer lines on message events 2019-11-27 12:06:57 +00:00
jesopo
e4a5bd01e9 explicitly use "lxml" for finding page encoding 2019-11-26 14:34:48 +00:00
jesopo
8e9da0d681 _find_encoding takes bytes and soupifies now 2019-11-26 13:58:37 +00:00
jesopo
c898bc4be1 utils.http.request_many() shouldn't decode data for Response 2019-11-26 13:54:17 +00:00
jesopo
2d21dfa229 utils.http.Response.data should always be bytes - add .decode and .soup 2019-11-26 13:42:01 +00:00
jesopo
ed775ddbe3 remove parser from utils.http.Request, add Request.soup() 2019-11-26 11:35:56 +00:00
jesopo
93aea08818 utils.datetime.datetime_utcnow() -> utils.datetime.utcnow() 2019-11-25 18:18:09 +00:00
jesopo
6a6e789ec9 add cookies and .json() to utils.http.Response objects 2019-11-25 18:17:30 +00:00
jesopo
ab8bc65cc9 change utils.http.Request to be a dataclass 2019-11-25 13:42:10 +00:00
jesopo
5730d6fe59 refactor commands (mostly stdout/stderr) and split typing/reply out
closes #208
2019-11-22 16:23:30 +00:00
jesopo
2dfc55fb9f refactor permissions and allow hostmasks to be assigned to accounts 2019-11-21 15:49:08 +00:00
jesopo
9f8c5acf52 add a way to execute commands through bitbotd (use for master-password) 2019-11-21 10:39:26 +00:00
jesopo
4d30263315 give bitbot a unique User-Agent
closes #206
2019-11-20 14:42:34 +00:00
jesopo
11c3104d02 move things like IRCBot.VERSION to before imports (for utils.http) 2019-11-20 14:41:14 +00:00
jesopo
bd176240d6 consecutive HASH_STOP chars at start shouldn't count as a stop 2019-11-19 14:45:47 +00:00
jesopo
554f21a84c HASH_STOP should still be respected if last character 2019-11-19 14:43:24 +00:00
jesopo
bc6b1dda47 chance src/Cache.py from time.monotonic() to time.time() 2019-11-19 11:41:50 +00:00
jesopo
65023dc84b move "+5m" syntax parsing out to utils.parse 2019-11-18 15:57:23 +00:00
jesopo
fe25c6bc26 switch some utils.irc functions to use f-strings 2019-11-18 14:16:30 +00:00
jesopo
d89a3125ab truncate nickname hash operations to 64bit 2019-11-18 14:09:47 +00:00
jesopo
a8b1bd95f7 implement weechat-style djb2 colour hashing 2019-11-18 13:51:55 +00:00
jesopo
a7e21abfad import missing comma, 'Events'->'Event' 2019-11-18 12:10:20 +00:00
jesopo
06161b326c remove unused imports in src/utils/__init__.py 2019-11-18 12:09:18 +00:00
jesopo
9c4902dcfe "EventsResultsError"->"EventResultsError", move errors to utils.error 2019-11-18 12:06:59 +00:00
jesopo
5d55086847 move utils.consts.BITBOT_MAGIC to utils.decorators 2019-11-15 14:09:35 +00:00
jesopo
5d01db8514 move all datetime-related code from utils/__init__ to utils.datetime 2019-11-15 13:59:09 +00:00
jesopo
5e8cf06a45 dont expose has_magic/get_magic in utils/__init__.py, ref directly 2019-11-15 13:41:03 +00:00
jesopo
bfcf40edd7 split some stuff out of utils/__init__.py 2019-11-15 13:39:24 +00:00
jesopo
2cb55306c3 show first-words datestamp on !words output 2019-11-15 12:13:16 +00:00
jesopo
c9cb8c8805 set info log rolling backup count to 1 (0 means "keep all backups") 2019-11-14 13:35:23 +00:00
jesopo
a1e9aabb84 add typehinting for foreground/background 2019-11-13 10:47:58 +00:00
jesopo
5d2dd9178f only set color_finished=True when is_background, otherwise next char sets it 2019-11-13 10:43:15 +00:00
jesopo
8a8bd8a77e colorize nicks on JOIN formatting 2019-11-11 12:49:45 +00:00
jesopo
b7bfd414be hash_colorize code should first be looked up in HASH_COLORS 2019-11-11 12:48:37 +00:00
jesopo
727fb3427d .lower() strings when hash-colorizing them 2019-11-11 12:40:36 +00:00
jesopo
ac30f8d4cc don't use hash() for hashed colorising as it's not stable through restarts 2019-11-11 12:13:46 +00:00
jesopo
2ad8623eb3 add utils.irc.hash_colorize() to color a string by the string's hash 2019-11-11 12:06:16 +00:00
jesopo
98183fe4b9 add IRCArgs.append func 2019-11-08 17:41:18 +00:00
jesopo
5fcf18313e silently eat Control socket .send() failures 2019-11-08 13:38:07 +00:00
jesopo
09fe1c5a70 don't stop parsing colors at comma 2019-11-04 13:33:10 +00:00
jesopo
bcdffacab5 add on_pause() and on_resume() for module - use in rest_api.py 2019-11-04 10:52:41 +00:00
jesopo
2b001e1ec6 ' ' -> " " 2019-10-31 13:06:26 +00:00
Valentin Lorentz
fbf8cd1a16 Fix type errors detected by 'mypy --ignore-missing-imports src'. 2019-10-30 22:26:59 +01:00
jesopo
9958c9169d fix _line() related type hinting issues in IRCServer.py 2019-10-30 13:46:29 +00:00
jesopo
3634b72622 add utils.date_human() - use it in badges.py 2019-10-30 10:25:07 +00:00
jesopo
4d85c3d1e0 utils.parse doesn't need to import utils 2019-10-29 18:03:03 +00:00
jesopo
080bcef3a0 'from src.utils import' -> 'from . import' 2019-10-29 18:02:50 +00:00
jesopo
9b349f8cc0 move typing.Callable def so Event doesn't have to be in " " 2019-10-29 18:00:59 +00:00
jesopo
40a340e94f utils.cli shouldn't know about Database 2019-10-29 18:00:38 +00:00
jesopo
46e4b75f6b utils.irc doesn't need to know about the whole of utils 2019-10-29 18:00:19 +00:00
jesopo
9f48dfb1f1 send_mode() args is already a list 2019-10-29 10:23:47 +00:00
jesopo
8983338680 move src/utils/irc/__init__.py to src/utils/irc.py 2019-10-28 10:57:19 +00:00
jesopo
7ee65f8f8c remove src/utils/irc/protocol.py 2019-10-28 10:56:33 +00:00
jesopo
1bddc3b37f Revert "remove unneeded import"
This reverts commit 8425c11c97.
2019-10-27 10:32:13 +00:00
jesopo
8425c11c97 remove unneeded import 2019-10-27 10:25:37 +00:00
jesopo
8f4b5a0e70 move IRCLine related code from utils.irc to IRCLine.py 2019-10-27 10:19:00 +00:00
jesopo
3a755bb15f don't consume past 2nd digit in e.g. "\03033,123" 2019-10-25 17:12:24 +01:00
jesopo
877287291a reason arg of panic() shouldn't be optional, detect current exception 2019-10-25 14:31:09 +01:00
jesopo
b3f43a6721 remove bot.panic() throw kwarg 2019-10-25 14:27:12 +01:00
jesopo
226ebe1f1f DEBUG log IRCBot.connect failure stacktrace 2019-10-25 14:18:22 +01:00
jesopo
7d4c6b6941 bot.panic() should just call sys.exit() 2019-10-25 14:14:30 +01:00
jesopo
9d1b640db4 re-add list moving CAP objects from capability_queue to capabilities_requested 2019-10-25 11:52:11 +01:00
Valentin Lorentz
d8c48fa98f Make send_capability_queue split 'CAP REQ' message based on string length.
Instead of sending caps by groups of 10.
2019-10-23 21:20:56 +02:00
jesopo
062290704c explicitly break event loop on Kill 2019-10-22 14:26:40 +01:00
jesopo
00e85c7573 bitbotctl stop should be keepalive so it exits when bitbotd exits 2019-10-18 11:29:59 +01:00
jesopo
f64131a10f support utf8 hostnames by punycode (idna) encoding 2019-10-18 10:58:24 +01:00
jesopo
a1b8a4033a hook_handler should be catching TRACE logging 2019-10-17 17:49:49 +01:00
jesopo
aa2511baaa add IRCBot.stop() - use it for !shutdown and './bitbotctl stop' 2019-10-17 16:53:48 +01:00
jesopo
417c4f302e default to using a "data directory" for bitbot (~/.bitbot/) 2019-10-17 12:39:56 +01:00
jesopo
b895958f09 remove debug prints from IRCBot 2019-10-15 16:16:29 +01:00
jesopo
aa3906dfa3 fix type linting issues for client in Control.is_readable 2019-10-14 18:17:15 +01:00