-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render plain text for messages sent in attachments and remove the header #773
Conversation
…escription message.
…as a plaintext file.
…ith executor command as message.
c675dd3
to
f88fc01
Compare
@mszostok FYI, the PR is code complete. Feel free to review the code while huseyinbabal fixes the build. |
pkg/bot/teams.go
Outdated
resp := b.processMessage(turn.Activity) | ||
if len(resp) >= maxMessageSize { | ||
n, resp := b.processMessage(turn.Activity) | ||
if n >= maxMessageSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will double check this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the same issue, but it's prob because I don't have OneDrive configured for my account.
BUT, the response is successful ... after the upload, with the file uploaded to Sharepoint correctly.
{
"type": "invoke",
"id": "f:xxxxxxx64a-f47d-b6db-52ec44d0e207",
"timestamp": "2022-09-29T15:38:40.498Z",
"localTimestamp": "2022-09-29T16:38:40.498+01:00",
"localTimezone": "Europe/London",
"serviceUrl": "https://smba.trafficmanager.net/amer/",
"channelId": "msteams",
"from": {
"id": "29:xxxxxxxxxxxxxxx-iFcXUOYkFq2Fu7ihBVx6xraRHlM3qqPn107rY-IyKeeCvi5xh8Wg",
"name": "Ezo Saleh",
"aadObjectId": "xxxxxxx-b667-4eca-850a-af4089c10a41"
},
"conversation": {
"conversationType": "personal",
"tenantId": "xxxxxxxx-4029-49df-bd97-452fc58e7050",
"id": "a:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-yIBo7kqU6iiRgpy-CETymAFkmTThXZBIll16zAozfEKO"
},
"recipient": {
"id": "28:xxxxxxxx-70dc-4d28-93a0-eee6a4d22aea",
"name": "BotKube"
},
"locale": "en-GB",
"suggestedActions": {},
"entities": [
{
"type": "clientInfo"
}
],
"channelData": {
"legacy": {
"replyToId": "1:1_xxxx_xxxxx_1l4ATURTMHx5-S0SfLALwplUwTlW_zV3E"
},
"source": {
"name": "message"
},
"tenant": {
"id": "xxxxxxx-xxxx-49df-bd97-452fc58e7050"
}
},
"replyToId": "1664465905885",
"value": {
"action": "accept",
"context": {
"command": "logs pod/botkube-5cf68ff4-xwk62 -n botkube"
},
"type": "fileUpload",
"uploadInfo": {
"contentUrl": "https://xxxxxxx-my.sharepoint.com/personal/xxxxx_xxxxxx_onmicrosoft_com/Documents/Applications/BotKube/response.txt",
"fileType": "txt",
"name": "response.txt",
"uniqueId": "xxxxxxx-xxxxxf1xxxxxx-xxx-xxxxxxe",
"uploadUrl": "https://xxxxxxxx-my.sharepoint.com/personal/xxx_xxxxxx_onmicrosoft_com/_api/v2.0/drive/items/01UJSUYGUG7USXG2XP6FBIBSWZBK3WQUTO/uploadSession?guid='xxxxxxx-9f5-b8fa-eca8d1e824d2'\\u0026overwrite=False\\u0026rename=True\\u0026dc=0\\u0026tempauth=xxxxxxxxxxxxxxxxxxxxxxmZjEtY2UwMC0wMDAwMDAwMDAwMDAva3ViZXNob3AyLW15LnNoYXJlcG9pbnQuY29tQDJhM2VkOWY5LTQwMjktNDlkZi1iZDk3LTQ1MmZjNThlNzA1MCIsImlzcyI6IjAwMDAwMDAzLTAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMxxxxxxxxx2NjQ0NjU4NDQiLCJleHAiOiIxNjY0NTUyMjQ0IiwiZW5kcG9pbnR1cmwiOiJTMEcwN29EeERJeGROZXpIcGRlbzAwNE9SaXlSZVlldWNSdDg0akJsMmFnPSIsImVuZHBvaW50dXJsTGVuZ3RoIjoiMjIyIiwiaXNsb29wYmFjayI6IlRydWUiLCJjaWQiOiJZekJrTjJFNFl6UXRNMlkyT0MwME9Ua3dMV0ZtWkRrdFpUVTRNVFl3WTJOaU16ZzMiLCJ2ZXIiOiJoYXNoZWRwcm9vZnRva2VuIiwic2l0ZWlkIjoiWkdOaFpUVTBPRE10TVdVMU1pMDBORFJqTFdJelpUZ3RZV0poTXpGbE56RmpPRFkzIiwiYXBwX2Rpc3BsYXluYW1lIjoiTWljcm9zb2Z0IFRlYW1zIFNlcnZpY2VzIiwic2lnbmluX3N0YXRlIjoiW1wia21zaVwiXSIsImFwcGlkIjoiY2MxNWZkNTctMmM2Yy00MTE3LWE4OGMtODNiMWQ1NmI0YmJlIiwidGlkIjoiMmEzZWQ5ZjktxxxxxxxxxOTctNDUyZmM1OGU3MDUwIiwidXBuIjoiZXpvQGt1YmVzaG9wMi5vbm1pY3Jvc29mdC5jb20iLCJwdWlkIjoiMTAwMzIwMDIxMUZFQ0JBMyIsImNhY2hla2V5IjoiMGguZnxtZW1iZXJzaGlwfDEwMDMyMDAyMTFmZWNiYTNAbGl2ZS5jb20iLCJzY3AiOiJncm91cC53cml0ZSBhbGxzaXRlcy53cml0ZSBhbGxwcm9maWxlcy53cml0ZSIsInR0IjoiMiIsInVzZVBlcnNpc3RlbnRDb29raWUiOm51bGwsImlwYWRkciI6IjIwLjE5MC4xMzIuMTA1In0.Yi9QRXE2aHk4U0N5T28zaTBtZ2QvSlRwQkZ3WHByVxxxxxxxx"
}
},
"name": "fileConsent/invoke",
"relatesTo": {
"user": {},
"bot": {},
"conversation": {}
},
"expiration": "0001-01-01T00:00:00Z",
"semanticAction": {}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mszostok moving this to draft to adjust implementations. Will ping you when its ready for review. |
UpdateHad to merge in the latest from main which delayed a couple of things. Issue
Pending
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested Slack, SocketSlack,and Discord, all works like great 👍
I only failed with MS Teams, but this can be investigated later.
pkg/bot/discord.go
Outdated
//resp := interactive.RenderMessage(b.mdFormatter, response) | ||
//err := b.send(dm.Event, req, resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove it :)
pkg/bot/teams.go
Outdated
resp := b.processMessage(turn.Activity) | ||
if len(resp) >= maxMessageSize { | ||
n, resp := b.processMessage(turn.Activity) | ||
if n >= maxMessageSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Changes proposed in this pull request:
Test
gh pr checkout 773
k3d cluster create
.general
channel in a Slack workspace.On Slack, in the
general
channel run:This should produce something similar to ...
SLACK
DISCORD
Related issue(s)
Resolves #750