add end user messages and functions, will ad functionality later

This commit is contained in:
brandons209 2021-02-06 03:40:00 -05:00
parent 3c5b7141a7
commit 240b72bbd3
58 changed files with 257 additions and 279 deletions

View file

@ -1,5 +1,6 @@
from .leveler import Leveler from .leveler import Leveler
__red_end_user_data_statement__ = "Stores some level info like experience, profile description/picture, and message ID of user's last message in guild."
def setup(bot): def setup(bot):
n = Leveler(bot) n = Leveler(bot)

View file

@ -16,7 +16,7 @@ from redbot.core.i18n import Translator, cog_i18n
from io import BytesIO from io import BytesIO
import functools import functools
import textwrap import textwrap
from typing import Literal
_ = Translator("Leveler", __file__) _ = Translator("Leveler", __file__)
@ -653,3 +653,11 @@ class Leveler(commands.Cog):
return return
# reset level stats on leave. # reset level stats on leave.
await self.profiles.data.member(member).clear() await self.profiles.data.member(member).clear()
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .activitylog import ActivityLogger from .activitylog import ActivityLogger
__red_end_user_data_statement__ = "Depending on setup, can log user messages, voice channel activity, audit actions in guilds, activity statistics per guild, user name changes, and any moderation actions per guild."
async def setup(bot): async def setup(bot):
n = ActivityLogger(bot) n = ActivityLogger(bot)

View file

@ -14,6 +14,8 @@ import asyncio
import glob import glob
import io import io
from typing import Literal
# plotting # plotting
from bisect import bisect_left from bisect import bisect_left
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
@ -1940,5 +1942,10 @@ class ActivityLogger(commands.Cog):
# if member: # if member:
# data[guild.name] = await self.config.member(member).stats() # data[guild.name] = await self.config.member(member).stats()
async def red_delete_data_for_user(self, requester: str, user_id: int): async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass pass

View file

@ -1,5 +1,6 @@
from .birthday import Birthday from .birthday import Birthday
__red_end_user_data_statement__ = "This cog will store a user's birthday."
def setup(bot): def setup(bot):
bot.add_cog(Birthday(bot)) bot.add_cog(Birthday(bot))

View file

@ -8,7 +8,7 @@ from dateutil import parser
import asyncio import asyncio
import datetime import datetime
import discord import discord
from typing import Literal
class Birthday(commands.Cog): class Birthday(commands.Cog):
"""Track birthdays, add birthday role, and annouce birthdays for users.""" """Track birthdays, add birthday role, and annouce birthdays for users."""
@ -268,3 +268,11 @@ class Birthday(commands.Cog):
await ctx.send("No one has their birthday set in your server!") await ctx.send("No one has their birthday set in your server!")
else: else:
await menu(ctx, embeds, DEFAULT_CONTROLS) await menu(ctx, embeds, DEFAULT_CONTROLS)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .confession import Confession from .confession import Confession
__red_end_user_data_statement__ = "This cog won't store anything for a user."
def setup(bot): def setup(bot):
n = Confession() n = Confession()

View file

@ -1,11 +1,11 @@
from redbot.core import commands, checks, Config from redbot.core import commands, checks, Config
from redbot.core.utils.predicates import MessagePredicate from redbot.core.utils.predicates import MessagePredicate
from redbot.core.utils.menus import DEFAULT_CONTROLS, menu from redbot.core.utils.menus import DEFAULT_CONTROLS, menu
from typing import Literal
import contextlib import contextlib
import discord import discord
import asyncio import asyncio
class Confession(commands.Cog): class Confession(commands.Cog):
def __init__(self): def __init__(self):
self.config = Config.get_conf(self, identifier=665235, force_registration=True) self.config = Config.get_conf(self, identifier=665235, force_registration=True)
@ -184,3 +184,11 @@ class Confession(commands.Cog):
pass pass
await ctx.author.send("Your confession has been sent, you are forgiven now.") await ctx.author.send("Your confession has been sent, you are forgiven now.")
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .manager import CostManager from .manager import CostManager
__red_end_user_data_statement__ = "This cog won't store anything for a user."
def setup(bot): def setup(bot):
bot.add_cog(CostManager(bot)) bot.add_cog(CostManager(bot))

View file

@ -1,5 +1,6 @@
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands, bank from redbot.core import Config, checks, commands, bank
from typing import Literal
import discord import discord
import asyncio import asyncio
@ -406,3 +407,11 @@ class CostManager(commands.Cog):
) )
await asyncio.sleep(10) await asyncio.sleep(10)
await message.delete() await message.delete()
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .disable import Disable from .disable import Disable
__red_end_user_data_statement__ = "This cog won't store any data for users."
def setup(bot): def setup(bot):
bot.add_cog(Disable(bot)) bot.add_cog(Disable(bot))

View file

@ -1,8 +1,9 @@
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
from redbot.core.utils.mod import is_admin_or_superior from redbot.core.utils.mod import is_admin_or_superior
import discord
from discord.ext.commands import DisabledCommand from discord.ext.commands import DisabledCommand
from typing import Literal
import discord
class DisabledError(commands.CheckFailure): class DisabledError(commands.CheckFailure):
@ -75,3 +76,11 @@ class Disable(commands.Cog):
if isinstance(exception, DisabledError): if isinstance(exception, DisabledError):
msg = await self.config.guild(ctx.guild).disabled_message() msg = await self.config.guild(ctx.guild).disabled_message()
await ctx.send(msg.format(ctx.command.name)) await ctx.send(msg.format(ctx.command.name))
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from . import core from . import core
__red_end_user_data_statement__ = "This cog only stores internal variables per user."
def setup(bot): def setup(bot):
bot.add_cog(core.EconomyTrickle(bot)) bot.add_cog(core.EconomyTrickle(bot))

View file

@ -11,6 +11,7 @@ from redbot.core import commands, checks
from redbot.core.config import Config from redbot.core.config import Config
from redbot.core import bank from redbot.core import bank
from redbot.core.utils.chat_formatting import pagify, box from redbot.core.utils.chat_formatting import pagify, box
from typing import Literal
from .activity import RecordHandler from .activity import RecordHandler
from .converters import configable_guild_defaults, settings_converter from .converters import configable_guild_defaults, settings_converter
@ -323,3 +324,11 @@ class EconomyTrickle(commands.Cog):
pages = pagify(msg) pages = pagify(msg)
for page in pages: for page in pages:
await ctx.send(box(page)) await ctx.send(box(page))
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .core import EveryoneEmoji from .core import EveryoneEmoji
__red_end_user_data_statement__ = "This cog stores no data."
def setup(bot): def setup(bot):
bot.add_cog(EveryoneEmoji(bot)) bot.add_cog(EveryoneEmoji(bot))

View file

@ -6,7 +6,7 @@ import unicodedata
import aiohttp import aiohttp
import discord import discord
from redbot.core import commands, checks from redbot.core import commands, checks
from typing import Literal
class EveryoneEmoji(commands.Cog): class EveryoneEmoji(commands.Cog):
@ -108,3 +108,11 @@ class EveryoneEmoji(commands.Cog):
img = io.BytesIO(img) img = io.BytesIO(img)
await ctx.send(f"{ctx.author.display_name} says:", file=discord.File(img, name)) await ctx.send(f"{ctx.author.display_name} says:", file=discord.File(img, name))
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,7 +0,0 @@
from .events import Events
def setup(bot):
n = Events(bot)
bot.add_cog(n)
bot.loop.create_task(n.update_events())

View file

@ -1,254 +0,0 @@
import discord
from redbot.core import checks, commands
from redbot.core.utils.chat_formatting import *
from redbot.core import Config
import time
import random
import asyncio
import datetime
import pytz
from tzlocal import get_localzone
basic_colors = [
discord.Colour.blue(),
discord.Colour.teal(),
discord.Colour.dark_teal(),
discord.Colour.green(),
discord.Colour.dark_green(),
discord.Colour.dark_blue(),
discord.Colour.purple(),
discord.Colour.dark_purple(),
discord.Colour.magenta(),
discord.Colour.gold(),
discord.Colour.orange(),
discord.Colour.red(),
discord.Colour.dark_red(),
discord.Colour.blurple(),
discord.Colour.greyple(),
]
class Events(commands.Cog):
"""
Set events that track time since set events
"""
def __init__(self, bot):
super().__init__()
self.config = Config.get_conf(self, identifier=6748392754)
self.timezone = get_localzone()
self.bot = bot
# set default values
self.config.register_guild(events={}, channel=0)
@commands.group()
@commands.guild_only()
async def event(self, ctx):
"""
Track time since event occured.
"""
pass
@event.command(name="add")
async def addevent(self, ctx, start_time: str, *, event_name: str = ""):
"""
Add event to track. If start time is not given, the current data and time is used.
Start time should be a UNIX timestamp in UTC.
"""
guild = ctx.guild
channel_id = await self.config.guild(guild).channel()
if channel_id == 0:
await ctx.send("Channel not setup, use ``{}eventset channel` to set channel for events.".format(ctx.prefix))
return
channel = self.bot.get_channel(channel_id)
if not channel:
await ctx.send("Channel set not found, please setup channel.")
return
try:
start_time = datetime.datetime.utcfromtimestamp(int(start_time))
except:
event_name = start_time + " " + event_name
start_time = datetime.datetime.utcnow()
elapsed_time = datetime.datetime.utcnow() - start_time
embed = discord.Embed(title=event_name, colour=random.choice(basic_colors))
embed.add_field(
name="Event time",
value=start_time.replace(tzinfo=pytz.utc).astimezone(self.timezone).strftime("%b %d, %Y, %H:%M"),
)
day_msg = "{} day{},".format(elapsed_time.days, "s" if elapsed_time.days > 1 else "")
hour_msg = " {} hour{}".format(
int(elapsed_time.seconds / 60 / 60), "s" if int(elapsed_time.seconds / 60 / 60) > 1 else ""
)
if elapsed_time.days > 0 or int(elapsed_time.seconds / 60 / 60) > 0:
minute_msg = ", and {} minute{}".format(
int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60),
"s" if int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60) > 1 else "",
)
else:
minute_msg = "{} minute{}".format(
int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60),
"s" if int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60) > 1 else "",
)
msg = "{}{}{}".format(
day_msg if elapsed_time.days > 0 else "",
hour_msg if int(elapsed_time.seconds / 60 / 60) > 0 else "",
minute_msg,
)
embed.add_field(name="Elapsed time", value=msg)
message = await channel.send(embed=embed)
async with self.config.guild(guild).events() as events:
new_event = {"start_time": int(start_time.replace(tzinfo=pytz.utc).timestamp()), "name": event_name}
events[message.id] = new_event
await ctx.send("Event added!")
@event.command(name="del")
async def delevent(self, ctx):
"""
Delete an event. Interactive deletion, so just run the command.
"""
guild = ctx.guild
channel_id = await self.config.guild(guild).channel()
if channel_id == 0:
await ctx.send("Channel not setup, use `{}eventset channel` to set channel for events.".format(ctx.prefix))
return
channel = self.bot.get_channel(channel_id)
if not channel:
await ctx.send("Channel set not found, please setup channel.")
return
counter = 0
msg = "```"
async with self.config.guild(guild).events() as events:
for num, event in events.items():
msg += "{}\t{}\n".format(counter, event["name"])
if len(msg + "```") + 100 > 2000:
msg += "```"
await ctx.send(msg)
msg = "```"
counter += 1
msg += "```"
await ctx.send(msg)
await ctx.send("Please choose which event you want to delete. (type number in chat)")
def m_check(m):
try:
return (
m.author.id == ctx.author.id
and m.channel.id == ctx.channel.id
and int(m.content) <= counter
and int(m.content) >= 0
)
except:
return False
try:
response = await self.bot.wait_for("message", timeout=30, check=m_check)
except:
await ctx.send("Timed out, event deletion cancelled.")
return
for i, num in enumerate(events.keys()):
if i == int(response.content):
event_num = num
try:
message = await channel.fetch_message(event_num)
await message.delete()
except:
await ctx.send("Event message in {} was not found.".format(channel.mention))
await ctx.send("{} has been deleted!".format(events[event_num]["name"]))
del events[event_num]
@event.command(name="list")
async def listevent(self, ctx):
"""
List all events for server.
"""
guild = ctx.guild
msg = "```\n"
async with self.config.guild(guild).events() as events:
if len(events) == 0:
msg += "None"
for num, event in events.items():
msg += "{}\n".format(event["name"])
if len(msg + "```") + 3 > 2000:
msg += "```"
await ctx.send(msg)
msg = "```"
msg += "```"
await ctx.send(msg)
@commands.group()
@commands.guild_only()
@checks.admin_or_permissions(administrator=True)
async def eventset(self, ctx: commands.Context):
"""Manages event settings"""
pass
@eventset.command(name="channel")
async def _channel_set(self, ctx, channel: discord.TextChannel):
"""
Set channel to send event messages too
"""
guild = ctx.guild
await self.config.guild(guild).channel.set(channel.id)
await ctx.send("Channel now set to {}".format(channel.mention))
async def update_events(self):
while True:
if self is not self.bot.get_cog("Events"):
print("events cog has been lost")
return
guilds = self.bot.guilds
for guild in guilds:
async with self.config.guild(guild).events() as events:
channel_id = await self.config.guild(guild).channel()
if channel_id == 0:
continue
channel = self.bot.get_channel(channel_id)
if channel is None:
continue
for message_id, event in events.items():
try:
message = await channel.fetch_message(message_id)
except:
continue
start_time = datetime.datetime.utcfromtimestamp(event["start_time"])
elapsed_time = datetime.datetime.utcnow() - start_time
embed = message.embeds[0]
embed.clear_fields()
embed.add_field(
name="Event time",
value=start_time.replace(tzinfo=pytz.utc)
.astimezone(self.timezone)
.strftime("%b %d, %Y, %H:%M"),
)
day_msg = "{} day{},".format(elapsed_time.days, "s" if elapsed_time.days > 1 else "")
hour_msg = " {} hour{}".format(
int(elapsed_time.seconds / 60 / 60), "s" if int(elapsed_time.seconds / 60 / 60) > 1 else ""
)
if elapsed_time.days > 0 or int(elapsed_time.seconds / 60 / 60) > 0:
minute_msg = ", and {} minute{}".format(
int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60),
"s"
if int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60) > 1
else "",
)
else:
minute_msg = "{} minute{}".format(
int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60),
"s"
if int(elapsed_time.seconds / 60 - int(elapsed_time.seconds / 60 / 60) * 60) > 1
else "",
)
msg = "{}{}{}".format(
day_msg if elapsed_time.days > 0 else "",
hour_msg if int(elapsed_time.seconds / 60 / 60) > 0 else "",
minute_msg,
)
embed.add_field(name="Elapsed time", value=msg)
await message.edit(embed=embed)
await asyncio.sleep(30)

View file

@ -1,5 +1,6 @@
from .isolate import Isolate from .isolate import Isolate
__red_end_user_data_statement__ = "This cog stores members who are currently isolated for moderation purposes."
async def setup(bot): async def setup(bot):
isolate = Isolate(bot) isolate = Isolate(bot)

View file

@ -11,6 +11,7 @@ from .memoizer import Memoizer
# general # general
import asyncio import asyncio
from datetime import datetime from datetime import datetime
from typing import Literal
import inspect import inspect
import logging import logging
import time import time
@ -1430,3 +1431,11 @@ class Isolate(commands.Cog):
msg += "\n\nOriginal reason was: " + member_data["reason"] msg += "\n\nOriginal reason was: " + member_data["reason"]
await self._unisolate(member, reason=msg, apply_roles=False, update=True, quiet=True) await self._unisolate(member, reason=msg, apply_roles=False, update=True, quiet=True)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .markov import Markov from .markov import Markov
__red_end_user_data_statement__ = "This doesn't store any user data."
def setup(bot): def setup(bot):
bot.add_cog(Markov(bot)) bot.add_cog(Markov(bot))

View file

@ -1,5 +1,6 @@
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
from typing import Literal
import discord import discord
import random import random
import asyncio import asyncio
@ -193,3 +194,11 @@ class Markov(commands.Cog):
model[str(message.channel.id)][content[i]].append(content[i + 1]) model[str(message.channel.id)][content[i]].append(content[i + 1])
self.cache[guild.id]["model"] = model self.cache[guild.id]["model"] = model
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .memeify import Memeify from .memeify import Memeify
__red_end_user_data_statement__ = "This cog does not store user data."
def setup(bot): def setup(bot):
bot.add_cog(Memeify(bot)) bot.add_cog(Memeify(bot))

View file

@ -1,5 +1,6 @@
from redbot.core import Config, commands from redbot.core import Config, commands
from redbot.core.utils.chat_formatting import pagify from redbot.core.utils.chat_formatting import pagify
from typing import Literal
import re import re
import random import random
import string import string
@ -294,3 +295,11 @@ class Memeify(commands.Cog):
text = text[:-1] text = text[:-1]
return text return text
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .moreadmin import MoreAdmin from .moreadmin import MoreAdmin
__red_end_user_data_statement__ = "This will store a user's last few messages (depending on configuration)"
def setup(bot): def setup(bot):
bot.add_cog(MoreAdmin(bot)) bot.add_cog(MoreAdmin(bot))

View file

@ -7,6 +7,7 @@ from redbot.core.data_manager import cog_data_path
import discord import discord
from .utils import * from .utils import *
from typing import Literal
import asyncio import asyncio
from typing import Union from typing import Union
import os import os
@ -1069,3 +1070,11 @@ class MoreAdmin(commands.Cog):
if to_add: if to_add:
await self.add_last_msg(message) await self.add_last_msg(message)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .nitroemoji import NitroEmoji from .nitroemoji import NitroEmoji
__red_end_user_data_statement__ = "This cog will store a user's custom emojis in each guild."
async def setup(bot): async def setup(bot):
n = NitroEmoji(bot) n = NitroEmoji(bot)

View file

@ -1,6 +1,7 @@
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands, bank from redbot.core import Config, checks, commands, bank
from redbot.core.data_manager import cog_data_path from redbot.core.data_manager import cog_data_path
from typing import Literal
import discord import discord
import aiohttp import aiohttp
@ -359,3 +360,11 @@ class NitroEmoji(commands.Cog):
break break
except ValueError: except ValueError:
pass pass
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .personalroles import PersonalRoles from .personalroles import PersonalRoles
__red_end_user_data_statement__ = "This will store what a user's custom role is if they have one."
def setup(bot): def setup(bot):
bot.add_cog(PersonalRoles(bot)) bot.add_cog(PersonalRoles(bot))

View file

@ -6,7 +6,7 @@
"install_msg": "Thanks for install.", "install_msg": "Thanks for install.",
"short": "Personal roles for members", "short": "Personal roles for members",
"description": "Personal roles for members", "description": "Personal roles for members",
"min_bot_version": "3.2.1", "min_bot_version": "3.4.0",
"tags": [ "tags": [
"myrole", "myrole",
"personal role", "personal role",
@ -15,6 +15,5 @@
"requirements": [ "requirements": [
"tabulate" "tabulate"
], ],
"min_bot_version": "3.4.0",
"end_user_data_statement": "This will store what a user's custom role is if they have one." "end_user_data_statement": "This will store what a user's custom role is if they have one."
} }

View file

@ -9,6 +9,7 @@ from redbot.core.utils import chat_formatting as chat
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
from redbot.core.utils.mod import get_audit_reason from redbot.core.utils.mod import get_audit_reason
from tabulate import tabulate from tabulate import tabulate
from typing import Literal
import asyncio import asyncio
_ = Translator("PersonalRoles", __file__) _ = Translator("PersonalRoles", __file__)
@ -434,3 +435,11 @@ class PersonalRoles(commands.Cog):
await role.delete() await role.delete()
except: except:
pass pass
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .pony import Pony from .pony import Pony
__red_end_user_data_statement__ = "This doesn't store any user data."
def setup(bot): def setup(bot):
bot.add_cog(Pony()) bot.add_cog(Pony())

View file

@ -2,6 +2,7 @@ import discord
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
from urllib import parse from urllib import parse
from typing import Literal
import aiohttp import aiohttp
import os import os
import traceback import traceback
@ -373,3 +374,11 @@ class Pony(commands.Cog):
return await message.edit(content=f"Artists: `{artists}`\n{output}") return await message.edit(content=f"Artists: `{artists}`\n{output}")
else: else:
return await message.edit(content=output) return await message.edit(content=output)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .punish import Punish from .punish import Punish
__red_end_user_data_statement__ = "This will store who is currently punished in each guild."
async def setup(bot): async def setup(bot):
punish = Punish(bot) punish = Punish(bot)

View file

@ -17,5 +17,5 @@
"brandons209", "brandons209",
"punish" "punish"
], ],
"end_user_data_statement": "This will store who is currently punished." "end_user_data_statement": "This will store who is currently punished in each guild."
} }

View file

@ -11,6 +11,7 @@ from .memoizer import Memoizer
# general # general
import asyncio import asyncio
from datetime import datetime from datetime import datetime
from typing import Literal
import inspect import inspect
import logging import logging
import time import time
@ -1497,3 +1498,11 @@ class Punish(commands.Cog):
msg += "\n\nOriginal reason was: " + member_data["reason"] msg += "\n\nOriginal reason was: " + member_data["reason"]
await self._unpunish(member, reason=msg, apply_roles=False, update=True, quiet=True) await self._unpunish(member, reason=msg, apply_roles=False, update=True, quiet=True)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .reactpoll import ReactPoll from .reactpoll import ReactPoll
__red_end_user_data_statement__ = "This cog won't store user data."
def setup(bot): def setup(bot):
n = ReactPoll(bot) n = ReactPoll(bot)

View file

@ -8,6 +8,7 @@ import asyncio
import re import re
import time import time
from datetime import datetime, timedelta from datetime import datetime, timedelta
from typing import Literal
from .time_utils import * from .time_utils import *
# May need to not save on every reaction add if it causes too much lag # May need to not save on every reaction add if it causes too much lag
@ -292,6 +293,14 @@ class NewReactPoll:
del self.poll_sessions[str(self.channel.id)] del self.poll_sessions[str(self.channel.id)]
await self.main.delete_poll(self) await self.main.delete_poll(self)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass
class LoadedPoll(NewReactPoll): class LoadedPoll(NewReactPoll):
"""A reaction poll loaded from disk""" """A reaction poll loaded from disk"""

View file

@ -1,5 +1,6 @@
from .core import RoleManagement from .core import RoleManagement
__red_end_user_data_statement__ = "This will only store sticky and subscribed roles for users."
def setup(bot): def setup(bot):
cog = RoleManagement(bot) cog = RoleManagement(bot)

View file

@ -5,7 +5,7 @@ import asyncio
import re import re
import time import time
from abc import ABCMeta from abc import ABCMeta
from typing import AsyncIterator, Tuple, Optional, Union, List, Dict from typing import AsyncIterator, Tuple, Optional, Union, List, Dict, Literal
import discord import discord
from discord.ext.commands import CogMeta as DPYCogMeta from discord.ext.commands import CogMeta as DPYCogMeta
@ -1108,3 +1108,11 @@ class RoleManagement(
for em, rdata in _outer.items(): for em, rdata in _outer.items():
if rdata and rdata["roleid"] == role.id: if rdata and rdata["roleid"] == role.id:
yield (mid, em, rdata) yield (mid, em, rdata)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -4,7 +4,7 @@
"DiscordLiz", "DiscordLiz",
"brandons209" "brandons209"
], ],
"install_msg": "If you need help, I have a channel in https://discord.gg/mb85deu", "install_msg": "Thank you for using RoleManagement!",
"name": "RoleManagement", "name": "RoleManagement",
"disabled": false, "disabled": false,
"short": "Role searches, reactroles, requirements for roles, etc.", "short": "Role searches, reactroles, requirements for roles, etc.",
@ -18,5 +18,5 @@
], ],
"hidden": false, "hidden": false,
"min_bot_version": "3.4.0", "min_bot_version": "3.4.0",
"end_user_data_statement": "This will only store sticky roles for users." "end_user_data_statement": "This will only store sticky and subscribed roles for users."
} }

View file

@ -2,6 +2,7 @@ import os
from .roleplay import RolePlay from .roleplay import RolePlay
from redbot.core import Config from redbot.core import Config
__red_end_user_data_statement__ = "No data is stored."
def setup(bot): def setup(bot):
bot.add_cog(RolePlay(bot)) bot.add_cog(RolePlay(bot))

View file

@ -3,6 +3,7 @@ from redbot.core.utils.chat_formatting import italics, pagify, box
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
import random import random
from random import choice from random import choice
from typing import Literal
import asyncio import asyncio
import os import os
@ -439,3 +440,11 @@ class RolePlay(commands.Cog):
await ctx.send(msg + "(╯°□°)╯︵ " + name[::-1]) await ctx.send(msg + "(╯°□°)╯︵ " + name[::-1])
else: else:
await ctx.send("*flips a coin and... " + choice(["HEADS!*", "TAILS!*"])) await ctx.send("*flips a coin and... " + choice(["HEADS!*", "TAILS!*"]))
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .roletracker import RoleTracker from .roletracker import RoleTracker
__red_end_user_data_statement__ = "This cog stores the users who have a trackable role."
async def setup(bot): async def setup(bot):
roletracker = RoleTracker(bot) roletracker = RoleTracker(bot)

View file

@ -15,5 +15,5 @@
"brandons209", "brandons209",
"pancakesparkle" "pancakesparkle"
], ],
"end_user_data_statement": "Depending on setup, can log user messages, voice channel activity, audit actions in guilds, activity statistics per guild, user name changes, and any moderation actions per guild." "end_user_data_statement": "This cog stores the users who have a trackable role."
} }

View file

@ -6,6 +6,7 @@ from datetime import datetime
from redbot.core import checks, commands, Config, modlog from redbot.core import checks, commands, Config, modlog
from redbot.core.utils.chat_formatting import pagify from redbot.core.utils.chat_formatting import pagify
from redbot.core.utils.predicates import MessagePredicate from redbot.core.utils.predicates import MessagePredicate
from typing import Literal
try: try:
from redbot.core.commands import GuildContext from redbot.core.commands import GuildContext
@ -267,3 +268,11 @@ class RoleTracker(commands.Cog):
await case.edit(edits) await case.edit(edits)
await self.config.role(role).USERS.set(data) await self.config.role(role).USERS.set(data)
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .rules import Rules from .rules import Rules
__red_end_user_data_statement__ = "This only stores rules added by admins of guilds."
def setup(bot): def setup(bot):
bot.add_cog(Rules(bot)) bot.add_cog(Rules(bot))

View file

@ -3,7 +3,7 @@ from redbot.core import checks, commands, Config
from redbot.core.utils import chat_formatting as chat from redbot.core.utils import chat_formatting as chat
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
import asyncio import asyncio
from typing import Union from typing import Union, Literal
class Rules(commands.Cog): class Rules(commands.Cog):
@ -137,3 +137,11 @@ class Rules(commands.Cog):
async with self.config.channel(channel).rules() as rules: async with self.config.channel(channel).rules() as rules:
rules[str(rule_num)] = rule rules[str(rule_num)] = rule
await ctx.tick() await ctx.tick()
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .sfx import SFX from .sfx import SFX
__red_end_user_data_statement__ = "This doesn't store any user data."
def setup(bot): def setup(bot):
bot.add_cog(SFX(bot)) bot.add_cog(SFX(bot))

View file

@ -7,6 +7,7 @@ import os
import glob import glob
import asyncio import asyncio
from difflib import get_close_matches from difflib import get_close_matches
from typing import Literal
import tabulate import tabulate
from .utils import saysound, code_path from .utils import saysound, code_path
@ -363,3 +364,11 @@ class SFX(commands.Cog):
except: except:
await ctx.send("Please allow DMs from server members so I can DM you the list!") await ctx.send("Please allow DMs from server members so I can DM you the list!")
return return
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .shootout import Shootout from .shootout import Shootout
__red_end_user_data_statement__ = "This cog won't store anything for a user."
def setup(bot): def setup(bot):
bot.add_cog(Shootout(bot)) bot.add_cog(Shootout(bot))

View file

@ -5,7 +5,7 @@
from redbot.core import bank, commands, checks, Config from redbot.core import bank, commands, checks, Config
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
import asyncio, contextlib, discord, random, shlex import asyncio, contextlib, discord, random, shlex
from typing import Literal
class Shootout(commands.Cog): class Shootout(commands.Cog):
default_config = { default_config = {

View file

@ -1,5 +1,6 @@
from .smartreact import SmartReact from .smartreact import SmartReact
__red_end_user_data_statement__ = "This doesn't store any user data."
def setup(bot): def setup(bot):
bot.add_cog(SmartReact(bot)) bot.add_cog(SmartReact(bot))

View file

@ -1,7 +1,7 @@
import discord import discord
from redbot.core import Config, commands, checks from redbot.core import Config, commands, checks
from redbot.core.utils.chat_formatting import pagify from redbot.core.utils.chat_formatting import pagify
from typing import Literal
class SmartReact(commands.Cog): class SmartReact(commands.Cog):
"""Create automatic reactions when trigger words are typed in chat""" """Create automatic reactions when trigger words are typed in chat"""
@ -137,3 +137,11 @@ class SmartReact(commands.Cog):
pass pass
except discord.errors.InvalidArgument: except discord.errors.InvalidArgument:
pass pass
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,5 +1,6 @@
from .trickortreat import TrickorTreat from .trickortreat import TrickorTreat
__red_end_user_data_statement__ = "This doesn't store any user data."
def setup(bot): def setup(bot):
bot.add_cog(TrickorTreat(bot)) bot.add_cog(TrickorTreat(bot))

View file

@ -1,6 +1,7 @@
from redbot.core.utils.chat_formatting import * from redbot.core.utils.chat_formatting import *
from redbot.core import Config, checks, commands, bank from redbot.core import Config, checks, commands, bank
from redbot.core.utils.predicates import MessagePredicate from redbot.core.utils.predicates import MessagePredicate
from typing import Literal
import discord import discord
import asyncio import asyncio
import random import random
@ -313,3 +314,11 @@ class TrickorTreat(commands.Cog):
await bank.withdraw_credits(ctx.author, amount) await bank.withdraw_credits(ctx.author, amount)
await self.config.member(ctx.author).last_pay.set(time.time()) await self.config.member(ctx.author).last_pay.set(time.time())
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass

View file

@ -1,7 +1,7 @@
from redbot.core.bot import Red from redbot.core.bot import Red
from .welcome import Welcome from .welcome import Welcome
__red_end_user_data_statement__ = "This cog doesn't store any user data."
def setup(bot: Red): def setup(bot: Red):
bot.add_cog(Welcome(bot=bot)) bot.add_cog(Welcome(bot=bot))

View file

@ -3,7 +3,7 @@ import datetime
import discord import discord
import logging import logging
import random import random
from typing import Optional, Union from typing import Optional, Union, Literal
from redbot.core import Config, checks, commands from redbot.core import Config, checks, commands
from redbot.core.utils.chat_formatting import box, pagify, humanize_list from redbot.core.utils.chat_formatting import box, pagify, humanize_list
@ -899,3 +899,11 @@ class Welcome(commands.Cog):
"""Gets today's date in ordinal form.""" """Gets today's date in ordinal form."""
return datetime.date.today().toordinal() return datetime.date.today().toordinal()
async def red_delete_data_for_user(
self,
*,
requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
user_id: int,
):
pass