how to change the name of the bot header - botframework

I need to change the name of [chat] header bot to Askme.
may i know how to change it in Microsoft bot.
Image is attched

Alternatively, if you want to set it at the time of initialization and are using the Botchat.App() setup rather than the iframed version of webchat, you can set this in the parameter object sent to webchat:
BotChat.App({
botConnection: botConnection,
user: { id: '1234', name: 'user'},
bot: { id: 'bot' },
chatTitle: "I'm a custom chat title"
}, document.getElementById("bot"));
The key parameter in this case being chatTitle; other options that can be sent to webchat can be found in the source code right here.

If you are not using the iframe'd webchat, you can just modify the header's .innerHTML like this:
var header = document.getElementsByClassName("wc-header");
header[0].innerHTML = "<span>Askme</span>"

Related

MS Teams bot - create conversation in newly created Group returns 405 BadArgument

I'm trying to create new convesation for just created channel using Nodejs + botframework v4.9.2.
I've
created new Channel using POST https://graph.microsoft.com/beta/teams/${teamId}/channels
new tab using POST https://graph.microsoft.com/beta/teams/${req.teamId}/channels/${req.channelId}/tabs
I can see new channel and tab in Teams UI
trying to create new conversation via Conversations.createConversation from bot sdk, it's basically calling POST https://directline.botframework.com/v3/conversations with passing new channel id and getting 405 BadArgument This channel does not support this operation
I'm running bot locally and proxying via ngrok.
Also I can access GET /v3/conversations.
Updated code
Get Team Memebers GET ${graphUrl}/groups/${teamId}/members
Create new Channel
const createChannelRequest: IGraphCreateChannelBody = {
"#odata.type": "#Microsoft.Teams.Core.channel",
displayName: channelName,
description: `This channel is for incident id : ${incidentId}`,
members: membersIds.map(memberId => (
{
"#odata.type": "#microsoft.graph.aadUserConversationMember",
"user#odata.bind": `https://graph.microsoft.com/beta/users('${memberId}')`,
roles: ["owner"]
}
))
};
return await graphClient.createChannel(teamId, createChannelRequest);
createChannel is basically POST ${graphUrl}/teams/${teamId}/channels
Create new Tab POST ${graphUrl}/teams/${req.teamId}/channels/${req.channelId}/tabs where channelId is createChannelResponse.id
Create new conversation
const client = new BotConnector.ConnectorClient(credentials, {baseUri: serviceUrl});
const {bot} = TurnContext.getConversationReference(activity);
const createConversationResponse = await client.conversations.createConversation({
bot,
activity: incidentActivity,
members: teamMembers.value.map(member => ({
id: member.id,
name: member.displayName
})),
channelData: {
channel: {
id: newIncidentChannelId
},
tenant: {
id: tenantId
}
},
isGroup: true
});
where createConversation fails with 405
[Posting a complete answer, based on the comments above]
There's no need (and it won't work), in the context of Teams, to use createConversation, because the conversation is created the moment the Team/Channel/Group chat itself is created (createConversation exists for other Bot Framework scenarios, and is not applicable for Teams). As a result SendToConversation is the correct operation to use.
As to how to use SendToConversation, there are certain important variables you need to have already your side, and the most common time to get these is when your bot is added to the channel/chat/whatever in the first place. You can read more about that here, but more generally, this is considered something called "proactive" messaging, in Teams, and it's worth reading up on that topic more. Please see here and here as good starting points.

cannot load URL (HTML page) using task module for microsoft teams app (node js)

I am trying to show a popup message to user using the task module. I have sent a attachment with type invoke. Here is the code
content.sendActivity(MessageFactory.attachment(CardFactory.heroCard('Task Module Invocation from Hero Card',
'This is a hero card with a Task Module Action button',
null, // No images
[{ type: 'invoke', title: 'Task Module', value: { type: 'task/fetch' } }])));
When I click on the Button I have received a request to my messaging end point and the response I have sent is
reply({
task: {
type: 'continue',
value: {
"title": "Task module title",
"height": 'large',
"width": 'large',
"url": "https://67aa9b57.ngrok.io/api/internal/teams/tabs/content",
"fallbackUrl": "https://67aa9b57.ngrok.io/api/internal/teams/tabs/content"
}
}
});
But in the popup message is blank. My ngrok url is not even being hit for the HTML page. This is what I see in popup. But the title was updated. I have no idea why it is not working.
Ant help would be thankful
This is pretty much always caused by the domain of the page not being listed in the valid domains for the application (you set this in your manifest json file, inside App Studio if you're using it). Because you've not listed this as a valid and "safe" domain, Teams won't even make any call at all, that's why there's nothing visible in the NGrok log even.
Just to be clear, we're talking about this section of the schema.

Show search option in Applozic conversatin tab

I am using applozic sidebar plugin with following code.
window.applozic.init({appId: applozicApplicationKey,
userId: currentUser.userId,
userName: displayName,
imageLink : userImage,
email : currentUser.emailId,
contactNumber: '',
desktopNotification: true,
notificationIconLink: 'assets/images/vw-purple-logo-sm.png'
});
And opening chat box with code
$applozic.fn.applozic('loadTab', '');
I want to show search option in conversation tab rather than contact list.
How to achieve this?

Cannot fire Bigcommerce webhooks

so far I've managed to create two webhooks by using their official gem (https://github.com/bigcommerce/bigcommerce-api-ruby) with the following events:
store/order/statusUpdated
store/app/uninstalled
The destination URL is a localhost tunnel managed by ngrok (the https) version.
status_update_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/order/statusUpdated', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
uninstall_hook = Bigcommerce::Webhook.create(connection: connection, headers: { is_active: true }, scope: 'store/app/uninstalled', destination: 'https://myapp.ngrok.io/bigcommerce/notifications')
The webhooks seems to be active and correctly created as I can retrieve and list them.
Bigcommerce::Webhook.all(connection:connection)
I manually created an order in my store dashboard but no matter to which state or how many states I change it, no notification is fired. Am I missing something?
The exception that I'm seeing in the logs is:
ExceptionMessage: true is not a valid header value
The "is-active" flag should be sent as part of the request body--your headers, if you choose to include them, would be an arbitrary key value pair that you can check at runtime to verify the hook's origin.
Here's an example request body:
{
"scope": "store/order/*",
"headers": {
"X-Custom-Auth-Header": "{secret_auth_password}"
},
"destination": "https://app.example.com/orders",
"is_active": true
}
Hope this helps!

Parse Server Mail gun adapter installation

First off, I am running Parse Server on AWS Elastic Beanstalk.
I see this documentation in the readme file
##### Email verification and password reset
Verifying user email addresses and enabling password reset via email requries an email adapter. As part of the `parse-server` package we provide an adapter for sending email through Mailgun. To use it, sign up for Mailgun, and add this to your initialization code:
```js
var server = ParseServer({
...otherOptions,
// Enable email verification
verifyUserEmails: true,
// set preventLoginWithUnverifiedEmail to false to allow user to login without verifying their email
// set preventLoginWithUnverifiedEmail to true to prevent user from login if their email is not verified
preventLoginWithUnverifiedEmail: false, // defaults to false
// The public URL of your app.
// This will appear in the link that is used to verify email addresses and reset passwords.
// Set the mount path as it is in serverURL
publicServerURL: 'https://example.com/parse',
// Your apps name. This will appear in the subject and body of the emails that are sent.
appName: 'Parse App',
// The email adapter
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
}
});
This doesn't say enough for me though. I am not using an existing express website and I need to know where in the repository to add the mailgun code.
I already have mailgun and have used it in php and I am using this explicitly to reset user passwords.
so again, What file in my parse server folder do I need to add the mailgun adapter?
This is my file structure. If I am being unclear, let me know...
This is where I am at now as far as adding it in. Is this right? My mailgun creds are not in there yet, but I know to do that.
class ParseServer {
constructor({
appId = requiredParameter('You must provide an appId!'),
masterKey = requiredParameter('You must provide a masterKey!'),
appName,
filesAdapter,
push,
loggerAdapter,
logsFolder,
databaseURI,
databaseOptions,
databaseAdapter,
cloud,
collectionPrefix = '',
clientKey,
javascriptKey,
dotNetKey,
restAPIKey,
webhookKey,
fileKey = undefined,
facebookAppIds = [],
enableAnonymousUsers = true,
allowClientClassCreation = true,
oauth = {},
serverURL = requiredParameter('You must provide a serverURL!'),
maxUploadSize = '20mb',
verifyUserEmails = true,
preventLoginWithUnverifiedEmail = false,
cacheAdapter,
emailAdapter: {
module: 'parse-server-simple-mailgun-adapter',
options: {
// The address that your emails come from
fromAddress: 'parse#example.com',
// Your domain from mailgun.com
domain: 'example.com',
// Your API key from mailgun.com
apiKey: 'key-mykey',
}
},
publicServerURL,
customPages = {
invalidLink: undefined,
verifyEmailSuccess: undefined,
choosePassword: undefined,
passwordResetSuccess: undefined
},
parse-server include the mailgun-js module by default so you can use it without any dependency. What you need to do in order to use it is the following:
Create mailgun account and get an ApiKey from there
Include the mail gun simple adapter exactly like how it is included in the code that you provided and just change the values to the relevant values
please notice that the adapter that you add above is only for email verification and password reset. If you want the ability to send an email (e.g. marketing emails, engagement etc.) you can create a cloud code function there you will need to require the mailgun-js module and use the mailgun-js module to send the email exactly like how it is described in here
Then from your client code you will need to trigger this cloud code function and the email will be sent.

Resources