-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data/settings layout reorganization #37
Comments
… exposed via the new ctx.groupinfo.data. Remove the globalrecords module entirely; its functionality is now replicated in multibot._MultiBotLoopDispatcher.__call__ (while setting up ctx.userinfo/ctx.groupinfo).
Tentatively: Leave |
Two thoughts:
|
…ME.issue37.MODNAME (see #37). BACK UP YOUR config/bots.yaml FILE BEFORE INSTALLING.
(See #93.) |
Just to get unblocked, I'm going to propose and begin attempting to implement:
Don't touch Context.user, Context.chat, etc. at all. That can be addressed in a long-off followup.
Add a new Context.userinfo, Context.groupinfo, and Context.botinfo in metabot (probably in
_MultiBotLoopDispatcher.__call__
). This will expose data from BotConf in something like:ctx.userinfo.data.language_code
=users.USERID.language_code
ctx.userinfo.settings.timezone
=bots.BOTNAME.users.USERID.timezone
ctx.groupinfo.data.title
=groups.GROUPID.title
ctx.groupinfo.settings.timezone
=bots.BOTNAME.groups.GROUPID.timezone
ctx.botinfo.data.xxx
=bots.BOTNAME.data.xxx
ctx.botinfo.settings.telegram_token
=bots.BOTNAME.settings.telegram_token
In pieces, move data/settings out of
bots.BOTNAME.MODNAME
intobots.BOTNAME.users/groups/data/settings
. This means using themodconf
parameter will be deprecated (and eventually removed), as will navigating through Context to find other data (likegroupconf = ctx.bot.multibot.conf['bots'][ctx.bot.username]['moderator'][ctx.chat['id']]
).bots.BOTNAME.moderator.-100100100.dailytext
->bots.BOTNAME.groups.-100100100.daily_multiline
,bots.BOTNAME.moderator.-100100100.daily
->bots.BOTNAME.groups.-100100100.daily_timeofday
, etc.For now, leave
/admin
alone. The long-term plan is still to change it to something like:This probably means I should start with
ctx.botinfo
actually, then move toctx.userinfo
(which is only currently used via/events
), then rebuild/admin
coincident with beginning onctx.groupinfo
. However, it might also make sense to rename/admin
to/legacy_admin
and have a new placeholder/admin
just provide an explanation of the work in progress (with a link to/legacy_admin
).The text was updated successfully, but these errors were encountered: