Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
strolly
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dnns01
strolly
Commits
7447c716
Commit
7447c716
authored
4 years ago
by
dnns01
Browse files
Options
Downloads
Patches
Plain Diff
Added Chat message that gets sent whenever a message is pinned or unpinned.
parent
4fef243e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fernuni-bot.py
+13
-2
13 additions, 2 deletions
fernuni-bot.py
with
13 additions
and
2 deletions
fernuni-bot.py
+
13
−
2
View file @
7447c716
...
...
@@ -164,8 +164,8 @@ async def fu_modify_roles(message, add):
# Sends link to invite others to Discord server in Chat.
async
def
fu_link
(
message
):
await
message
.
channel
.
send
(
"
Benutze bitte folgenden Link, um andere Studierende auf unseren Discord einzuladen:
"
\
"
http://fernuni-discord.dnns01.de
"
)
await
message
.
channel
.
send
(
'
Benutze bitte folgenden Link, um andere Studierende auf unseren Discord einzuladen:
'
'
http://fernuni-discord.dnns01.de
'
)
# Sends stats in Chat.
...
...
@@ -181,6 +181,15 @@ async def fu_stats(message):
if
len
(
role_members
)
>
0
and
not
role
.
name
.
startswith
(
"
Farbe
"
):
answer
+=
f
'
\n
{
role
.
name
}
:
{
len
(
role_members
)
}
Mitglieder
'
no_role
=
0
for
member
in
members
:
if
len
(
member
.
roles
)
==
1
:
no_role
+=
1
else
:
print
(
member
.
roles
)
answer
+=
f
'
\n\n
{
no_role
}
Mitglieder ohne Rolle
'
await
message
.
channel
.
send
(
answer
)
...
...
@@ -188,6 +197,7 @@ async def fu_stats(message):
async
def
pin_message
(
message
):
if
not
message
.
pinned
:
await
message
.
pin
()
await
message
.
channel
.
send
(
f
'
Folgende Nachricht wurde gerade angepinnt:
{
message
.
jump_url
}
'
)
# Unpin the given message, if it is pinned, and it has no pin reaction remaining.
...
...
@@ -196,6 +206,7 @@ async def unpin_message(message):
reaction
=
get_reaction
(
message
.
reactions
)
if
reaction
is
None
:
await
message
.
unpin
()
await
message
.
channel
.
send
(
f
'
Folgende Nachricht wurde gerade losgelöst:
{
message
.
jump_url
}
'
)
@client.event
...
...
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