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
617f8682
Commit
617f8682
authored
3 years ago
by
dnns01
Browse files
Options
Downloads
Patches
Plain Diff
Fix link protection when nick contains capital letters
parent
0b8bb17d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
strolchibot/models.py
+9
-0
9 additions, 0 deletions
strolchibot/models.py
twitchbot/link_protection.py
+4
-1
4 additions, 1 deletion
twitchbot/link_protection.py
with
13 additions
and
1 deletion
strolchibot/models.py
+
9
−
0
View file @
617f8682
...
...
@@ -9,6 +9,11 @@ class TextCommand(models.Model):
text
=
models
.
TextField
(
max_length
=
500
)
active
=
models
.
BooleanField
(
default
=
True
)
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
if
self
.
command
[
0
]
==
"
!
"
:
self
.
command
=
self
.
command
[
1
:]
super
().
save
(
force_insert
,
force_update
,
using
,
update_fields
)
class
Klassenbuch
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
50
)
...
...
@@ -23,6 +28,10 @@ class Timer(models.Model):
class
LinkPermit
(
models
.
Model
):
nick
=
models
.
CharField
(
max_length
=
25
)
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
update_fields
=
None
):
self
.
nick
=
self
.
nick
.
lower
()
super
().
save
(
force_insert
,
force_update
,
using
,
update_fields
)
class
LinkWhitelist
(
models
.
Model
):
url
=
models
.
URLField
()
...
...
This diff is collapsed.
Click to expand it.
twitchbot/link_protection.py
+
4
−
1
View file @
617f8682
...
...
@@ -2,9 +2,10 @@ import re
import
sqlite3
from
datetime
import
datetime
,
timedelta
import
config
from
twitchio.ext
import
commands
import
config
@commands.core.cog
(
name
=
"
LinkProtection
"
)
class
LinkProtection
:
...
...
@@ -104,6 +105,8 @@ class LinkProtection:
if
user
[
0
]
==
"
@
"
:
user
=
user
[
1
:]
user
=
user
.
lower
()
if
ctx
.
author
.
is_mod
:
if
permanent
:
self
.
give_user_permanent_permit
(
user
)
...
...
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