Skip to content

Instantly share code, notes, and snippets.

@whatsmate
whatsmate / send-telegram-mp3.cs
Created July 21, 2022 06:44
How to send an audio file to a Telegram user in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class TelegramMp3Sender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-telegram-pdf.cs
Created July 21, 2022 06:36
How to send a PDF file to a Telegram user in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class TelegramPdfSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-telegram-image.cs
Created July 21, 2022 06:29
How to send an image to a Telegram user in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class TelegramImageSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-telegram-text.cs
Created July 21, 2022 05:01
How to send Telegram Messages in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class TelegramMessageSender
{
// TODO: Replace the following with your gateway instance ID, Premium Account client ID and secret:
private static string INSTANCE_ID = "YOUR_INSTANCE_ID_HERE";
@whatsmate
whatsmate / send-pdf-group.cs
Last active April 17, 2024 06:28
How to send a PDF file to a WhatsApp group in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaPdfGroupSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-image-group.cs
Created July 19, 2022 07:56
How to send an image to a WhatsApp group in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaImageGroupSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-text-group.cs
Last active February 13, 2026 13:43
How to send messages to a WhatsApp group in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaTextGroupSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-pdf-individual.cs
Last active April 15, 2024 09:48
How to send a PDF file to a WhatsApp user in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaPdfSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-image-individual.cs
Created July 19, 2022 07:21
How to send an image to a WhatsApp user in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaImageSender
{
// TODO: Replace the following with your gateway instance ID, client ID and secret!
private static string INSTANCE_ID = "YOUR_INSTANCE_ID";
@whatsmate
whatsmate / send-text-individual.cs
Created July 19, 2022 07:11
How to send WhatsApp Messages in C# using Visual Studio 2022
using System;
using System.Net;
using System.Text.Json;
using System.IO;
using System.Text;
class WaMessageSender
{
// TODO: Replace the following with your gateway instance ID, Forever Green client ID and secret:
private static string INSTANCE_ID = "YOUR_INSTANCE_ID_HERE";