Skip to content

Commit

Permalink
Some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz0u committed Jun 30, 2024
1 parent ba20cf5 commit 850cd6a
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions FSharp.Example/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling
namespace FSharp.Example

open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Hosting

open Telegram.Bot

open FSharp.Examples.Polling.Services
open FSharp.Example.Services

type ReceiverSvc = ReceiverService<UpdateHandler>

Expand Down
2 changes: 1 addition & 1 deletion FSharp.Example/Services/Internal/IReceiverService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling.Services.Internal
namespace FSharp.Example.Services.Internal

open System.Threading
open System.Threading.Tasks
Expand Down
4 changes: 2 additions & 2 deletions FSharp.Example/Services/Internal/UpdateHandlerFuncs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling.Services.Internal
namespace FSharp.Example.Services.Internal

open System
open System.IO
Expand All @@ -22,7 +22,7 @@ open Telegram.Bot.Types.Enums
open Telegram.Bot.Types.InlineQueryResults
open Telegram.Bot.Types.ReplyMarkups

open FSharp.Examples.Polling.Util
open FSharp.Example.Util

module UpdateHandlerFuncs =
module private BotTextMessages =
Expand Down
8 changes: 4 additions & 4 deletions FSharp.Example/Services/PollingService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//
// This file simply forms that "link" between the .NET
// class to the actual service functions implemented in
// FSharp.Examples.Polling.Services.Internal.PollingServiceFuncs
// FSharp.Example.Services.Internal.PollingServiceFuncs
//
// Copyright (c) 2023 Arvind Devarajan
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling.Services
namespace FSharp.Example.Services

open System
open System.Threading
Expand All @@ -20,8 +20,8 @@ open Microsoft.Extensions.DependencyInjection
open Microsoft.Extensions.Logging
open Microsoft.Extensions.Hosting

open FSharp.Examples.Polling.Services.Internal
open FSharp.Examples.Polling.Util
open FSharp.Example.Services.Internal
open FSharp.Example.Util

type PollingService<'T when 'T:> IReceiverService>(sp: IServiceProvider, logger: ILogger<PollingService<'T>>) =
inherit BackgroundService()
Expand Down
6 changes: 3 additions & 3 deletions FSharp.Example/Services/ReceiverService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Copyright (c) 2023 Arvind Devarajan
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.
namespace FSharp.Examples.Polling.Services
namespace FSharp.Example.Services

open System.Threading
open System.Threading.Tasks
Expand All @@ -16,9 +16,9 @@ open Telegram.Bot.Polling
open Telegram.Bot.Types
open Telegram.Bot

open FSharp.Examples.Polling.Services.Internal
open FSharp.Example.Services.Internal

open FSharp.Examples.Polling.Util
open FSharp.Example.Util

type ReceiverService<'T when 'T :> IUpdateHandler>(botClient: ITelegramBotClient, updateHandler: UpdateHandler, logger: ILogger<'T>) =
interface IReceiverService with
Expand Down
6 changes: 3 additions & 3 deletions FSharp.Example/Services/UpdateHandler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
// This file simply forms that "link" between the .NET
// class to the actual implementation of the handlers
// as seen in the module
// FSharp.Examples.Polling.Services.Internal.UpdateHandlerFuncs
// FSharp.Example.Services.Internal.UpdateHandlerFuncs
//
// Copyright (c) 2023 Arvind Devarajan
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling.Services
namespace FSharp.Example.Services

open System
open System.Threading
open Microsoft.Extensions.Logging
open Telegram.Bot
open Telegram.Bot.Polling

open FSharp.Examples.Polling.Services.Internal
open FSharp.Example.Services.Internal

type UpdateHandler(botClient: ITelegramBotClient, logger: ILogger<UpdateHandler>) =
interface IUpdateHandler with
Expand Down
2 changes: 1 addition & 1 deletion FSharp.Example/Util.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Licensed to you under the MIT License.
// See the LICENSE file in the project root for more information.

namespace FSharp.Examples.Polling
namespace FSharp.Example

open System.Threading
open System.Threading.Tasks
Expand Down
2 changes: 1 addition & 1 deletion InlineQueries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and the bot may tell which article was selected.

## Prerequisites

* Same as Telegram.Bot.Examples.Polling.
* .NET 6 and Telegram.Bot v21.3
* You need to set your bot token in the `TOKEN` environment variable *(in launchSettings.json or via Project Properties > Debug > General)*
* You need to enable "**Inline mode on**" in BotFather for this bot to work.
* If you want the bot to tell which article was selected by the user, you need to enable "**Inline feedback**" (for example: 100%)
8 changes: 4 additions & 4 deletions Serverless/AwsLambda.Webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Original sample: https://github.com/awsdocs/aws-lambda-developer-guide/

![Architecture](/Telegram.Bot.Examples.AwsLambda.WebHook/images/sample-blank-csharp.png)
![Architecture](images/sample-blank-csharp.png)

The project source includes function code and supporting resources:

Expand Down Expand Up @@ -64,18 +64,18 @@ Let the script invoke the function a few times and then press `CRTL+C` to exit.

The application uses AWS X-Ray to trace requests. Open the [X-Ray console](https://console.aws.amazon.com/xray/home#/service-map) to view the service map. The following service map shows the function managing spot instances in Amazon EC2.

![Service Map](/Telegram.Bot.Examples.AwsLambda.WebHook/images/blank-csharp-servicemap.png)
![Service Map](images/blank-csharp-servicemap.png)

Choose a node in the main function graph. Then choose **View traces** to see a list of traces. Choose any trace to view a timeline that breaks down the work done by the function.

![Trace](/Telegram.Bot.Examples.AwsLambda.WebHook/images/blank-csharp-trace.png)
![Trace](images/blank-csharp-trace.png)

# Cleanup
To delete the application, run the cleanup script.

blank-csharp$ ./4-cleanup.sh

# Telegram Bot WebHook AWS Lambda example
# Telegram Bot Webhook AWS Lambda example

Replace `<token>` with your bot token in sources.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Telegram.Bot;
using Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.WebHook;
using Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.Webhook;

var tgToken = Environment.GetEnvironmentVariable("TELEGRAM_BOT_TOKEN", EnvironmentVariableTarget.Process)
?? throw new ArgumentException("Can not get token. Set token in environment setting");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Telegram.Bot.Serialization;
using Telegram.Bot.Types;

namespace Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.WebHook;
namespace Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.Webhook;

public class TelegramBot
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Logging;
using Telegram.Bot.Types;

namespace Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.WebHook;
namespace Telegram.Bot.Examples.AzureFunctions.IsolatedProcess.Webhook;

public class UpdateService
{
Expand Down
4 changes: 2 additions & 2 deletions Serverless/AzureFunctions.Webhook/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

[assembly: FunctionsStartup(typeof(Telegram.Bot.Examples.AzureFunctions.WebHook.Startup))]
[assembly: FunctionsStartup(typeof(Telegram.Bot.Examples.AzureFunctions.Webhook.Startup))]

namespace Telegram.Bot.Examples.AzureFunctions.WebHook;
namespace Telegram.Bot.Examples.AzureFunctions.Webhook;

public class Startup : FunctionsStartup
{
Expand Down
2 changes: 1 addition & 1 deletion Serverless/AzureFunctions.Webhook/TelegramBotFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Telegram.Bot.Serialization;
using Telegram.Bot.Types;

namespace Telegram.Bot.Examples.AzureFunctions.WebHook;
namespace Telegram.Bot.Examples.AzureFunctions.Webhook;

public class TelegramBotFunction
{
Expand Down
2 changes: 1 addition & 1 deletion Serverless/AzureFunctions.Webhook/UpdateService.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Logging;
using Telegram.Bot.Types;

namespace Telegram.Bot.Examples.AzureFunctions.WebHook;
namespace Telegram.Bot.Examples.AzureFunctions.Webhook;

public class UpdateService
{
Expand Down
2 changes: 1 addition & 1 deletion Webhook.Controllers/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma warning disable CA1050 // Declare types in namespaces
#pragma warning disable RCS1110 // Declare types in namespaces
public static class WebHookExtensions
public static class WebhookExtensions
#pragma warning restore RCS1110 // Declare types in namespaces
#pragma warning restore CA1050 // Declare types in namespaces
{
Expand Down

0 comments on commit 850cd6a

Please sign in to comment.