mirror of https://gitlab.com/litecord/litecord.git
make nonces strings
This commit is contained in:
parent
db7ea18f09
commit
fedfc97c96
|
|
@ -108,8 +108,16 @@ async def create_message(channel_id):
|
||||||
INSERT INTO messages (id, channel_id, author_id, content, tts,
|
INSERT INTO messages (id, channel_id, author_id, content, tts,
|
||||||
mention_everyone, nonce, message_type)
|
mention_everyone, nonce, message_type)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||||
""", message_id, channel_id, user_id, j['content'], j.get('tts', False),
|
""",
|
||||||
'@everyone' in j['content'], j.get('nonce', 0), MessageType.DEFAULT)
|
message_id,
|
||||||
|
channel_id,
|
||||||
|
user_id,
|
||||||
|
j['content'],
|
||||||
|
j.get('tts', False),
|
||||||
|
'@everyone' in j['content'],
|
||||||
|
int(j.get('nonce', 0)),
|
||||||
|
MessageType.DEFAULT
|
||||||
|
)
|
||||||
|
|
||||||
# TODO: dispatch_channel
|
# TODO: dispatch_channel
|
||||||
payload = await app.storage.get_message(message_id)
|
payload = await app.storage.get_message(message_id)
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ MEMBER_UPDATE = {
|
||||||
|
|
||||||
MESSAGE_CREATE = {
|
MESSAGE_CREATE = {
|
||||||
'content': {'type': 'string', 'minlength': 1, 'maxlength': 2000},
|
'content': {'type': 'string', 'minlength': 1, 'maxlength': 2000},
|
||||||
'nonce': {'type': 'number', 'required': False},
|
'nonce': {'type': 'string', 'required': False},
|
||||||
'tts': {'type': 'boolean', 'required': False},
|
'tts': {'type': 'boolean', 'required': False},
|
||||||
|
|
||||||
# TODO: file, embed, payload_json
|
# TODO: file, embed, payload_json
|
||||||
|
|
|
||||||
|
|
@ -334,6 +334,7 @@ class Storage:
|
||||||
return
|
return
|
||||||
|
|
||||||
res = dict(row)
|
res = dict(row)
|
||||||
|
res['nonce'] = str(res['nonce'])
|
||||||
res['timestamp'] = res['timestamp'].isoformat()
|
res['timestamp'] = res['timestamp'].isoformat()
|
||||||
res['type'] = res['message_type']
|
res['type'] = res['message_type']
|
||||||
res.pop('message_type')
|
res.pop('message_type')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue