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
780e3ab3
Commit
780e3ab3
authored
4 years ago
by
dnns01
Browse files
Options
Downloads
Patches
Plain Diff
Fixed minor issues
parent
119583da
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
news_cog.py
+3
-1
3 additions, 1 deletion
news_cog.py
poll_cog.py
+1
-1
1 addition, 1 deletion
poll_cog.py
with
4 additions
and
2 deletions
news_cog.py
+
3
−
1
View file @
780e3ab3
...
@@ -10,6 +10,7 @@ class NewsCog(commands.Cog):
...
@@ -10,6 +10,7 @@ class NewsCog(commands.Cog):
def
__init__
(
self
,
bot
):
def
__init__
(
self
,
bot
):
self
.
bot
=
bot
self
.
bot
=
bot
self
.
channel_id
=
int
(
os
.
getenv
(
"
DISCORD_NEWS_CHANNEL
"
))
self
.
channel_id
=
int
(
os
.
getenv
(
"
DISCORD_NEWS_CHANNEL
"
))
self
.
news_role
=
int
(
os
.
getenv
(
"
DISCORD_NEWS_ROLE
"
))
self
.
url
=
"
https://www.fernuni-hagen.de/mi/studium/aktuelles/index.shtml
"
self
.
url
=
"
https://www.fernuni-hagen.de/mi/studium/aktuelles/index.shtml
"
self
.
news
=
{}
self
.
news
=
{}
self
.
load_news
()
self
.
load_news
()
...
@@ -39,7 +40,8 @@ class NewsCog(commands.Cog):
...
@@ -39,7 +40,8 @@ class NewsCog(commands.Cog):
if
not
self
.
news
.
get
(
link
):
if
not
self
.
news
.
get
(
link
):
self
.
news
[
link
]
=
date
self
.
news
[
link
]
=
date
await
channel
.
send
(
f
"
:loudspeaker: Neues aus der Fakultät vom
{
date
}
:loudspeaker:
\n
{
title
}
\n
{
link
}
"
)
await
channel
.
send
(
f
"
:loudspeaker: <@&
{
self
.
news_role
}
> Neues aus der Fakultät vom
{
date
}
:loudspeaker:
\n
{
title
}
\n
{
link
}
"
)
else
:
else
:
prev_date
=
self
.
news
[
link
]
prev_date
=
self
.
news
[
link
]
if
date
!=
prev_date
:
if
date
!=
prev_date
:
...
...
This diff is collapsed.
Click to expand it.
poll_cog.py
+
1
−
1
View file @
780e3ab3
...
@@ -19,7 +19,7 @@ class PollCog(commands.Cog):
...
@@ -19,7 +19,7 @@ class PollCog(commands.Cog):
msg
=
f
"
<@!
{
ctx
.
author
.
id
}
> hat folgende Umfrage vorgeschlagen:
\n
Frage:
{
question
}
\n\n
Antwortoptionen:
\n
"
msg
=
f
"
<@!
{
ctx
.
author
.
id
}
> hat folgende Umfrage vorgeschlagen:
\n
Frage:
{
question
}
\n\n
Antwortoptionen:
\n
"
for
answer
in
answers
:
for
answer
in
answers
:
msg
+=
f
"
{
answer
}
"
msg
+=
f
"
{
answer
}
\n
"
await
channel
.
send
(
msg
)
await
channel
.
send
(
msg
)
...
...
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