diff --git a/src/bots/abramam/.env.example b/src/bots/abramam/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/abramam/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/abramam/EdenGeneratorCog.py b/src/bots/abramam/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/abramam/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/abramam/EdenLogosCharacterCog.py b/src/bots/abramam/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/abramam/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/bytegan/.env.example b/src/bots/bytegan/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/bytegan/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/bytegan/EdenGeneratorCog.py b/src/bots/bytegan/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/bytegan/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/bytegan/EdenLogosCharacterCog.py b/src/bots/bytegan/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/bytegan/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/cheems/.env.example b/src/bots/cheems/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/cheems/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/cheems/EdenGeneratorCog.py b/src/bots/cheems/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/cheems/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/cheems/EdenLogosCharacterCog.py b/src/bots/cheems/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/cheems/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/drmawz/.env.example b/src/bots/drmawz/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/drmawz/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/drmawz/EdenGeneratorCog.py b/src/bots/drmawz/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/drmawz/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/drmawz/EdenLogosCharacterCog.py b/src/bots/drmawz/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/drmawz/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/eris/.env.example b/src/bots/eris/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/eris/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/eris/EdenGeneratorCog.py b/src/bots/eris/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/eris/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/eris/EdenLogosCharacterCog.py b/src/bots/eris/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/eris/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/hypathia/.env.example b/src/bots/hypathia/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/hypathia/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/hypathia/EdenGeneratorCog.py b/src/bots/hypathia/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/hypathia/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/hypathia/EdenLogosCharacterCog.py b/src/bots/hypathia/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/hypathia/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/irregularapocalypse/.env.example b/src/bots/irregularapocalypse/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/irregularapocalypse/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/irregularapocalypse/EdenGeneratorCog.py b/src/bots/irregularapocalypse/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/irregularapocalypse/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/irregularapocalypse/EdenLogosCharacterCog.py b/src/bots/irregularapocalypse/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/irregularapocalypse/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/jabrils/.env.example b/src/bots/jabrils/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/jabrils/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/jabrils/EdenGeneratorCog.py b/src/bots/jabrils/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/jabrils/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/jabrils/EdenLogosCharacterCog.py b/src/bots/jabrils/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/jabrils/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/swoledoge/.env.example b/src/bots/swoledoge/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/swoledoge/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/swoledoge/EdenGeneratorCog.py b/src/bots/swoledoge/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/swoledoge/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/swoledoge/EdenLogosCharacterCog.py b/src/bots/swoledoge/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/swoledoge/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/verdelis/.env.example b/src/bots/verdelis/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/verdelis/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/verdelis/EdenGeneratorCog.py b/src/bots/verdelis/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/verdelis/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/verdelis/EdenLogosCharacterCog.py b/src/bots/verdelis/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/verdelis/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/yaleau/.env.example b/src/bots/yaleau/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/yaleau/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/yaleau/EdenGeneratorCog.py b/src/bots/yaleau/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/yaleau/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/yaleau/EdenLogosCharacterCog.py b/src/bots/yaleau/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/yaleau/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/bots/zenthebus/.env.example b/src/bots/zenthebus/.env.example new file mode 100644 index 0000000..004dd0c --- /dev/null +++ b/src/bots/zenthebus/.env.example @@ -0,0 +1,14 @@ +DISCORD_TOKEN= +MONGO_URI= +MONGO_DB_NAME= + +EDEN_API_URL= +EDEN_API_KEY= +EDEN_API_SECRET= +EDEN_CHARACTER_ID= + +ALLOWED_GUILDS= +ALLOWED_GUILDS_TEST= +ALLOWED_CHANNELS= + +LOGOS_URL= diff --git a/src/bots/zenthebus/EdenGeneratorCog.py b/src/bots/zenthebus/EdenGeneratorCog.py new file mode 100644 index 0000000..8eaab7f --- /dev/null +++ b/src/bots/zenthebus/EdenGeneratorCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.CharacterGeneratorCog import CharacterGeneratorCog + + +class EdenCharacterGeneratorCog(CharacterGeneratorCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenCharacterGeneratorCog(bot)) diff --git a/src/bots/zenthebus/EdenLogosCharacterCog.py b/src/bots/zenthebus/EdenLogosCharacterCog.py new file mode 100644 index 0000000..ecd2f7c --- /dev/null +++ b/src/bots/zenthebus/EdenLogosCharacterCog.py @@ -0,0 +1,11 @@ +from discord.ext import commands +from cogs.LogosCharacterCog import LogosCharacterCog + + +class EdenLogosCharacterCog(LogosCharacterCog): + def __init__(self, bot: commands.bot) -> None: + super().__init__(bot) + + +def setup(bot: commands.Bot) -> None: + bot.add_cog(EdenLogosCharacterCog(bot)) diff --git a/src/common/discord.py b/src/common/discord.py index fc1740e..55ffcb0 100644 --- a/src/common/discord.py +++ b/src/common/discord.py @@ -122,12 +122,26 @@ def replace_mentions_with_usernames( """ for mention in mentions: message_content = message_content.replace( - f"<@{mention.id}>", + f"<@!?{mention.id}>", f"{prefix}{mention.display_name}{suffix}", ) return message_content +def replace_usernames_with_mentions( + message_content: str, + user_lookup: dict, +) -> str: + """ + Replaces all usernames with mentions of their ID. + :param message_content: The message to replace usernames in. + :return: The message with all usernames replaced with their mentions. + """ + for user in user_lookup: + message_content = message_content.replace(user, f"<@!{user_lookup[user]}>") + return message_content + + def in_channels(channel_ids: List[int]) -> commands.check: async def predicate(ctx): if ctx.channel.id in channel_ids: