Compare commits
No commits in common. "3bf47d9ded8daffc4e710a17a3289744c0bff67a" and "c59fa577bba49a267bbb5078c802c6dc0babb099" have entirely different histories.
3bf47d9ded
...
c59fa577bb
7 changed files with 14 additions and 19 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!
|
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
|
## Contact/Support
|
||||||
Come say hi at `#bitbot` on irc.libera.chat
|
Come say hi at [#bitbot on freenode](https://webchat.freenode.net/?channels=#bitbot)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
This project is licensed under GNU General Public License v2.0 - see [LICENSE](LICENSE) for details.
|
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()
|
today = datetime.datetime.utcnow().date()
|
||||||
week = datetime.timedelta(days=7)
|
week = datetime.timedelta(days=7)
|
||||||
|
|
||||||
not_valid_until = (today-certificate.not_valid_before_utc.date()).days
|
not_valid_until = (today-certificate.not_valid_before.date()).days
|
||||||
not_valid_after = (certificate.not_valid_after_utc.date()-today).days
|
not_valid_after = (certificate.not_valid_after.date()-today).days
|
||||||
|
|
||||||
if not_valid_until < 0:
|
if not_valid_until < 0:
|
||||||
self.log.warn(
|
self.log.warn(
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
from src import ModuleManager, utils
|
from src import ModuleManager, utils
|
||||||
|
|
||||||
CAP = utils.irc.Capability("message-tags", "draft/message-tags-0.2")
|
|
||||||
|
|
||||||
@utils.export("channelset", utils.Setting("greeting",
|
@utils.export("channelset", utils.Setting("greeting",
|
||||||
"Set a greeting to send to users when they join",
|
"Set a greeting to send to users when they join",
|
||||||
example="welcome to the channel!"))
|
example="welcome to the channel!"))
|
||||||
|
@ -12,9 +10,5 @@ class Module(ModuleManager.BaseModule):
|
||||||
def join(self, event):
|
def join(self, event):
|
||||||
greeting = event["channel"].get_setting("greeting", None)
|
greeting = event["channel"].get_setting("greeting", None)
|
||||||
if greeting:
|
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,
|
event["user"].send_notice("[%s] %s" % (event["channel"].name,
|
||||||
greeting), tags)
|
greeting))
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
beautifulsoup4 ==4.8.0
|
beautifulsoup4 ==4.8.0
|
||||||
cryptography >=3.3.2
|
cryptography >=3.3.2
|
||||||
dataclasses ==0.6;python_version<'3.7'
|
dataclasses ==0.6;python_version<'3.7'
|
||||||
dnspython ==2.0.0
|
dnspython ==1.16.0
|
||||||
feedparser ==6.0.2
|
feedparser ==5.2.1
|
||||||
html5lib ==1.0.1
|
html5lib ==1.0.1
|
||||||
isodate ==0.6.0
|
isodate ==0.6.0
|
||||||
lxml ==4.9.1
|
lxml ==4.6.2
|
||||||
netifaces ==0.10.9
|
netifaces ==0.10.9
|
||||||
PySocks ==1.7.1
|
PySocks ==1.7.1
|
||||||
python-dateutil ==2.8.1
|
python-dateutil ==2.8.1
|
||||||
pytz ==2019.2
|
pytz ==2019.2
|
||||||
requests ==2.31.0
|
requests ==2.22.0
|
||||||
scrypt ==0.8.13
|
scrypt ==0.8.13
|
||||||
suds-jurko ==0.6
|
suds-jurko ==0.6
|
||||||
tornado ==6.0.3
|
tornado ==6.0.3
|
||||||
|
|
|
@ -235,7 +235,7 @@ class ModuleManager(object):
|
||||||
definition.filename)
|
definition.filename)
|
||||||
module = importlib.util.module_from_spec(import_spec)
|
module = importlib.util.module_from_spec(import_spec)
|
||||||
sys.modules[import_name] = module
|
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)
|
loader.exec_module(module)
|
||||||
|
|
||||||
module_object_pointer = getattr(module, "Module", None)
|
module_object_pointer = getattr(module, "Module", None)
|
||||||
|
|
|
@ -125,7 +125,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
@utils.hook("received.command.serverignore")
|
@utils.hook("received.command.serverignore")
|
||||||
@utils.kwarg("help", "Ignore a command on the current server")
|
@utils.kwarg("help", "Ignore a command on the current server")
|
||||||
@utils.kwarg("permission", "serverignore")
|
@utils.kwarg("permissions", "serverignore")
|
||||||
@utils.spec("!<command>wordlower")
|
@utils.spec("!<command>wordlower")
|
||||||
def server_ignore(self, event):
|
def server_ignore(self, event):
|
||||||
command = event["spec"][0]
|
command = event["spec"][0]
|
||||||
|
@ -141,7 +141,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
@utils.hook("received.command.serverunignore")
|
@utils.hook("received.command.serverunignore")
|
||||||
@utils.kwarg("help", "Unignore a command on the current server")
|
@utils.kwarg("help", "Unignore a command on the current server")
|
||||||
@utils.kwarg("permission", "serverunignore")
|
@utils.kwarg("permissions", "serverunignore")
|
||||||
@utils.spec("!<command>wordlower")
|
@utils.spec("!<command>wordlower")
|
||||||
def server_unignore(self, event):
|
def server_unignore(self, event):
|
||||||
command = event["spec"][0]
|
command = event["spec"][0]
|
||||||
|
@ -154,3 +154,4 @@ class Module(ModuleManager.BaseModule):
|
||||||
event["server"].del_setting(setting)
|
event["server"].del_setting(setting)
|
||||||
event["stdout"].write("No longer ignoring '%s' for %s" %
|
event["stdout"].write("No longer ignoring '%s' for %s" %
|
||||||
(command, str(event["server"])))
|
(command, str(event["server"])))
|
||||||
|
|
||||||
|
|
|
@ -304,8 +304,8 @@ def request_many(requests: typing.List[Request]) -> typing.Dict[str, Response]:
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
awaits = []
|
awaits = []
|
||||||
for request in requests:
|
for request in requests:
|
||||||
awaits.append(loop.create_task(_request(request)))
|
awaits.append(_request(request))
|
||||||
task = asyncio.wait(awaits, timeout=5)
|
task = asyncio.wait(awaits, loop=loop, timeout=5)
|
||||||
loop.run_until_complete(task)
|
loop.run_until_complete(task)
|
||||||
loop.close()
|
loop.close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue