From 36dc74cfb1132873ceedf343eda517b11b1006e0 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 6 Aug 2020 11:34:05 -0400 Subject: [PATCH 1/5] Add `red_delete_data_for_user` --- announcedaily/announcedaily.py | 4 ++++ ccrole/ccrole.py | 4 ++++ chatter/chat.py | 14 +++++++++++--- coglint/coglint.py | 4 ++++ dad/dad.py | 4 ++++ exclusiverole/exclusiverole.py | 4 ++++ flag/flag.py | 17 +++++++++++++++++ forcemention/forcemention.py | 4 ++++ hangman/hangman.py | 5 +++++ infochannel/infochannel.py | 4 ++++ leaver/leaver.py | 5 +++++ lovecalculator/lovecalculator.py | 5 +++++ lseen/lseen.py | 15 +++++++++++++++ planttycoon/planttycoon.py | 15 +++++++++++++-- qrinvite/qrinvite.py | 4 ++++ reactrestrict/reactrestrict.py | 4 ++++ recyclingplant/recyclingplant.py | 4 ++++ rpsls/rpsls.py | 4 ++++ sayurl/sayurl.py | 4 ++++ scp/scp.py | 4 ++++ stealemoji/stealemoji.py | 4 ++++ timerole/timerole.py | 4 ++++ tts/tts.py | 4 ++++ unicode/unicode.py | 4 ++++ werewolf/werewolf.py | 5 +++++ 25 files changed, 144 insertions(+), 5 deletions(-) diff --git a/announcedaily/announcedaily.py b/announcedaily/announcedaily.py index fb02756..aa50e6c 100644 --- a/announcedaily/announcedaily.py +++ b/announcedaily/announcedaily.py @@ -38,6 +38,10 @@ class AnnounceDaily(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + async def _get_msgs(self): return DEFAULT_MESSAGES + await self.config.messages() diff --git a/ccrole/ccrole.py b/ccrole/ccrole.py index 9be63f2..bea979f 100644 --- a/ccrole/ccrole.py +++ b/ccrole/ccrole.py @@ -22,6 +22,10 @@ class CCRole(commands.Cog): self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.guild_only() @commands.group() async def ccrole(self, ctx: commands.Context): diff --git a/chatter/chat.py b/chatter/chat.py index f7e8944..9aed9b4 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -2,6 +2,7 @@ import asyncio import os import pathlib from datetime import datetime, timedelta +from typing import Literal import discord from chatterbot import ChatBot @@ -11,6 +12,7 @@ from chatterbot.trainers import ChatterBotCorpusTrainer, ListTrainer from redbot.core import Config, commands from redbot.core.commands import Cog from redbot.core.data_manager import cog_data_path +from redbot.core.utils import AsyncIter class ENG_LG: # TODO: Add option to use this large model @@ -49,8 +51,12 @@ class Chatter(Cog): self.loop = asyncio.get_event_loop() + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + def _create_chatbot( - self, data_path, similarity_algorithm, similarity_threshold, tagger_language + self, data_path, similarity_algorithm, similarity_threshold, tagger_language ): return ChatBot( "ChatterBot", @@ -99,7 +105,7 @@ class Chatter(Cog): try: async for message in channel.history( - limit=None, after=after, oldest_first=True + limit=None, after=after, oldest_first=True ).filter( predicate=predicate ): # type: discord.Message @@ -182,7 +188,9 @@ class Chatter(Cog): try: os.remove(self.data_path) except PermissionError: - await ctx.maybe_send_embed("Failed to clear training database. Please wait a bit and try again") + await ctx.maybe_send_embed( + "Failed to clear training database. Please wait a bit and try again" + ) self._create_chatbot(self.data_path, SpacySimilarity, 0.45, ENG_MD) diff --git a/coglint/coglint.py b/coglint/coglint.py index b867ef8..ac67615 100644 --- a/coglint/coglint.py +++ b/coglint/coglint.py @@ -28,6 +28,10 @@ class CogLint(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def autolint(self, ctx: commands.Context): """Toggles automatically linting code""" diff --git a/dad/dad.py b/dad/dad.py index 9907f4f..4da2ece 100644 --- a/dad/dad.py +++ b/dad/dad.py @@ -32,6 +32,10 @@ class Dad(Cog): self.cooldown = defaultdict(datetime.now) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def dadjoke(self, ctx: commands.Context): headers = { diff --git a/exclusiverole/exclusiverole.py b/exclusiverole/exclusiverole.py index ded1677..6dc4b84 100644 --- a/exclusiverole/exclusiverole.py +++ b/exclusiverole/exclusiverole.py @@ -18,6 +18,10 @@ class ExclusiveRole(Cog): self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.guild_only() @commands.group(aliases=["exclusiverole"]) async def exclusive(self, ctx): diff --git a/flag/flag.py b/flag/flag.py index b6d2673..d1e34fb 100644 --- a/flag/flag.py +++ b/flag/flag.py @@ -1,9 +1,11 @@ from datetime import date, timedelta +from typing import Literal import discord from redbot.core import Config, checks, commands from redbot.core.bot import Red from redbot.core.commands import Cog +from redbot.core.utils import AsyncIter from redbot.core.utils.chat_formatting import pagify @@ -22,6 +24,21 @@ class Flag(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user( + self, + *, + requester: Literal["discord_deleted_user", "owner", "user", "user_strict"], + user_id: int, + ): + if requester not in ["discord_deleted_user", "owner"]: + return + + all_members = await self.config.all_members() + + async for guild_id, guild_data in AsyncIter(all_members.items(), steps=100): + if user_id in guild_data: + await self.config.member_from_ids(guild_id, user_id).clear() + @checks.is_owner() @commands.guild_only() @commands.command() diff --git a/forcemention/forcemention.py b/forcemention/forcemention.py index 8fb1380..2aeaac5 100644 --- a/forcemention/forcemention.py +++ b/forcemention/forcemention.py @@ -21,6 +21,10 @@ class ForceMention(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @checks.admin_or_permissions(manage_roles=True) @commands.command() async def forcemention(self, ctx: commands.Context, role: str, *, message=""): diff --git a/hangman/hangman.py b/hangman/hangman.py index 4e44ce6..ee9b549 100644 --- a/hangman/hangman.py +++ b/hangman/hangman.py @@ -14,6 +14,7 @@ class Hangman(Cog): letters = "🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿" def __init__(self, bot): + super().__init__() self.bot = bot self.config = Config.get_conf(self, identifier=1049711010310997110) default_guild = {"theface": ":thinking:", "emojis": True} @@ -39,6 +40,10 @@ class Hangman(Cog): self.hanglist = {} + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + async def _update_hanglist(self): for guild in self.bot.guilds: theface = await self.config.guild(guild).theface() diff --git a/infochannel/infochannel.py b/infochannel/infochannel.py index b612830..eb393d0 100644 --- a/infochannel/infochannel.py +++ b/infochannel/infochannel.py @@ -41,6 +41,10 @@ class InfoChannel(Cog): self._critical_section_wooah_ = 0 + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() @checks.admin() async def infochannel(self, ctx: commands.Context): diff --git a/leaver/leaver.py b/leaver/leaver.py index f6e7fd7..766fabf 100644 --- a/leaver/leaver.py +++ b/leaver/leaver.py @@ -10,12 +10,17 @@ class Leaver(Cog): """ def __init__(self, bot: Red): + super().__init__() self.bot = bot self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) default_guild = {"channel": ""} self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.group(aliases=["setleaver"]) @checks.mod_or_permissions(administrator=True) async def leaverset(self, ctx): diff --git a/lovecalculator/lovecalculator.py b/lovecalculator/lovecalculator.py index 0bf85f3..ad57c5d 100644 --- a/lovecalculator/lovecalculator.py +++ b/lovecalculator/lovecalculator.py @@ -9,8 +9,13 @@ class LoveCalculator(Cog): """Calculate the love percentage for two users!""" def __init__(self, bot): + super().__init__() self.bot = bot + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command(aliases=["lovecalc"]) async def lovecalculator( self, ctx: commands.Context, lover: discord.Member, loved: discord.Member diff --git a/lseen/lseen.py b/lseen/lseen.py index fe07c71..6204675 100644 --- a/lseen/lseen.py +++ b/lseen/lseen.py @@ -1,10 +1,12 @@ from datetime import datetime +from typing import Literal import dateutil.parser import discord from redbot.core import Config, commands from redbot.core.bot import Red from redbot.core.commands import Cog +from redbot.core.utils import AsyncIter class LastSeen(Cog): @@ -28,6 +30,19 @@ class LastSeen(Cog): self.config.register_guild(**default_guild) self.config.register_member(**default_member) + async def red_delete_data_for_user( + self, + *, + requester: Literal["discord_deleted_user", "owner", "user", "user_strict"], + user_id: int, + ): + + all_members = await self.config.all_members() + + async for guild_id, guild_data in AsyncIter(all_members.items(), steps=100): + if user_id in guild_data: + await self.config.member_from_ids(guild_id, user_id).clear() + @staticmethod def get_date_time(s): d = dateutil.parser.parse(s) diff --git a/planttycoon/planttycoon.py b/planttycoon/planttycoon.py index a37a42f..61e5e06 100644 --- a/planttycoon/planttycoon.py +++ b/planttycoon/planttycoon.py @@ -5,18 +5,19 @@ import datetime import json import time from random import choice +from typing import Literal import discord from redbot.core import Config, bank, commands from redbot.core.bot import Red from redbot.core.data_manager import bundled_data_path +from redbot.core.utils import AsyncIter -class Gardener(commands.Cog): +class Gardener: """Gardener class""" def __init__(self, user: discord.User, config: Config): - super().__init__() self.user = user self.config = config self.badges = [] @@ -180,7 +181,17 @@ class PlantTycoon(commands.Cog): # self.bank = bot.get_cog('Economy').bank + async def red_delete_data_for_user( + self, + *, + requester: Literal["discord_deleted_user", "owner", "user", "user_strict"], + user_id: int, + ): + + await self.config.user_from_id(user_id).clear() + async def _load_plants_products(self): + """Runs in __init__.py before cog is added to the bot""" plant_path = bundled_data_path(self) / "plants.json" product_path = bundled_data_path(self) / "products.json" with plant_path.open() as json_data: diff --git a/qrinvite/qrinvite.py b/qrinvite/qrinvite.py index 99563e8..584e346 100644 --- a/qrinvite/qrinvite.py +++ b/qrinvite/qrinvite.py @@ -25,6 +25,10 @@ class QRInvite(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def qrinvite( self, diff --git a/reactrestrict/reactrestrict.py b/reactrestrict/reactrestrict.py index d28be9e..a3d26a8 100644 --- a/reactrestrict/reactrestrict.py +++ b/reactrestrict/reactrestrict.py @@ -35,6 +35,10 @@ class ReactRestrict(Cog): ) self.config.register_global(registered_combos=[]) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + async def combo_list(self) -> List[ReactRestrictCombo]: """ Returns a list of reactrestrict combos. diff --git a/recyclingplant/recyclingplant.py b/recyclingplant/recyclingplant.py index 2460c4f..cc7bf57 100644 --- a/recyclingplant/recyclingplant.py +++ b/recyclingplant/recyclingplant.py @@ -15,6 +15,10 @@ class RecyclingPlant(Cog): self.bot = bot self.junk = None + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + def load_junk(self): junk_path = bundled_data_path(self) / "junk.json" with junk_path.open() as json_data: diff --git a/rpsls/rpsls.py b/rpsls/rpsls.py index ac80c8e..b831d1c 100644 --- a/rpsls/rpsls.py +++ b/rpsls/rpsls.py @@ -21,6 +21,10 @@ class RPSLS(Cog): super().__init__() self.bot = bot + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def rpsls(self, ctx: commands.Context, choice: str): """ diff --git a/sayurl/sayurl.py b/sayurl/sayurl.py index ed6ca94..0057b86 100644 --- a/sayurl/sayurl.py +++ b/sayurl/sayurl.py @@ -27,6 +27,10 @@ class SayUrl(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def sayurl(self, ctx: commands.Context, url): """ diff --git a/scp/scp.py b/scp/scp.py index 0df8c87..3b4176c 100644 --- a/scp/scp.py +++ b/scp/scp.py @@ -11,6 +11,10 @@ class SCP(Cog): super().__init__() self.bot = bot + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command() async def scp(self, ctx: commands.Context, num: int): """Look up SCP articles. diff --git a/stealemoji/stealemoji.py b/stealemoji/stealemoji.py index cbcbc72..301c5a5 100644 --- a/stealemoji/stealemoji.py +++ b/stealemoji/stealemoji.py @@ -48,6 +48,10 @@ class StealEmoji(Cog): self.is_on = None + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.group() async def stealemoji(self, ctx: commands.Context): """ diff --git a/timerole/timerole.py b/timerole/timerole.py index 273216d..ff93e39 100644 --- a/timerole/timerole.py +++ b/timerole/timerole.py @@ -22,6 +22,10 @@ class Timerole(Cog): self.config.register_guild(**default_guild) self.updating = self.bot.loop.create_task(self.check_day()) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + def cog_unload(self): self.updating.cancel() diff --git a/tts/tts.py b/tts/tts.py index e00bfa7..1291777 100644 --- a/tts/tts.py +++ b/tts/tts.py @@ -23,6 +23,10 @@ class TTS(Cog): self.config.register_global(**default_global) self.config.register_guild(**default_guild) + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.command(aliases=["t2s", "text2"]) async def tts(self, ctx: commands.Context, *, text: str): """ diff --git a/unicode/unicode.py b/unicode/unicode.py index 78eb4f0..4705f5d 100644 --- a/unicode/unicode.py +++ b/unicode/unicode.py @@ -12,6 +12,10 @@ class Unicode(Cog): super().__init__() self.bot = bot + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + @commands.group(name="unicode", pass_context=True) async def unicode(self, ctx): """Encode/Decode a Unicode character.""" diff --git a/werewolf/werewolf.py b/werewolf/werewolf.py index cd4d95b..1f8fc3f 100644 --- a/werewolf/werewolf.py +++ b/werewolf/werewolf.py @@ -20,6 +20,7 @@ class Werewolf(Cog): """ def __init__(self, bot: Red): + super().__init__() self.bot = bot self.config = Config.get_conf( self, identifier=87101114101119111108102, force_registration=True @@ -37,6 +38,10 @@ class Werewolf(Cog): self.games = {} # Active games stored here, id is per guild + async def red_delete_data_for_user(self, **kwargs): + """Nothing to delete""" + return + def __unload(self): print("Unload called") for game in self.games.values(): From 035b395eb552360a8ac30572d1e49816df778206 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 6 Aug 2020 13:23:53 -0400 Subject: [PATCH 2/5] Add `end_user_data_statement`to info.json --- announcedaily/info.json | 1 + audiotrivia/info.json | 1 + ccrole/info.json | 1 + chatter/info.json | 1 + coglint/info.json | 1 + dad/info.json | 1 + exclusiverole/info.json | 1 + flag/info.json | 1 + forcemention/info.json | 1 + hangman/info.json | 1 + infochannel/info.json | 1 + leaver/info.json | 1 + lovecalculator/info.json | 1 + lseen/info.json | 1 + planttycoon/info.json | 1 + qrinvite/info.json | 1 + reactrestrict/info.json | 1 + recyclingplant/info.json | 1 + rpsls/info.json | 1 + sayurl/info.json | 1 + scp/info.json | 1 + stealemoji/info.json | 1 + timerole/info.json | 1 + tts/info.json | 1 + unicode/info.json | 1 + werewolf/info.json | 1 + 26 files changed, 26 insertions(+) diff --git a/announcedaily/info.json b/announcedaily/info.json index 84315bf..99c6b74 100644 --- a/announcedaily/info.json +++ b/announcedaily/info.json @@ -11,6 +11,7 @@ "hidden": true, "install_msg": "Thank you for installing AnnounceDaily! Get started with `[p]load announcedaily` and `[p]help AnnounceDaily`", "short": "Send daily announcements", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy" ] diff --git a/audiotrivia/info.json b/audiotrivia/info.json index 697875d..71eeb8a 100644 --- a/audiotrivia/info.json +++ b/audiotrivia/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing Audio trivia!\n You **MUST** unload trivia to use this (`[p]unload trivia`)\n Then you can get started with `[p]load audiotrivia` and `[p]help AudioTrivia`", "short": "Start an Audio Trivia game", + "end_user_data_statement": "This cog expands the core Audio and Trivia cogs without collecting any additional End User Data.\nSee the core End User Data storage for more information", "tags": [ "fox", "bobloy", diff --git a/ccrole/info.json b/ccrole/info.json index 6e0d8f7..dc6a10c 100644 --- a/ccrole/info.json +++ b/ccrole/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing Custom Commands w/ Roles. Get started with `[p]load ccrole` and `[p]help CCRole`", "short": "[Incomplete] Creates commands that adjust roles", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "fox", "bobloy", diff --git a/chatter/info.json b/chatter/info.json index fe1f554..204a7f4 100644 --- a/chatter/info.json +++ b/chatter/info.json @@ -24,6 +24,7 @@ "spacy>=2.3,<2.4" ], "short": "Local Chatbot run on machine learning", + "end_user_data_statement": "This cog only stores anonymous conversations data; no End User Data is stored.", "tags": [ "chat", "chatbot", diff --git a/coglint/info.json b/coglint/info.json index aa3f665..4cac127 100644 --- a/coglint/info.json +++ b/coglint/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing CogLint! Get started with `[p]load coglint` and `[p]help CogLint`", "requirements": ["pylint"], "short": "Python cog linter", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils", diff --git a/dad/info.json b/dad/info.json index 81af745..65c9d3e 100644 --- a/dad/info.json +++ b/dad/info.json @@ -11,6 +11,7 @@ "hidden": true, "install_msg": "Thank you for installing Dad. Get started with `[p]load dad`, then `[p]help Dad`", "short": "Dad joke bot", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils", diff --git a/exclusiverole/info.json b/exclusiverole/info.json index ade6bd0..c6a863f 100644 --- a/exclusiverole/info.json +++ b/exclusiverole/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing ExclusiveRole. Get started with `[p]load exclusiverole` and `[p]help ExclusiveRole`", "short": "Set roles to be exclusive", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "fox", "bobloy", diff --git a/flag/info.json b/flag/info.json index 7ee8ad5..1f74067 100644 --- a/flag/info.json +++ b/flag/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing Flag! Get started with `[p]load flag` and `[p]help Flag`", "short": "Add expiring flags to members", + "end_user_data_statement": "This cog stores user IDs listed along with a provided explanation for being flagged", "tags": [ "bobloy", "warning", diff --git a/forcemention/info.json b/forcemention/info.json index f7326b9..09cdcfe 100644 --- a/forcemention/info.json +++ b/forcemention/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing ForceMention! Get started with `[p]load forcemention`, then `[p]forcemention`", "short": "Mention unmentionables", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils" diff --git a/hangman/info.json b/hangman/info.json index c9dadf0..f788491 100644 --- a/hangman/info.json +++ b/hangman/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing Hangman! Get started with `[p]load hangman`, then `[p]help Hangman`", "requirements": [], "short": "Play Hangman", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "game", "fun", diff --git a/infochannel/info.json b/infochannel/info.json index 2a2efc5..fea31c7 100644 --- a/infochannel/info.json +++ b/infochannel/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing InfoChannel. Get started with `[p]load infochannel`, then `[p]help InfoChannel`", "short": "Updating server info channel", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils" diff --git a/leaver/info.json b/leaver/info.json index f5b0a65..0b2c431 100644 --- a/leaver/info.json +++ b/leaver/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing Leaver. Get started with `[p]load leaver`, then `[p]help Leaver`", "short": "Send message on leave", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils", diff --git a/lovecalculator/info.json b/lovecalculator/info.json index 20601b6..b38f473 100644 --- a/lovecalculator/info.json +++ b/lovecalculator/info.json @@ -15,6 +15,7 @@ "beautifulsoup4" ], "short": "Calculate love percentage", + "end_user_data_statement": "This cog uses the core Bank cog. It store no End User Data otherwise.", "tags": [ "bobloy", "fun", diff --git a/lseen/info.json b/lseen/info.json index c5e5eec..64c32c3 100644 --- a/lseen/info.json +++ b/lseen/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing LastSeen. Get started with `[p]load lseen`, then `[p]help LastSeen`", "requirements": ["python-dateutil"], "short": "Last seen tracker", + "end_user_data_statement": "This cog stores user IDs along with a time they were last online per guild", "tags": [ "bobloy", "utils", diff --git a/planttycoon/info.json b/planttycoon/info.json index 32fe8e2..4f1965a 100644 --- a/planttycoon/info.json +++ b/planttycoon/info.json @@ -14,6 +14,7 @@ "install_msg": "Thank you for installing PlantTycoon. Check out all the commands with `[p]help PlantTycoon`", "requirements": [], "short": "Grow your own plants! Do `[p]gardening` to get started.", + "end_user_data_statement": "This cog stores user IDs along with their progress in the PlantTycoon game", "tags": [ "bobloy", "games", diff --git a/qrinvite/info.json b/qrinvite/info.json index 0db8d11..3ce9072 100644 --- a/qrinvite/info.json +++ b/qrinvite/info.json @@ -14,6 +14,7 @@ "MyQR" ], "short": "Create a QR code invite", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "tools", diff --git a/reactrestrict/info.json b/reactrestrict/info.json index c232ac8..e64dbf9 100644 --- a/reactrestrict/info.json +++ b/reactrestrict/info.json @@ -11,6 +11,7 @@ "hidden": true, "install_msg": "Thank you for installing ReactRestrict.", "short": "[Incomplete] Prevent reactions", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "react", "reaction", diff --git a/recyclingplant/info.json b/recyclingplant/info.json index b713f5c..499d67a 100644 --- a/recyclingplant/info.json +++ b/recyclingplant/info.json @@ -12,6 +12,7 @@ "hidden": false, "install_msg": "Thank you for installing RecyclingPlant. Start recycling today with `[p]load recyclingplant`, then `[p]recyclingplant`", "short": "Apply for a job at the recycling plant!", + "end_user_data_statement": "This cog used the core", "tags": [ "bobloy", "environment", diff --git a/rpsls/info.json b/rpsls/info.json index c7c9ebe..7549f7a 100644 --- a/rpsls/info.json +++ b/rpsls/info.json @@ -13,6 +13,7 @@ "install_msg": "Thank you for installing RPSLS. Get started with `[p]load rpsls`, then `[p]rpsls`", "requirements": [], "short": "Play Rock Papers Scissor Lizard Spock in Discord!", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "star trek", diff --git a/sayurl/info.json b/sayurl/info.json index 1beaf60..882d2d7 100644 --- a/sayurl/info.json +++ b/sayurl/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing SayUrl! Get started with `[p]load sayurl`, then `[p]help SayUrl", "requirements": ["html2text"], "short": "Convert URL to text", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "tools" diff --git a/scp/info.json b/scp/info.json index 4ac9ea9..af16e43 100644 --- a/scp/info.json +++ b/scp/info.json @@ -13,6 +13,7 @@ "install_msg": "You are now connected to the SCP database. You may now proceed to access the data using `[p]load scp`, then `[p]help SCP`", "requirements": [], "short": "Look up SCP articles.", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "gruesom" diff --git a/stealemoji/info.json b/stealemoji/info.json index 67d2ad9..c926c3b 100644 --- a/stealemoji/info.json +++ b/stealemoji/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing StealEmoji", "requirements": [], "short": "Steals custom emojis", + "end_user_data_statement": "This cog gathers custom emojis from all sources, but stores no End User Data", "tags": [ "bobloy", "utils", diff --git a/timerole/info.json b/timerole/info.json index 34b173b..eb00922 100644 --- a/timerole/info.json +++ b/timerole/info.json @@ -11,6 +11,7 @@ "hidden": false, "install_msg": "Thank you for installing timerole.\nGet started with `[p]load timerole`. Configure with `[p]timerole`", "short": "Apply roles after # of days", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utilities", diff --git a/tts/info.json b/tts/info.json index 6810a42..4ad16c9 100644 --- a/tts/info.json +++ b/tts/info.json @@ -14,6 +14,7 @@ "gTTS" ], "short": "Send TTS messages as uploaded mp3", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utils", diff --git a/unicode/info.json b/unicode/info.json index 0d8d24b..9414b8c 100644 --- a/unicode/info.json +++ b/unicode/info.json @@ -13,6 +13,7 @@ "install_msg": "\u0048\u0065\u006c\u006c\u006f\u0021 \u0054\u0068\u0069\u0073 \u006d\u0065\u0073\u0073\u0061\u0067\u0065 \u0077\u0061\u0073 \u0077\u0072\u0069\u0074\u0074\u0065\u006e \u0069\u006e \u0055\u004e\u0049\u0043\u004f\u0044\u0045\u002e", "requirements": [], "short": "Encode/Decode Unicode characters!", + "end_user_data_statement": "This cog does not store any End User Data", "tags": [ "bobloy", "utility", diff --git a/werewolf/info.json b/werewolf/info.json index 5fbc50b..9d8e6e4 100644 --- a/werewolf/info.json +++ b/werewolf/info.json @@ -12,6 +12,7 @@ "install_msg": "Thank you for installing Werewolf! Get started with `[p]load werewolf`\n Use `[p]wwset` to run inital setup", "requirements": [], "short": "Werewolf Game", + "end_user_data_statement": "This store user IDs in memory while they're actively using the cog, and store no persistent End User Data.", "tags": [ "mafia", "werewolf", From c7ea0e4d5e1eb961016faf9b18e0dbbdbe7e31a3 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 6 Aug 2020 13:24:08 -0400 Subject: [PATCH 3/5] Updated to delete data correctly --- flag/flag.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flag/flag.py b/flag/flag.py index d1e34fb..3073761 100644 --- a/flag/flag.py +++ b/flag/flag.py @@ -33,11 +33,11 @@ class Flag(Cog): if requester not in ["discord_deleted_user", "owner"]: return - all_members = await self.config.all_members() + all_guilds = await self.config.all_guilds() - async for guild_id, guild_data in AsyncIter(all_members.items(), steps=100): - if user_id in guild_data: - await self.config.member_from_ids(guild_id, user_id).clear() + async for guild_id, guild_data in AsyncIter(all_guilds.items(), steps=100): + if user_id in guild_data["flags"]: + await self.config.guild_from_id(guild_id).flags.clear_raw(user_id) @checks.is_owner() @commands.guild_only() From 7e1f59462cb896971b5c9ae3bfbc1969321bba62 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 6 Aug 2020 13:27:16 -0400 Subject: [PATCH 4/5] Ignore both venvs --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9ec1673..7a224ea 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ venv/ v-data/ database.sqlite3 +/venv3.4/ From 58ad3fc9787e57fb232f2b05a7da1a9d5d390661 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 13 Aug 2020 12:18:31 -0400 Subject: [PATCH 5/5] It's actually a maximum --- announcedaily/info.json | 6 +----- audiotrivia/info.json | 6 +----- ccrole/info.json | 6 +----- chatter/info.json | 6 +----- coglint/info.json | 10 ++++------ conquest/info.json | 6 +----- dad/info.json | 6 +----- exclusiverole/info.json | 6 +----- flag/info.json | 6 +----- forcemention/info.json | 6 +----- hangman/info.json | 6 +----- infochannel/info.json | 6 +----- leaver/info.json | 6 +----- lovecalculator/info.json | 6 +----- lseen/info.json | 10 ++++------ nudity/info..json | 6 +----- planttycoon/info.json | 6 +----- qrinvite/info.json | 6 +----- reactrestrict/info.json | 6 +----- recyclingplant/info.json | 6 +----- rpsls/info.json | 6 +----- sayurl/info.json | 10 ++++------ scp/info.json | 6 +----- stealemoji/info.json | 6 +----- timerole/info.json | 6 +----- tts/info.json | 6 +----- unicode/info.json | 6 +----- werewolf/info.json | 8 ++------ 28 files changed, 38 insertions(+), 144 deletions(-) diff --git a/announcedaily/info.json b/announcedaily/info.json index cb092b6..57aa7f1 100644 --- a/announcedaily/info.json +++ b/announcedaily/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Send daily announcements to all servers at a specified times", "hidden": false, "install_msg": "Thank you for installing AnnounceDaily! Get started with `[p]load announcedaily` and `[p]help AnnounceDaily`", diff --git a/audiotrivia/info.json b/audiotrivia/info.json index 71eeb8a..655aa0d 100644 --- a/audiotrivia/info.json +++ b/audiotrivia/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Start an Audio Trivia game", "hidden": false, "install_msg": "Thank you for installing Audio trivia!\n You **MUST** unload trivia to use this (`[p]unload trivia`)\n Then you can get started with `[p]load audiotrivia` and `[p]help AudioTrivia`", diff --git a/ccrole/info.json b/ccrole/info.json index d107ecd..8021be9 100644 --- a/ccrole/info.json +++ b/ccrole/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Creates custom commands to adjust roles and send custom messages", "hidden": false, "install_msg": "Thank you for installing Custom Commands w/ Roles. Get started with `[p]load ccrole` and `[p]help CCRole`", diff --git a/chatter/info.json b/chatter/info.json index 204a7f4..abf51a8 100644 --- a/chatter/info.json +++ b/chatter/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 3, - 10 - ], + "min_bot_version": "3.3.10", "description": "Create an offline chatbot that talks like your average member using Machine Learning", "hidden": false, "install_msg": "Thank you for installing Chatter! Get started ith `[p]load chatter` and `[p]help Chatter`", diff --git a/coglint/info.json b/coglint/info.json index 4cac127..420b8af 100644 --- a/coglint/info.json +++ b/coglint/info.json @@ -2,15 +2,13 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Lint python code posted in chat", "hidden": true, "install_msg": "Thank you for installing CogLint! Get started with `[p]load coglint` and `[p]help CogLint`", - "requirements": ["pylint"], + "requirements": [ + "pylint" + ], "short": "Python cog linter", "end_user_data_statement": "This cog does not store any End User Data", "tags": [ diff --git a/conquest/info.json b/conquest/info.json index 2687209..d92c394 100644 --- a/conquest/info.json +++ b/conquest/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 4, - 0 - ], + "min_bot_version": "3.4.0", "description": "Handle war games by filling in specified territories with colors", "hidden": false, "install_msg": "Thank you for installing Conquest. Get started with `[p]load conquest`, then `[p]help Conquest`", diff --git a/dad/info.json b/dad/info.json index a67c63e..c4b2dd8 100644 --- a/dad/info.json +++ b/dad/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Tell dad jokes and give out bad nicknames", "hidden": false, "install_msg": "Thank you for installing Dad. Get started with `[p]load dad`, then `[p]help Dad`", diff --git a/exclusiverole/info.json b/exclusiverole/info.json index c6a863f..426eabd 100644 --- a/exclusiverole/info.json +++ b/exclusiverole/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Assign roles to be exclusive, preventing other roles from being added", "hidden": false, "install_msg": "Thank you for installing ExclusiveRole. Get started with `[p]load exclusiverole` and `[p]help ExclusiveRole`", diff --git a/flag/info.json b/flag/info.json index 1f74067..0d687a6 100644 --- a/flag/info.json +++ b/flag/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Add expiring flags on members to track warnings or incidents", "hidden": false, "install_msg": "Thank you for installing Flag! Get started with `[p]load flag` and `[p]help Flag`", diff --git a/forcemention/info.json b/forcemention/info.json index 09cdcfe..e99f611 100644 --- a/forcemention/info.json +++ b/forcemention/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Mentions roles that are unmentionable", "hidden": false, "install_msg": "Thank you for installing ForceMention! Get started with `[p]load forcemention`, then `[p]forcemention`", diff --git a/hangman/info.json b/hangman/info.json index f788491..b4db258 100644 --- a/hangman/info.json +++ b/hangman/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Play Hangman with your friends", "hidden": false, "install_msg": "Thank you for installing Hangman! Get started with `[p]load hangman`, then `[p]help Hangman`", diff --git a/infochannel/info.json b/infochannel/info.json index fea31c7..b8fad4e 100644 --- a/infochannel/info.json +++ b/infochannel/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Create a channel with updating server info", "hidden": false, "install_msg": "Thank you for installing InfoChannel. Get started with `[p]load infochannel`, then `[p]help InfoChannel`", diff --git a/leaver/info.json b/leaver/info.json index 0b2c431..0c8d3d1 100644 --- a/leaver/info.json +++ b/leaver/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Keeps track of when people leave the server, and posts a message notifying", "hidden": false, "install_msg": "Thank you for installing Leaver. Get started with `[p]load leaver`, then `[p]help Leaver`", diff --git a/lovecalculator/info.json b/lovecalculator/info.json index b38f473..543ff92 100644 --- a/lovecalculator/info.json +++ b/lovecalculator/info.json @@ -3,11 +3,7 @@ "Bobloy", "SnappyDragon" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Calculate the love percentage for two users", "hidden": false, "install_msg": "Thank you for installing LoveCalculator. Love is in the air.\n Get started with `[p]load lovecalculator`, then `[p]help LoveCalculator`", diff --git a/lseen/info.json b/lseen/info.json index 64c32c3..33ae133 100644 --- a/lseen/info.json +++ b/lseen/info.json @@ -2,15 +2,13 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Keep track of when users were last seen online", "hidden": false, "install_msg": "Thank you for installing LastSeen. Get started with `[p]load lseen`, then `[p]help LastSeen`", - "requirements": ["python-dateutil"], + "requirements": [ + "python-dateutil" + ], "short": "Last seen tracker", "end_user_data_statement": "This cog stores user IDs along with a time they were last online per guild", "tags": [ diff --git a/nudity/info..json b/nudity/info..json index 34c4804..4a2c1fb 100644 --- a/nudity/info..json +++ b/nudity/info..json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "min_bot_version": [ - 3, - 3, - 11 - ], + "min_bot_version": "3.3.11", "description": "Monitor images for NSFW content and moves them to a nsfw channel if possible", "hidden": false, "install_msg": "Thank you for installing Nudity. Get started with `[p]load nudity`, then `[p]help Nudity`", diff --git a/planttycoon/info.json b/planttycoon/info.json index 4f1965a..d64d70f 100644 --- a/planttycoon/info.json +++ b/planttycoon/info.json @@ -4,11 +4,7 @@ "SnappyDragon", "PaddoInWonderland" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Grow your own plants! Be sure to take care of it. Do `[p]gardening` to get started", "hidden": false, "install_msg": "Thank you for installing PlantTycoon. Check out all the commands with `[p]help PlantTycoon`", diff --git a/qrinvite/info.json b/qrinvite/info.json index 3ce9072..5817774 100644 --- a/qrinvite/info.json +++ b/qrinvite/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Create a QR code invite for the server", "hidden": false, "install_msg": "Thank you for installing QRInvite! Get started with `[p]load qrinvite`, then `[p]help QRInvite`", diff --git a/reactrestrict/info.json b/reactrestrict/info.json index 36ae9e4..1eaa291 100644 --- a/reactrestrict/info.json +++ b/reactrestrict/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Cog to prevent reactions on specific messages from certain users", "hidden": false, "install_msg": "Thank you for installing ReactRestrict.", diff --git a/recyclingplant/info.json b/recyclingplant/info.json index 499d67a..f7c0cdc 100644 --- a/recyclingplant/info.json +++ b/recyclingplant/info.json @@ -3,11 +3,7 @@ "Bobloy", "SnappyDragon" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Apply for a job at the recycling plant! Sort out the garbage!", "hidden": false, "install_msg": "Thank you for installing RecyclingPlant. Start recycling today with `[p]load recyclingplant`, then `[p]recyclingplant`", diff --git a/rpsls/info.json b/rpsls/info.json index 7549f7a..dc5fa5e 100644 --- a/rpsls/info.json +++ b/rpsls/info.json @@ -3,11 +3,7 @@ "Bobloy", "SnappyDragon" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Play Rock Papers Scissor Lizard Spock by Sam Kass in Discord!", "hidden": false, "install_msg": "Thank you for installing RPSLS. Get started with `[p]load rpsls`, then `[p]rpsls`", diff --git a/sayurl/info.json b/sayurl/info.json index 882d2d7..c978eb4 100644 --- a/sayurl/info.json +++ b/sayurl/info.json @@ -2,15 +2,13 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Convert any website into text and post it in chat", "hidden": true, "install_msg": "Thank you for installing SayUrl! Get started with `[p]load sayurl`, then `[p]help SayUrl", - "requirements": ["html2text"], + "requirements": [ + "html2text" + ], "short": "Convert URL to text", "end_user_data_statement": "This cog does not store any End User Data", "tags": [ diff --git a/scp/info.json b/scp/info.json index af16e43..5ca808c 100644 --- a/scp/info.json +++ b/scp/info.json @@ -3,11 +3,7 @@ "Bobloy", "SnappyDragon" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Look up SCP articles. Warning: Some of them may be too creepy or gruesome.", "hidden": false, "install_msg": "You are now connected to the SCP database. You may now proceed to access the data using `[p]load scp`, then `[p]help SCP`", diff --git a/stealemoji/info.json b/stealemoji/info.json index 76a6681..f91ce8e 100644 --- a/stealemoji/info.json +++ b/stealemoji/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Steals custom emojis the bot sees and moves them to an emoji server", "hidden": false, "install_msg": "Thank you for installing StealEmoji", diff --git a/timerole/info.json b/timerole/info.json index eb00922..ec74efb 100644 --- a/timerole/info.json +++ b/timerole/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Apply roles based on the # of days on server", "hidden": false, "install_msg": "Thank you for installing timerole.\nGet started with `[p]load timerole`. Configure with `[p]timerole`", diff --git a/tts/info.json b/tts/info.json index 5a64d92..707928f 100644 --- a/tts/info.json +++ b/tts/info.json @@ -2,11 +2,7 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Send Text2Speech messages as an uploaded mp3", "hidden": false, "install_msg": "Thank you for installing TTS. Get started with `[p]load tts`, then `[p]help TTS`", diff --git a/unicode/info.json b/unicode/info.json index 9414b8c..edd160f 100644 --- a/unicode/info.json +++ b/unicode/info.json @@ -3,11 +3,7 @@ "Bobloy", "SnappyDragon" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Encode/Decode Unicode characters!", "hidden": false, "install_msg": "\u0048\u0065\u006c\u006c\u006f\u0021 \u0054\u0068\u0069\u0073 \u006d\u0065\u0073\u0073\u0061\u0067\u0065 \u0077\u0061\u0073 \u0077\u0072\u0069\u0074\u0074\u0065\u006e \u0069\u006e \u0055\u004e\u0049\u0043\u004f\u0044\u0045\u002e", diff --git a/werewolf/info.json b/werewolf/info.json index 9d8e6e4..af67794 100644 --- a/werewolf/info.json +++ b/werewolf/info.json @@ -2,13 +2,9 @@ "author": [ "Bobloy" ], - "bot_version": [ - 3, - 0, - 0 - ], + "min_bot_version": "3.3.0", "description": "Customizable Werewolf Game", - "hidden": false, + "hidden": true, "install_msg": "Thank you for installing Werewolf! Get started with `[p]load werewolf`\n Use `[p]wwset` to run inital setup", "requirements": [], "short": "Werewolf Game",