This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Azure.AI.OpenAI; | |
| using Azure; | |
| using OpenAI.Chat; | |
| using System.Text.Json; | |
| namespace OpenAI.SDK.Test | |
| { | |
| internal class Program | |
| { | |
| static async Task Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import styles from './HelloTeams.module.scss'; | |
| import { IHelloTeamsProps } from './IHelloTeamsProps'; | |
| import { useEffect, useState } from 'react'; | |
| const HelloTeams: React.FunctionComponent<IHelloTeamsProps> = (props: IHelloTeamsProps) => { | |
| const [themeState, setThemeState] = useState<string>(props.teamsTheme || "default"); | |
| const [styleState, setStyleState] = useState<string>(styles.containerdefault); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [styleState, setStyleState] = useState<string>(styles.containerdefault); | |
| //Run anytime the themeState changes. | |
| useEffect(() => { | |
| console.log("themeState useEffect fired"); | |
| switch (themeState) { | |
| case "dark": | |
| setStyleState(styles.containerdark); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [themeState, setThemeState] = useState<string>(props.teamsTheme || "default"); | |
| //Run effect once when the component loads. We will use this effect to register our Theme Changed handler. | |
| useEffect(() => { | |
| console.log("registerOnThemeChangeHandler useEffect fired"); | |
| props.context.sdks.microsoftTeams.teamsJs.registerOnThemeChangeHandler((theme: string) => { | |
| console.log(`theme changed to: ${theme}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| this.context.sdks.microsoftTeams.context.theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $PnPO365ManagementAppId = "31359c7f-bd7e-475c-86db-fdb8c937548e" | |
| az ad sp create --id $PnPO365ManagementAppId | |
| az ad app permission grant --id $PnPO365ManagementAppId --api 00000003-0000-0000-c000-000000000000 --scope AppCatalog.ReadWrite.All |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://login.microsoftonline.com/organizations/v2.0/adminconsent?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&scope=https://graph.microsoft.com/AppCatalog.ReadWrite.All |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Bot.Builder; | |
| using Microsoft.Bot.Connector; | |
| using Microsoft.Bot.Connector.Authentication; | |
| using Microsoft.Bot.Schema; | |
| using Microsoft.Bot.Schema.Teams; | |
| using Newtonsoft.Json.Linq; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Bot.Builder; | |
| using Microsoft.Bot.Connector; | |
| using Microsoft.Bot.Connector.Authentication; | |
| using Microsoft.Bot.Schema; | |
| using Microsoft.Bot.Schema.Teams; | |
| using Newtonsoft.Json.Linq; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.Bot.Builder; | |
| using Microsoft.Bot.Connector; | |
| using Microsoft.Bot.Connector.Authentication; | |
| using Microsoft.Bot.Schema; | |
| using Microsoft.Bot.Schema.Teams; | |
| using System; | |
| using System.Threading.Tasks; | |
| namespace Teams.Bot.Conversations | |
| { |