Skip to content

An anime pics bot for Telegram, written on С# using .NET 7, taking data from Booru-websites and Reddit.

License

Notifications You must be signed in to change notification settings

Rasmus715/owobot-csharp

 
 

Repository files navigation

owobot-csharp

example branch parameter CodeFactor
An anime pics bot for Telegram, written on C# using .NET 7, taking data from Booru sites and Reddit.
Бот для Telegram, присылающий аниме девочек, написанный на C# с использованием .NET 7, берущий данные с Booru-сайтов и Reddit.

Features

  • Parallel requests processing
  • Preventing timeout errors
  • User related NSFW settings
  • User related language settings (English and Russian)
  • Can answer on owo and uwu

How to use:

  1. Go to @owopics_junior_bot and just use the bot!

If for some reason you want to run it by yourself:

Parameters description

  • BOT_VERSION - sets up bot version
  • TELEGRAM_TOKEN - bot token retrieved by BotFather
  • REDDIT_APP_ID (Optional), REDDIT_SECRET (Optional), REDDIT_REFRESH_TOKEN (Optional) - data provided by Reddit API. Be aware that if you want to use reddit functions, all three fields should be present.
  • PROXY (Optional) - supports 2 values: HTTP, SOCKS5 depending of the protocol you about to use. If PROXY field is filled, the ones below should be present too.
  • PROXY_ADDRESS - If PROXY field is equal toHTTP then the address should accord to this format: https://example.org. If PROXY equals SOCKS5, address should accord to the next format: socks5://127.0.0.1
  • PROXY_PORT - port of your proxy server
  • PROXY_USERNAME, PROXY_PASSWORD (Optional) - credentials of your proxy server

Native execution

  1. Clone code somewhere
  2. Install .NET 7 SDK and paste the next command into the shell, filling parameters with your own values
BOT_VERSION= TELEGRAM_TOKEN= REDDIT_APP_ID= REDDIT_SECRET= REDDIT_REFRESH_TOKEN= PROXY= PROXY_ADDRESS= PROXY_USERNAME= PROXY_PASSWORD= dotnet run

docker-compose way

   owobot:
      image: etozherasmus/owobot-csharp:latest
      volumes:
        - .Esseintials/:/app/Essentials
      environment:
        - BOT_VERSION=v0.1
        - TELEGRAM_TOKEN=
        - REDDIT_APP_ID= //Optional
        - REDDIT_SECRET= //Optional
        - REDDIT_REFRESH_TOKEN= //Optional
        - PROXY= //Optional
        - PROXY_ADDRESS= //Optional
        - PROXY_USERNAME= //Optional
        - PROXY_PASSWORD= //Optional

docker CLI way

docker run -d \
  -e BOT_VERSION=v0.1 \
  -e TELEGRAM_TOKEN= \
  -e REDDIT_APP_ID= \
  -e REDDIT_SECRET= \
  -e REDDIT_REFRESH_TOKEN= \
  -e PROXY= \
  -e PROXY_ADDRESS= \
  -e PROXY_USERNAME= \
  -e PROXY_PASSWORD= \
  -v "Essentials:/app/Essentials" \
  etozherasmus/owobot-csharp

Reason of choosing some questionable solutions

First of all, I'm a C# newbie.
The whole idea of this project was to learn how to work with Telegram, Reddit client libraries aswell of how to set up EF Core in console application and use local database.

TODO:

  1. Add external, user-friendly configuration. Done.
  2. Add chats compatibility. Done. Needs additional testing
  3. Push docker image to dockerhub. Done.
  4. Add more sources (such as yande.re, konachan) Done.

P.S. The reddit API is a slow mess and using /random command will always give you pics from booru boards.
To use reddit exclusively, proceed with /random_reddit

About

An anime pics bot for Telegram, written on С# using .NET 7, taking data from Booru-websites and Reddit.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.1%
  • Dockerfile 0.9%