mirror of https://gitlab.com/litecord/litecord.git
Merge branch 'master' into 'master'
some fixes See merge request luna/litecord!6
This commit is contained in:
commit
3fbaf15c1a
|
|
@ -18,7 +18,7 @@ Create Reaction PUT /channels/{channel.id}/messa
|
||||||
Create Webhook POST /channels/{channel.id}/webhooks
|
Create Webhook POST /channels/{channel.id}/webhooks
|
||||||
Delete All Reactions DELETE /channels/{channel.id}/messages/{message.id}/reactions
|
Delete All Reactions DELETE /channels/{channel.id}/messages/{message.id}/reactions
|
||||||
Delete Channel Permission DELETE /channels/{channel.id}/permissions/{overwrite.id}
|
Delete Channel Permission DELETE /channels/{channel.id}/permissions/{overwrite.id}
|
||||||
Delete Guild DELETE /guilds/{guild.id}
|
Delete Guild POST /guilds/{guild.id}/delete
|
||||||
Delete Guild Integration DELETE /guilds/{guild.id}/integrations/{integration.id}
|
Delete Guild Integration DELETE /guilds/{guild.id}/integrations/{integration.id}
|
||||||
Delete Guild Role DELETE /guilds/{guild.id}/roles/{role.id}
|
Delete Guild Role DELETE /guilds/{guild.id}/roles/{role.id}
|
||||||
Delete Invite DELETE /invites/{invite.code}
|
Delete Invite DELETE /invites/{invite.code}
|
||||||
|
|
|
||||||
|
|
@ -133,9 +133,9 @@ async def create_guild():
|
||||||
# is the same as the id of the guild, and create_role
|
# is the same as the id of the guild, and create_role
|
||||||
# generates a new snowflake.
|
# generates a new snowflake.
|
||||||
await app.db.execute("""
|
await app.db.execute("""
|
||||||
INSERT INTO roles (id, guild_id, name, position, permissions)
|
INSERT INTO roles (id, guild_id, name, position, permissions, color)
|
||||||
VALUES ($1, $2, $3, $4, $5)
|
VALUES ($1, $2, $3, $4, $5, $6)
|
||||||
""", guild_id, guild_id, '@everyone', 0, DEFAULT_EVERYONE_PERMS)
|
""", guild_id, guild_id, '@everyone', 0, DEFAULT_EVERYONE_PERMS, 0)
|
||||||
|
|
||||||
# add the @everyone role to the guild creator
|
# add the @everyone role to the guild creator
|
||||||
await app.db.execute("""
|
await app.db.execute("""
|
||||||
|
|
@ -254,6 +254,7 @@ async def _update_guild(guild_id):
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/<int:guild_id>', methods=['DELETE'])
|
@bp.route('/<int:guild_id>', methods=['DELETE'])
|
||||||
|
@bp.route('/<int:guild_id>/delete', methods=['POST']) # this one is not actually documented, but it's used by Discord client
|
||||||
async def delete_guild(guild_id):
|
async def delete_guild(guild_id):
|
||||||
"""Delete a guild."""
|
"""Delete a guild."""
|
||||||
user_id = await token_check()
|
user_id = await token_check()
|
||||||
|
|
@ -264,9 +265,11 @@ async def delete_guild(guild_id):
|
||||||
WHERE guilds.id = $1
|
WHERE guilds.id = $1
|
||||||
""", guild_id)
|
""", guild_id)
|
||||||
|
|
||||||
await app.dispatcher.dispatch_guild(guild_id, 'GUILD_DELETE', {
|
# Discord's client expects IDs being string
|
||||||
'id': guild_id,
|
await app.dispatcher.dispatch('guild', guild_id, 'GUILD_DELETE', {
|
||||||
'unavailable': False,
|
'guild_id': str(guild_id),
|
||||||
|
'id': str(guild_id),
|
||||||
|
# 'unavailable': False,
|
||||||
})
|
})
|
||||||
|
|
||||||
# remove from the dispatcher so nobody
|
# remove from the dispatcher so nobody
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ REGISTER = {
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_WITH_INVITE = {**REGISTER, **{
|
REGISTER_WITH_INVITE = {**REGISTER, **{
|
||||||
'invcode': {'type': 'string', 'required': True}
|
'invite': {'type': 'string', 'required': True}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue