Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
strolchibot
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
strolchibot
Commits
ca49a9b2
You need to sign in or sign up before continuing.
Commit
ca49a9b2
authored
3 years ago
by
dnns01
Browse files
Options
Downloads
Patches
Plain Diff
Add countdown timer
parent
9e6fe999
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.idea/misc.xml
+1
-1
1 addition, 1 deletion
.idea/misc.xml
.idea/strolchibot.iml
+1
-1
1 addition, 1 deletion
.idea/strolchibot.iml
twitchbot/countdown.py
+23
-0
23 additions, 0 deletions
twitchbot/countdown.py
twitchbot/strolchibot.py
+2
-1
2 additions, 1 deletion
twitchbot/strolchibot.py
with
27 additions
and
3 deletions
.idea/misc.xml
+
1
−
1
View file @
ca49a9b2
...
...
@@ -3,5 +3,5 @@
<component
name=
"JavaScriptSettings"
>
<option
name=
"languageLevel"
value=
"ES6"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
9
(strolchibot)"
project-jdk-type=
"Python SDK"
/>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.
10
(strolchibot)"
project-jdk-type=
"Python SDK"
/>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.idea/strolchibot.iml
+
1
−
1
View file @
ca49a9b2
...
...
@@ -18,7 +18,7 @@
<sourceFolder
url=
"file://$MODULE_DIR$/strolchguru"
isTestSource=
"false"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/venv"
/>
</content>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
9
(strolchibot)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"jdk"
jdkName=
"Python 3.
10
(strolchibot)"
jdkType=
"Python SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
<component
name=
"TemplatesService"
>
...
...
This diff is collapsed.
Click to expand it.
twitchbot/countdown.py
0 → 100644
+
23
−
0
View file @
ca49a9b2
from
asyncio
import
sleep
from
datetime
import
datetime
from
twitchio.ext
import
commands
,
routines
class
Countdown
(
commands
.
Cog
):
def
__init__
(
self
,
bot
):
self
.
bot
=
bot
self
.
timer
.
start
()
self
.
until
=
datetime
(
year
=
2022
,
month
=
4
,
day
=
5
,
hour
=
20
)
@routines.routine
(
minutes
=
1
)
async
def
timer
(
self
):
now
=
datetime
.
now
()
diff
=
(
self
.
until
-
now
).
seconds
//
60
+
1
if
diff
>
0
:
await
self
.
bot
.
channel
().
send
(
str
(
diff
))
@timer.before_routine
async
def
timer_before
(
self
):
await
sleep
(
60
-
datetime
.
now
().
second
)
This diff is collapsed.
Click to expand it.
twitchbot/strolchibot.py
+
2
−
1
View file @
ca49a9b2
...
...
@@ -9,7 +9,7 @@ from twitchio import Channel, Message
from
twitchio.ext
import
commands
from
twitchio.ext.commands
import
Context
import
chat_commands
,
giveaway
,
klassenbuch
,
link_protection
,
spotify_cog
,
vote_cog
import
chat_commands
,
giveaway
,
klassenbuch
,
link_protection
,
spotify_cog
,
vote_cog
,
countdown
load_dotenv
()
...
...
@@ -34,6 +34,7 @@ class StrolchiBot(commands.Bot, ABC):
self
.
add_cog
(
link_protection
.
LinkProtection
(
self
))
self
.
add_cog
(
giveaway
.
Giveaway
(
self
))
self
.
add_cog
(
chat_commands
.
Commands
(
self
))
self
.
add_cog
(
countdown
.
Countdown
(
self
))
@staticmethod
async
def
send_me
(
ctx
,
content
):
...
...
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