Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker_test
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BX-Telegram
docker_test
Commits
4eec8ed2
Commit
4eec8ed2
authored
1 year ago
by
Gianluca OBERREIT
Browse files
Options
Downloads
Patches
Plain Diff
Make Gemhandler static
parent
763230c1
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
src/user_bot/Lore/gems.py
+13
-12
13 additions, 12 deletions
src/user_bot/Lore/gems.py
src/utils/__init__.py
+1
-2
1 addition, 2 deletions
src/utils/__init__.py
with
14 additions
and
14 deletions
src/user_bot/Lore/gems.py
+
13
−
12
View file @
4eec8ed2
...
...
@@ -36,21 +36,22 @@ logger = logging.getLogger(__name__)
class
GemHandler
:
def
__init__
(
self
):
self
.
EXIT
=
0
self
.
handler
=
ConversationHandler
(
entry_points
=
[
MessageHandler
(
filters
.
Regex
(
re
.
compile
(
r
'
gems
'
,
re
.
IGNORECASE
)),
self
.
gems
)],
states
=
{},
fallbacks
=
[],
map_to_parent
=
{
self
.
EXIT
:
self
.
EXIT
}
)
EXIT
=
0
async
def
gems
(
self
,
update
:
Update
,
context
:
ContextTypes
.
DEFAULT_TYPE
):
@staticmethod
async
def
gems
(
update
:
Update
,
context
:
ContextTypes
.
DEFAULT_TYPE
):
"""
Tell them a little bit about gems, in the future it will give more options but for that I
'
ll have to ask Gaia and Adrien about IW
"""
for
message
in
texts
[
"
gems
"
]:
await
context
.
bot
.
send_chat_action
(
chat_id
=
update
.
effective_chat
.
id
,
action
=
'
typing
'
)
time
.
sleep
(
len
(
message
)
/
140
)
await
context
.
bot
.
send_message
(
chat_id
=
update
.
effective_chat
.
id
,
text
=
message
)
return
self
.
EXIT
return
GemHandler
.
EXIT
handler
=
ConversationHandler
(
entry_points
=
[
MessageHandler
(
filters
.
Regex
(
re
.
compile
(
r
'
gems
'
,
re
.
IGNORECASE
)),
gems
)],
states
=
{},
fallbacks
=
[],
map_to_parent
=
{
EXIT
:
EXIT
}
)
This diff is collapsed.
Click to expand it.
src/utils/__init__.py
+
1
−
2
View file @
4eec8ed2
from
.
import
config
from
.
import
db
from
.
import
gc
from
version_check
import
Vcheck
from
load_env_vars
import
VARS
from
.version_check
import
Vcheck
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