Beispiel #1
0
def test_embed_consistent_with_url(announce_cog):
    guild: discord.Guild = dpytest.get_config().guilds[0]
    announce_cog.messages[guild.id] = Announce.AnnounceMessage(
        f"This announcement is from {guild.name}", "testMessage", "test_url")
    embed: discord.Embed = announce_cog.construct_embed(guild)
    assert embed.title == f"This announcement is from {guild.name}"
    assert embed.description == "testMessage"
    assert embed.thumbnail.url == "test_url"
Beispiel #2
0
def make_message(guild, announce_cog):
    announce_cog.messages[guild.id] = Announce.AnnounceMessage(
        f"This announcement is from {guild.name}", "testMessage",
        guild.icon_url)
    announce_cog.roles[guild.id] = []
Beispiel #3
0
def announce_cog(bot: discord.ext.commands.Bot):
    announce_cog = Announce.Announce(bot)
    bot.add_cog(announce_cog)
    dpytest.configure(bot)
    print("Tests starting")
    return announce_cog