Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Signalbot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frederic Aust
Signalbot
Commits
e8c23ccb
Commit
e8c23ccb
authored
Dec 8, 2021
by
Frederic Aust
Browse files
Options
Downloads
Patches
Plain Diff
New Feature: Kings Cup Rules
parent
fc0803d8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
betterhelp.json
+9
-0
9 additions, 0 deletions
betterhelp.json
signalbot.py
+5
-0
5 additions, 0 deletions
signalbot.py
with
14 additions
and
0 deletions
betterhelp.json
+
9
−
0
View file @
e8c23ccb
...
@@ -50,7 +50,16 @@
...
@@ -50,7 +50,16 @@
],
],
"Description"
:
"True American Rules: How to play the game from New Girl"
,
"Description"
:
"True American Rules: How to play the game from New Girl"
,
"_Func"
:
"echo"
"_Func"
:
"echo"
},
{
"Names"
:
[
".kingscup"
],
"Description"
:
"Kings Cup Rules"
,
"_Func"
:
"echo"
}
}
],
],
"APIs"
:
[
"APIs"
:
[
{
{
...
...
This diff is collapsed.
Click to expand it.
signalbot.py
+
5
−
0
View file @
e8c23ccb
...
@@ -195,6 +195,8 @@ def handle_action(timestamp, source, groupID, message, attachments):
...
@@ -195,6 +195,8 @@ def handle_action(timestamp, source, groupID, message, attachments):
get_tex_formula
(
receiver
,
"
"
.
join
(
str
(
x
)
for
x
in
msg_splitted
[
1
:]))
get_tex_formula
(
receiver
,
"
"
.
join
(
str
(
x
)
for
x
in
msg_splitted
[
1
:]))
elif
action
==
"
deepl
"
and
(
groupInfo
is
None
or
action
in
groupInfo
[
"
COMMANDS
"
]):
elif
action
==
"
deepl
"
and
(
groupInfo
is
None
or
action
in
groupInfo
[
"
COMMANDS
"
]):
get_deepl_translation
(
receiver
,
"
"
.
join
(
str
(
x
)
for
x
in
msg_splitted
[
1
:]))
get_deepl_translation
(
receiver
,
"
"
.
join
(
str
(
x
)
for
x
in
msg_splitted
[
1
:]))
elif
action
==
"
kingscup
"
and
(
groupInfo
is
None
or
action
in
groupInfo
[
"
COMMANDS
"
]):
get_kings_cup
(
receiver
)
else
:
else
:
unknown_command
(
receiver
,
message
)
# wenn nicht berechtigt, dann "ich seh nix, ich weiss nix, ich hör nix" => unbekannter befehl
unknown_command
(
receiver
,
message
)
# wenn nicht berechtigt, dann "ich seh nix, ich weiss nix, ich hör nix" => unbekannter befehl
except
Exception
as
ex
:
except
Exception
as
ex
:
...
@@ -459,6 +461,9 @@ def get_deepl_translation(receiver, message):
...
@@ -459,6 +461,9 @@ def get_deepl_translation(receiver, message):
send
(
answer
,
receiver
)
send
(
answer
,
receiver
)
def
get_kings_cup
(
receiver
):
send_a
(
"
Don
'
t drink and derive!
"
,
receiver
,
"
/home/pi/signalbot/kings_cup_regeln.png
"
)
def
on_mqtt_message
(
client
,
userdata
,
msg
):
def
on_mqtt_message
(
client
,
userdata
,
msg
):
print
(
msg
.
topic
+
"
"
+
str
(
msg
.
payload
))
print
(
msg
.
topic
+
"
"
+
str
(
msg
.
payload
))
send
(
msg
.
topic
+
"
"
+
str
(
msg
.
payload
),
CONFIG
[
'
Admins
'
][
'
Fred
'
])
send
(
msg
.
topic
+
"
"
+
str
(
msg
.
payload
),
CONFIG
[
'
Admins
'
][
'
Fred
'
])
...
...
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