Registrations currently disabled due to spam. Contact me externally if you need an account
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Phen Cogs Fork
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
natalie
Phen Cogs Fork
Commits
fc1b08c5
Unverified
Commit
fc1b08c5
authored
3 years ago
by
PhenoM4n4n
Browse files
Options
Downloads
Patches
Plain Diff
[slashtags] add restore from db command
parent
ff77ed07
No related branches found
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
slashtags/core.py
+1
-1
1 addition, 1 deletion
slashtags/core.py
slashtags/mixins/commands.py
+24
-0
24 additions, 0 deletions
slashtags/mixins/commands.py
with
25 additions
and
1 deletion
slashtags/core.py
+
1
−
1
View file @
fc1b08c5
...
...
@@ -61,7 +61,7 @@ class SlashTags(Commands, Processor, commands.Cog, metaclass=CompositeMetaClass)
The TagScript documentation can be found [here](https://phen-cogs.readthedocs.io/en/latest/index.html).
"""
__version__
=
"
0.5.
2
"
__version__
=
"
0.5.
3
"
__author__
=
(
"
PhenoM4n4n
"
,)
def
format_help_for_context
(
self
,
ctx
:
commands
.
Context
):
...
...
This diff is collapsed.
Click to expand it.
slashtags/mixins/commands.py
+
24
−
0
View file @
fc1b08c5
...
...
@@ -488,6 +488,30 @@ class Commands(MixinMeta):
"""
await
self
.
show_slash_tag_usage
(
ctx
,
ctx
.
guild
)
@commands.is_owner
()
@slashtag.command
(
"
restore
"
,
hidden
=
True
)
async
def
slashtag_restore
(
self
,
ctx
:
commands
.
Context
):
"""
Restore all slash tags for this server from the database.
"""
pred
=
MessagePredicate
.
yes_or_no
(
ctx
)
try
:
await
self
.
send_and_query_response
(
ctx
,
"
Are you sure you want to restore all slash tags on this server from the database? (Y/n)
"
,
pred
,
)
except
asyncio
.
TimeoutError
:
return
await
ctx
.
send
(
"
Timed out, not restoring slash tags.
"
)
if
not
pred
.
result
:
return
await
ctx
.
send
(
"
Ok, not restoring slash tags.
"
)
slashtags
=
self
.
guild_tag_cache
[
ctx
.
guild
.
id
]
if
not
slashtags
:
return
await
ctx
.
send
(
"
No slash tags have been created for this server.
"
)
await
ctx
.
send
(
f
"
Restoring
{
len
(
slashtags
)
}
slash tags...
"
)
async
with
ctx
.
typing
():
for
tag
in
slashtags
.
values
():
await
tag
.
register
()
await
ctx
.
send
(
f
"
Restored
{
len
(
slashtags
)
}
slash tags.
"
)
@commands.is_owner
()
@slashtag.command
(
"
clear
"
,
hidden
=
True
)
async
def
slashtag_clear
(
self
,
ctx
:
commands
.
Context
):
...
...
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