Code Monkey home page Code Monkey logo

discord-to-telegram's Introduction

Discord-to-Telegram

Program that forwards messages from Discord server channels to Telegram channels. Uses Discord.Net, Telegram.Bot, Telegram.Extensions.Polling packages

In order for the program to work, you need to:

  1. Add your Discord bot to the server with channels you want to forward
  2. Add your Telegram bot to the channels where you want to receive Discord messages
  3. Specify the Discord and Telegram bot tokens in the Program/BotTokens/DiscordBotToken.txt and Program/BotTokens/TelegramBotToken.txt
  4. Specify the names of the source and destination chats in in the Program/ForwardOptions.txt file the following way:
(source chat a, source chat b)(destination chat 1, destination chat 2)

(source chat a, etc)(destination chat c, etc)

One line represents the source chats (in the first brackets) in which messages will be copied to the destination chats (in the second brackets). You can specify only a part of the chat name, but the inaccuracy can lead to the program choosing the wrong chat if the bot has chats with similar names. The file may contain any number of such lines, but repeating one destination for the same source can result in repeated messages.

  1. Execute the Program.cs file

discord-to-telegram's People

Contributors

danilmoh avatar

Stargazers

 avatar Bristhis avatar  avatar Media Explorer avatar  avatar  avatar Le Gia Hoang avatar

Watchers

Archetype avatar  avatar

discord-to-telegram's Issues

I have an error

When i running code i have this error:

/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(20,12): warning CS8618: Non-nullable field 'client' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(20,12): warning CS8618: Non-nullable field 'cts' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/DiscordBot.cs(19,12): warning CS8618: Non-nullable field 'client' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Data/Services/MessagesLoader.cs(26,62): warning CS8604: Possible null reference argument for parameter 'messagesList' in 'Dictionary<KeyValuePair<Chat, Chat>, Dictionary<Message, Message>> MessagesMapListConverter.ConvertToMap(List<KeyValuePair<KeyValuePair<Chat, Chat>, List<KeyValuePair<Message, Message>>>> messagesList)'. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Data/Services/MessagesLoader.cs(35,9): warning CS0162: Unreachable code detected [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/DiscordBot.cs(58,37): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/DiscordBot.cs(50,24): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(70,57): warning CS8602: Dereference of a possibly null reference. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(68,41): warning CS8602: Dereference of a possibly null reference. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(68,41): warning CS8602: Dereference of a possibly null reference. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(97,45): warning CS8602: Dereference of a possibly null reference. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(208,55): warning CS8604: Possible null reference argument for parameter 'name' in 'Chat.Chat(decimal id, string name)'. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
/home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs(201,16): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. [/home/runner/UnderstatedRichProspect/Discord-To-Telegram-Program.csproj]
Unhandled exception. System.IO.FileNotFoundException: Message file not found!
at DiscordToTelegram.Data.Services.MessagesLoader.Load(String path) in /home/runner/UnderstatedRichProspect/Data/Services/MessagesLoader.cs:line 13
at DiscordToTelegram.Data.Services.MessagesLoader.Load() in /home/runner/UnderstatedRichProspect/Data/Services/MessagesLoader.cs:line 41
at DiscordToTelegram.Bots.TelegramBot..ctor() in /home/runner/UnderstatedRichProspect/Bots/TelegramBot.cs:line 23
at DiscordToTelegram.Program.Main(String[] args) in /home/runner/UnderstatedRichProspect/Program.cs:line 8
at DiscordToTelegram.Program.

(String[] args)

Error Compiling

Hello there,

This still active? Getting following error trying to compile it.

Program.cs(3,27): error CS1525: Unexpected symbol `;'
Program.cs(4,6): error CS1514: Unexpected symbol `public', expecting `.' or `{'
Compilation failed: 2 error(s), 0 warnings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.