mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-11 12:43:01 +02:00
When inviting bot, check it has bot scope
This commit is contained in:
parent
14115c0e06
commit
15e5b17b0d
2 changed files with 27 additions and 3 deletions
|
@ -43,6 +43,21 @@ test("invite: checks for invalid matrix ID", async t => {
|
|||
t.equal(msgs[0].createInteractionResponse.data.content, "You have to say the Matrix ID of the person you want to invite. Matrix IDs look like this: `@username:example.org`")
|
||||
})
|
||||
|
||||
test("invite: checks if guild exists", async t => { // it might not exist if the application was added with applications.commands scope and not bot scope
|
||||
const msgs = await fromAsync(_interact({
|
||||
data: {
|
||||
options: [{
|
||||
name: "user",
|
||||
type: DiscordTypes.ApplicationCommandOptionType.String,
|
||||
value: "@cadence:cadence.moe"
|
||||
}]
|
||||
},
|
||||
channel: discord.channels.get("0"),
|
||||
guild_id: "0"
|
||||
}, {}))
|
||||
t.match(msgs[0].createInteractionResponse.data.content, /there is no bot presence in the server/)
|
||||
})
|
||||
|
||||
test("invite: checks if channel exists or is autocreatable", async t => {
|
||||
db.prepare("UPDATE guild_active SET autocreate = 0").run()
|
||||
const msgs = await fromAsync(_interact({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue