-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
import environment from '@/environment'; | ||
import { Message } from "discord.js"; | ||
import { keyv } from "@/utils"; | ||
//import { keyv } from "@/utils"; | ||
|
||
const TelegramBot = require( 'node-telegram-bot-api' ); | ||
|
||
const token = process.env.TELEGRAM_BOT_TOKEN; | ||
|
||
const botConfig = { | ||
polling: true | ||
} | ||
|
||
export const bot = new TelegramBot( token, botConfig ); | ||
export const bot = new TelegramBot( environment.telegram_bot_token, botConfig ); | ||
|
||
export async function sendMessage( msg: Message ) { | ||
const channelId = keyv( 'exams' ).get( 'channel_id' ); | ||
const completeMessage = 'Eine neue Anfrage wurde auf dem Discord Server registriert:\n\n' + msg; | ||
bot.sendMessage( channelId, completeMessage ); | ||
} | ||
const completeMessage = 'Eine neue Anfrage wurde auf dem Discord Server registriert:\n\n' + msg.cleanContent; | ||
bot.sendMessage( environment.telegram_feed_id, completeMessage ); | ||
} |