Skip to content

Added slowmode statistic for python-general#1374

Merged
ks129 merged 5 commits into
masterfrom
mbaruh/sm-stats
Jan 21, 2021
Merged

Added slowmode statistic for python-general#1374
ks129 merged 5 commits into
masterfrom
mbaruh/sm-stats

Conversation

@mbaruh
Copy link
Copy Markdown
Member

@mbaruh mbaruh commented Jan 21, 2021

Added a statistic for advanced monitoring of the cooldown in python-general. Also made the slowmode reset command use the slowmode setting command under the hood to avoid repetition.

@mbaruh mbaruh requested a review from jb3 January 21, 2021 00:55
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 21, 2021

Coverage Status

Coverage decreased (-0.02%) to 56.718% when pulling 5c45e7f on mbaruh/sm-stats into 04c3a18 on master.

Comment thread bot/exts/moderation/slowmode.py Outdated
log.info(f'{ctx.author} set the slowmode delay for #{channel} to {humanized_delay}.')

await channel.edit(slowmode_delay=slowmode_delay)
if channel.id == Channels.python_general:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we tracking only one channel? I think having multiple samples would be worth it, like we often have #ot0 in slowmode.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should track all channels?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the plan, but channels can change names (especially ot), while having it by id would be pretty annoying, and we don't really need other channels for what this is intended for, so I agreed with @jb3 to limit it to just pygen.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how it looks on the moderation front for slowmode, but maybe discordpy would also be nice here. Dynamic tracking doesn't sound too good for channels that get a sm set rarely

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a mapping of usually slowmode-ed channel IDs to human readable name, and use that before submitting the stats.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could add dpy and ot0 in case it's needed in the future. It's not super important to me though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

Copy link
Copy Markdown
Contributor

@Akarys42 Akarys42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread bot/exts/moderation/slowmode.py Outdated
log.info(f'{ctx.author} set the slowmode delay for #{channel} to {humanized_delay}.')

await channel.edit(slowmode_delay=slowmode_delay)
if channel.id == Channels.python_general:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of restricting it to just python general and manually adding it in future for other channels, why not create a list like !otn, and the moderators can add channels to the list and remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make this unnecessary complex. But I still think discord.py channel should be added at least.

@ks129 ks129 merged commit a280df5 into master Jan 21, 2021
@ks129 ks129 deleted the mbaruh/sm-stats branch January 21, 2021 12:42
@MarkKoz MarkKoz added a: moderation Related to community moderation functionality: (moderation, defcon, verification) a: stats Related to the collection of statistics t: feature New feature or request labels Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: moderation Related to community moderation functionality: (moderation, defcon, verification) a: stats Related to the collection of statistics t: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants