Skip to content
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

Cleanthat #5

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .cleanthat/cleanthat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
syntax_version: "2023-01-09"
meta:
labels:
- "cleanthat"
refs:
protected_patterns:
- "refs/heads/develop"
- "refs/heads/main"
- "refs/heads/master"
full_clean_on_configuration_change: false
can_edit_not_protected_branches: true
source_code:
encoding: "UTF-8"
line_ending: "GIT"
engines:
- engine: "spotless"
skip: false
source_code: {}
steps:
- id: "spotless"
skip: false
parameters:
configuration: "repository:/.cleanthat/spotless.yaml"
26 changes: 26 additions & 0 deletions .cleanthat/spotless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax_version: "2023-01-09"
encoding: "UTF-8"
git:
core_eol: "native"
line_ending: "GIT_ATTRIBUTES"
formatters:
- format: "json"
steps:
- id: "jackson"
skip: false
parameters:
features:
ORDER_MAP_ENTRIES_BY_KEYS: true
yaml_features:
QUOTE_FIELD_NAMES: false
- format: "markdown"
steps:
- id: "flexmark"
skip: false
parameters:
version: "0.62.2"
- id: "freshmark"
skip: false
parameters:
properties:
k1: "v1"
4 changes: 4 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version = 1

[[analyzers]]
name = "csharp"
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "Telegram.Bot"]
path = Telegram.Bot
url = https://github.com/dgmjr-io/Telegram.Bot.git
[submodule "lib/Telegram.Bot"]
path = lib/Telegram.Bot
url = https://github.com/dgmjr-io/Telegram.Bot.git
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---

title: Telegram
description: This package contains classes for talking to the Telegram APIs.
date: 2023-01-09T18:57:29.297Z
lastmod: 2023-04-12T10:49:39.467Z
type: readme
tags:
- telegram
- Dgmjr
- telegram
- DGMJR-IO
slug: telegram
---
--------------

# Telegram

Expand Down
37 changes: 19 additions & 18 deletions src/Bot.Extensions/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-01-17-12:35:43
created: 2023-01-17-12:35:43
license: MIT
keywords:
- Dgmjr
tags:
- Dgmjr
categories:
- Dgmjr
---

# Telegram Bot Extensions

This library provides a set of extensions for the [Telegram.Bot](https://github.com/TelegramBots/Telegram.Bot) library.
---

author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-01-17-12:35:43
created: 2023-01-17-12:35:43
license: MIT
keywords:
- DGMJR-IO
tags:
- DGMJR-IO
categories:
- DGMJR-IO
----------

# Telegram Bot Extensions

This library provides a set of extensions for the [Telegram.Bot](https://github.com/TelegramBots/Telegram.Bot) library.
26 changes: 21 additions & 5 deletions src/Constants/DatabaseConstants.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
/*
* DatabaseConstants.cs
*
*
* Created: 2023-03-23-08:42:48
* Modified: 2023-03-23-11:04:32
*
*
* Author: David G. Moore, Jr. <[email protected]>
*
*
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
*/
Expand All @@ -20,9 +20,25 @@ public static class SchemaNames

public static class TableNames
{
/// <summary>
/// The prefix for tables, <inheritdoc cref="tbl_" path="/value" />
/// </summary>
/// <value>tbl_</value>
private const string tbl_ = nameof(tbl_);
/// <summary>
/// The table name for Bots, <inheritdoc cref="Bot" path="/value" />
/// </summary>
/// <value><inheritdoc cref="tbl_" path="/value" />Bot</value>
public const string Bot = tbl_ + nameof(Bot);
/// <summary>
/// The table name for Groups, <inheritdoc cref="Group" path="/value" />
/// </summary>
/// <value><inheritdoc cref="tbl_" path="/value" />Group</value>
public const string Group = tbl_ + nameof(Group);
/// <summary>
/// The table name for Channels, <inheritdoc cref="Channel" path="/value" />
/// </summary>
/// <value><inheritdoc cref="tbl_" path="/value" />Channel</value>
public const string Channel = tbl_ + nameof(Channel);
}

Expand All @@ -31,7 +47,7 @@ public static class ColumnNames
{
public static class Bot
{
public const string Id = "TelegramId";
public const string Id = "Id";
public const string Name = nameof(Name);
public const string TelegramUsername = nameof(TelegramUsername);
public const string SendPulseId = nameof(SendPulseId);
Expand Down
41 changes: 21 additions & 20 deletions src/Constants/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---
title: Telegram Constants
lastmod: 2023-03-23-11:06:58
created: 2023-03-23-11:06:58
license: MIT
tags:
- dgmjr
- telegram
categories:
- dgmjr
- readme
type: readme
slug: telegram-constants
project: Telegram
lastMod: 2023-03-24T10:45:25.122Z
---

# Telegram Constants

This package contains constants for the Telegram API and usage of it.
---

title: Telegram Constants
lastmod: 2023-03-23-11:06:58
created: 2023-03-23-11:06:58
license: MIT
tags:
- DGMJR-IO
- telegram
categories:
- DGMJR-IO
- readme
type: readme
slug: telegram-constants
project: Telegram
lastMod: 2023-03-24T10:45:25.122Z
---------------------------------

# Telegram Constants

This package contains constants for the Telegram API and usage of it.
6 changes: 3 additions & 3 deletions src/Constants/Telegram.Constants.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!--
* Telegram.Constants.csproj
*
*
* Created: 2022-12-19-07:46:56
* Modified: 2022-12-19-07:46:56
*
*
* Author: David G. Moore, Jr. <[email protected]>
*
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->
Expand Down
17 changes: 17 additions & 0 deletions src/Constants/Telegram.Constants.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
* Telegram.Constants.csproj
*
* Created: 2022-12-19-07:46:56
* Modified: 2022-12-19-07:46:56
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
-->

<Project>
<ItemGroup>
<Using Remove="@(Using->WithMetadataValue('Alias', 'bigint'))" />
</ItemGroup>
</Project>
36 changes: 19 additions & 17 deletions src/EntityFrameworkCore/Abstractions/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-03-23-09:48:24
created: 2023-03-23-09:48:23
license: MIT
tags:
- dgmjr
- efcore
- abstractions
categories:
- dgmjr
- abstractions
---

# # Telegram Abstractions for Entity Framework Core
---

author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-03-23-09:48:24
created: 2023-03-23-09:48:23
license: MIT
tags:
- DGMJR-IO
- efcore
- abstractions
categories:
- DGMJR-IO
- abstractions
--------------

# # Telegram Abstractions for Entity Framework Core

44 changes: 16 additions & 28 deletions src/EntityFrameworkCore/Models/Bot.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
using System.Linq;
using System.Net.Http.Headers;
/*
* Bot.cs
*
* Created: 2023-03-19-03:05:09
* Modified: 2023-03-25-03:14:09
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
*/

/*
* Bot.cs
*
* Created: 2022-12-03-07:51:18
* Modified: 2022-12-03-07:51:18
* Created: 2023-03-19-02:05:09
* Modified: 2023-05-29-07:03:56
*
* Author: David G. Moore, Jr. <[email protected]>
*
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved
* License: MIT (https://opensource.org/licenses/MIT)
*/

namespace Telegram.Models;
using System.Linq;
using System.Net.Http.Headers;
using System.Collections.ObjectModel;
using global::Telegram.Bot.Types;
using Telegram.Abstractions;
Expand All @@ -41,23 +29,23 @@ public class Bot : Dgmjr.Identity.Models.User
public class MyBot : Bot
{
public virtual BotApiToken ApiToken { get; set; }
public virtual UserClaim BotApiTokenClaim { get => this.Claims.FirstOrDefault(c -> c.Type == BotClaimTypes.BotApiToken); }
public virtual UserClaim BotApiTokenClaim { get => this.Claims.FirstOrDefault(c->c.Type == BotClaimTypes.BotApiToken); }
}

public class SendPulseBot : MyBot
{
public virtual ObjectId SendPulseId { get; set; }
public virtual UserClaim SendPulseIdClaim
public virtual UserClaim SendPulseIdClaim
{
get => this.Claims.FirstOrDefault(c => c.Type == SendPulse.Identity.ClaimTypeNames.ObjectId);
set
{
if (this.SendPulseIdClaim != null)
{
this.Claims.Remove(this.SendPulseIdClaim);
}
this.Claims.Add(value);
}
get => this.Claims.FirstOrDefault(c => c.Type == SendPulse.Identity.ClaimTypeNames.ObjectId);
set
{
if (this.SendPulseIdClaim != null)
{
this.Claims.Remove(this.SendPulseIdClaim);
}
this.Claims.Add(value);
}
}
}

Expand Down
34 changes: 18 additions & 16 deletions src/EntityFrameworkCore/Models/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-03-23-09:46:46
created: 2023-03-23-09:09:58
license: MIT
tags:
- dgmjr
- models
categories:
- dgmjr
- models
---

# Telegram Models for Entity Framework Core
---

author: David G. Moore, Jr.
author_email: [email protected]
title: README.md
lastmod: 2023-03-23-09:46:46
created: 2023-03-23-09:09:58
license: MIT
tags:
- DGMJR-IO
- models
categories:
- DGMJR-IO
- models
--------

# Telegram Models for Entity Framework Core

Loading