Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maubot-ethzlunch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
isgphys
maubot-ethzlunch
Commits
779ec1fd
Commit
779ec1fd
authored
1 year ago
by
MxMarx
Browse files
Options
Downloads
Patches
Plain Diff
If replying to a message, use it for the reminder text
parent
58fb98b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
maubot.yaml
+1
-1
1 addition, 1 deletion
maubot.yaml
reminder/bot.py
+9
-2
9 additions, 2 deletions
reminder/bot.py
with
10 additions
and
3 deletions
maubot.yaml
+
1
−
1
View file @
779ec1fd
maubot
:
0.4.1
id
:
org.bytemarx.reminder
version
:
0.1.
1
version
:
0.1.
2
license
:
AGPL-3.0-or-later
modules
:
-
reminder
...
...
This diff is collapsed.
Click to expand it.
reminder/bot.py
+
9
−
2
View file @
779ec1fd
...
...
@@ -122,13 +122,15 @@ class ReminderBot(Plugin):
room: if true, ping the whole room
cron: crontab syntax
every: is the reminder recurring?
start_time:
message:
start_time:
can be explicitly specified with a semicolon: !remind <start_time>; <message>
message:
contains both the start_time and the message if not using a semicolon to separate them
again:
"""
date_str
=
None
reply_to_id
=
evt
.
content
.
get_reply_to
()
reply_to
=
None
user_info
=
await
self
.
db
.
get_user_info
(
evt
.
sender
)
# Determine is the agenda command was used instead of creating a subcommand so [room] can still be used
agenda
=
evt
.
content
.
body
[
1
:].
startswith
(
self
.
agenda_command
)
if
agenda
:
...
...
@@ -166,6 +168,11 @@ class ReminderBot(Plugin):
else
:
# If no arguments are supplied, return the help message
await
evt
.
reply
(
self
.
_help_message
())
return
# If the reminder was created by replying to a message, use that message's text
if
reply_to_id
and
not
message
:
message
=
reply_to
.
content
[
"
body
"
]
reminder
=
Reminder
(
bot
=
self
,
room_id
=
evt
.
room_id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment