Compare commits
10 commits
c59fa577bb
...
3bf47d9ded
Author | SHA1 | Date | |
---|---|---|---|
3bf47d9ded | |||
|
b9ffe7b027 | ||
|
5321cef954 | ||
|
b4c4960578 | ||
|
db0fae9869 | ||
|
bb0eadbbea | ||
|
4a6037c774 | ||
|
b46314af69 | ||
|
498c1ea193 | ||
|
5f895544a8 |
7 changed files with 19 additions and 14 deletions
|
@ -16,7 +16,7 @@ If you wish to create backups of your BitBot instance (which you should, [borgba
|
|||
I run BitBot as-a-service on most popular networks (willing to add more networks!) and offer github/gitea/gitlab webhook to IRC notifications for free to FOSS projects. Contact me for more information!
|
||||
|
||||
## Contact/Support
|
||||
Come say hi at [#bitbot on freenode](https://webchat.freenode.net/?channels=#bitbot)
|
||||
Come say hi at `#bitbot` on irc.libera.chat
|
||||
|
||||
## License
|
||||
This project is licensed under GNU General Public License v2.0 - see [LICENSE](LICENSE) for details.
|
||||
|
|
|
@ -15,8 +15,8 @@ class Module(ModuleManager.BaseModule):
|
|||
today = datetime.datetime.utcnow().date()
|
||||
week = datetime.timedelta(days=7)
|
||||
|
||||
not_valid_until = (today-certificate.not_valid_before.date()).days
|
||||
not_valid_after = (certificate.not_valid_after.date()-today).days
|
||||
not_valid_until = (today-certificate.not_valid_before_utc.date()).days
|
||||
not_valid_after = (certificate.not_valid_after_utc.date()-today).days
|
||||
|
||||
if not_valid_until < 0:
|
||||
self.log.warn(
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
from src import ModuleManager, utils
|
||||
|
||||
CAP = utils.irc.Capability("message-tags", "draft/message-tags-0.2")
|
||||
|
||||
@utils.export("channelset", utils.Setting("greeting",
|
||||
"Set a greeting to send to users when they join",
|
||||
example="welcome to the channel!"))
|
||||
|
@ -10,5 +12,9 @@ class Module(ModuleManager.BaseModule):
|
|||
def join(self, event):
|
||||
greeting = event["channel"].get_setting("greeting", None)
|
||||
if greeting:
|
||||
tags = {}
|
||||
if event["server"].has_capability(CAP):
|
||||
tags["+draft/channel-context"] = event["channel"].name
|
||||
|
||||
event["user"].send_notice("[%s] %s" % (event["channel"].name,
|
||||
greeting))
|
||||
greeting), tags)
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
beautifulsoup4 ==4.8.0
|
||||
cryptography >=3.3.2
|
||||
dataclasses ==0.6;python_version<'3.7'
|
||||
dnspython ==1.16.0
|
||||
feedparser ==5.2.1
|
||||
dnspython ==2.0.0
|
||||
feedparser ==6.0.2
|
||||
html5lib ==1.0.1
|
||||
isodate ==0.6.0
|
||||
lxml ==4.6.2
|
||||
lxml ==4.9.1
|
||||
netifaces ==0.10.9
|
||||
PySocks ==1.7.1
|
||||
python-dateutil ==2.8.1
|
||||
pytz ==2019.2
|
||||
requests ==2.22.0
|
||||
requests ==2.31.0
|
||||
scrypt ==0.8.13
|
||||
suds-jurko ==0.6
|
||||
tornado ==6.0.3
|
||||
|
|
|
@ -235,7 +235,7 @@ class ModuleManager(object):
|
|||
definition.filename)
|
||||
module = importlib.util.module_from_spec(import_spec)
|
||||
sys.modules[import_name] = module
|
||||
loader = typing.cast(importlib.abc.Loader, import_spec.loader)
|
||||
loader = typing.cast(importlib._abc.Loader, import_spec.loader)
|
||||
loader.exec_module(module)
|
||||
|
||||
module_object_pointer = getattr(module, "Module", None)
|
||||
|
|
|
@ -125,7 +125,7 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
@utils.hook("received.command.serverignore")
|
||||
@utils.kwarg("help", "Ignore a command on the current server")
|
||||
@utils.kwarg("permissions", "serverignore")
|
||||
@utils.kwarg("permission", "serverignore")
|
||||
@utils.spec("!<command>wordlower")
|
||||
def server_ignore(self, event):
|
||||
command = event["spec"][0]
|
||||
|
@ -141,7 +141,7 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
@utils.hook("received.command.serverunignore")
|
||||
@utils.kwarg("help", "Unignore a command on the current server")
|
||||
@utils.kwarg("permissions", "serverunignore")
|
||||
@utils.kwarg("permission", "serverunignore")
|
||||
@utils.spec("!<command>wordlower")
|
||||
def server_unignore(self, event):
|
||||
command = event["spec"][0]
|
||||
|
@ -154,4 +154,3 @@ class Module(ModuleManager.BaseModule):
|
|||
event["server"].del_setting(setting)
|
||||
event["stdout"].write("No longer ignoring '%s' for %s" %
|
||||
(command, str(event["server"])))
|
||||
|
||||
|
|
|
@ -304,8 +304,8 @@ def request_many(requests: typing.List[Request]) -> typing.Dict[str, Response]:
|
|||
loop = asyncio.new_event_loop()
|
||||
awaits = []
|
||||
for request in requests:
|
||||
awaits.append(_request(request))
|
||||
task = asyncio.wait(awaits, loop=loop, timeout=5)
|
||||
awaits.append(loop.create_task(_request(request)))
|
||||
task = asyncio.wait(awaits, timeout=5)
|
||||
loop.run_until_complete(task)
|
||||
loop.close()
|
||||
|
||||
|
|
Loading…
Reference in a new issue