Skip to content

Use JSON - like objects to mentain guild's calls and commands #21

@lukaqueres

Description

@lukaqueres

There is simmilar issue open rn, but I guess this idea is too much complicated to just add a comment.

As it turns out, detailed issues have a higher chance of getting help, so if I'll write a lot about it, maybe some good spirits will help.

What do I mean?

I am thinking about turning, like all data, to JSON like this:

{
instance : {
guilds : {
<guild_id> : {
prefix : <guild_prefix>,
users_count : <guild_users_count>,
members_count : <guild_memebers_count,
purpose_channels : {
updates_channel : <updates_channel_id>,
messages_alert_channel : <messages_alert_channel>,
log_channels : {
messages : <messages_log_channel>,
channels : <channels_log_channel>,
users : <users_log_channel>,
join_leave : <join_leave_log_channel>
},
},
check_messages : {
key_words : [ <key_words> ] ,
limit_in_messages : <max_allowed_keywords_number_per_message>,
links_allowed : {
users : <bollean_if_links_allowed>,
moderators : <bollean_if_links_allowed>,
admins : <bollean_if_links_allowed>
},
check : {
key_words : <boolean_for_if_check_for_keywords>,
links : <boolean_for_if_check_for_links>,
},
penalties : {
key_words : [<penalty_for_keywords>],
links : [<penalty_for_links>],
},
}.
},
<guild_id> :{ ... },
...
commands : { <there_commands_could_be_made_as_modules_w_premissions_etc>}
}

Is it too complex? I guess it is, ask for explanation if needed.

Such schema would be made on every bot instance start, and would update in run.

Whole point of such data-keeping schema is to:

Maybe make commands faster ( there would be less db requests )
Of course if user uses command to edit some values it would edit it in db.

Oh and databases.
Maybe create one table for guilds? And store there single guild object like schown abowe?

But there is problem, that if user edits someting on website, it will take affect on db, but not on object. Such edit could. f.e. affect only one guild child-object, but there must be communication beetwen website and bot.

First and most important question is: will it help, will it work better with such functionality, and most important - will it work well on 1000, 10000 or even 100000 guilds?
Or will it just complicate things more.
What to you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededideaNew idea for veryficationimprovementSomething is working, but it could be done better

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions