Esempio n. 1
0
async def test_typing_starts_follow_up(bot, interaction, command):
    clazz = InteractionContext(bot=bot,
                               interaction=interaction,
                               command=command)
    async with clazz.typing():
        pass
    assert clazz.follow_up
    interaction.response.defer.assert_called_once()
Esempio n. 2
0
async def test_send_follow_up_file_only(file, bot, interaction, command):
    clazz = InteractionContext(bot=bot,
                               interaction=interaction,
                               command=command)
    async with clazz.typing():
        await clazz.send(file=file)
    interaction.response.defer.assert_called_once()
    interaction.followup.send.assert_called_once_with("", file=file)
Esempio n. 3
0
async def test_send_follow_up_delete_after_no_webhook_message(
        bot, interaction, command):
    interaction.followup.send.return_value = None
    clazz = InteractionContext(bot=bot,
                               interaction=interaction,
                               command=command)
    async with clazz.typing():
        await clazz.send("hi", delete_after=2)
    interaction.response.defer.assert_called_once()
    interaction.followup.send.assert_called_once_with("hi")
Esempio n. 4
0
async def test_send_follow_up_all_args_embeds(file, embed, bot, interaction,
                                              command):
    clazz = InteractionContext(bot=bot,
                               interaction=interaction,
                               command=command)
    async with clazz.typing():
        await clazz.send("hi", embeds=[embed], file=file)
    interaction.response.defer.assert_called_once()
    interaction.followup.send.assert_called_once_with("hi",
                                                      embeds=[embed],
                                                      file=file)