-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
featnfix: env variables and donation feature
- optimizing environment variables, now env values is centrally stored on .env file, documented and able to be used on env.ts - adding new feature/command : donation - deactivating TikTok, Instagram downloader, and Gemini. Awaiting for next migration to capable hardware - refining some information on bot-info command and on main README
- Loading branch information
Showing
12 changed files
with
112 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
IMGBB_KEY = 'api-key-of-imgbb' | ||
|
||
GHOLA_TOKEN = 'put-ghola-token-here' | ||
GHOLA_EMAIL = 'put-associated-ghola-email-here' | ||
GHOLA_AI_PROFILE_ID = 'put-ghola-ai-profile-id-here' | ||
GHOLA_AI_PROFILE_ID = 'put-ghola-ai-profile-id-here' | ||
|
||
BOT_NAME = 'Sora Erlyana' | ||
BOT_SHORT_NAME = 'Sora' | ||
BOT_CODE_NAME = 'SoraErlyana' | ||
|
||
OWNER_NAME = 'Genesaret Johnes' | ||
|
||
BANK_ACCOUNT = 'your-bank-account-if-needed' | ||
TRAKTEER_LINK = 'teer.id/gensart' |
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,37 +1,68 @@ | ||
interface EnvironmentConfiguration { | ||
import 'dotenv/config'; | ||
|
||
/** | ||
* This object is used as dotenv bridge | ||
* so we can add some information | ||
* to each variable stored on dotenv. | ||
*/ | ||
const environmentConfiguration = { | ||
/** | ||
* Is sending any WhatsApp message allowed ? | ||
* The property name clearly says it, this is for global configuration | ||
*/ | ||
isSendingMessageEnabled: boolean, | ||
isSendingMessageEnabled: true, | ||
|
||
/** | ||
* Bot full name | ||
* Bot full name, for example : Sora Erlyana | ||
*/ | ||
botName: string, | ||
botName: process.env.BOT_NAME, | ||
|
||
/** | ||
* Bot short name | ||
* Bot short name, for example : Sora | ||
*/ | ||
botShortName: string, | ||
botShortName: process.env.BOT_SHORT_NAME, | ||
|
||
/** | ||
* Bot codename | ||
* Bot code name, for example : SoraErlyana | ||
*/ | ||
botCodeName: string, | ||
botCodeName: process.env.BOT_CODE_NAME, | ||
|
||
/** | ||
* Owner name of the bot | ||
* Creator/Owner name | ||
*/ | ||
ownerName: string | ||
} | ||
ownerName: process.env.OWNER_NAME, | ||
|
||
const environmentConfiguration: EnvironmentConfiguration = { | ||
isSendingMessageEnabled: true, | ||
/** | ||
* imgBB API Key, see more at https://api.imgbb.com | ||
*/ | ||
imgBBKey: process.env.IMGBB_KEY, | ||
|
||
botName: 'Sora Erlyana', | ||
botShortName: 'Sora', | ||
botCodeName: 'SoraErlyana', | ||
ownerName: 'Genesaret Johnes' | ||
/** | ||
* Ghola AI chat API Token, see more at https://www.ghola.ai/developer | ||
*/ | ||
gholaToken: process.env.GHOLA_TOKEN, | ||
|
||
/** | ||
* Ghola AI associated account email, see more at https://www.ghola.ai/developer | ||
*/ | ||
gholaEmail: process.env.GHOLA_EMAIL, | ||
|
||
/** | ||
* Ghola AI bot profile ID, see more at https://www.ghola.ai/developer | ||
*/ | ||
gholaProfileId: process.env.GHOLA_AI_PROFILE_ID, | ||
|
||
// BANK_ACCOUNT = 'your-bank-account-if-needed' | ||
// TRAKTEER_LINK = 'teer.id/gensart | ||
|
||
/** | ||
* Bank Account Information, use if needed. | ||
*/ | ||
bankAccountInfo: process.env.BANK_ACCOUNT, | ||
|
||
/** | ||
* Trakteer Linkteer link, for donation support. | ||
*/ | ||
trakteerLink: process.env.TRAKTEER_LINK | ||
} | ||
|
||
export default environmentConfiguration |
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Executor } from '@/command-hive'; | ||
import config from '@/env'; | ||
import * as wweb from '@utils/wweb'; | ||
|
||
const donation: Executor = async (client, message) => { | ||
const informationArray = [ | ||
`Kamu bisa bantu perkembangan ${config.botName} dengan mentraktir creator ${config.botShortName} ke metode dibawah :`, | ||
`Trakteer : ${config.trakteerLink}`, | ||
`Rekening BCA : ${config.bankAccountInfo}`, | ||
`🙋♂️ : _"Semi Donasi apa itu ${config.botShortName} ?"_`, | ||
`🅰 : Jika kamu melakukan donasi ke link Trakteer, atau rekening bank diatas dengan nominal lebih dari Rp10.000, 80% dari nominal kamu akan creator donasikan kembali ke platform kitabisa.com / Dompet Dhuafa (dibulatkan kelipatan ribuan)\n`, | ||
`Fitur ini masih dalam tahap pengembangan, karena saat kamu melakukan donasi, ${config.botShortName} perlu melakukan feedback yang tepat untuk menangani donasi kamu. Tapi creator sudah mulai open donasi saat ini kok :)` | ||
]; | ||
wweb.replyMessage(message, informationArray.join('\n')); | ||
} | ||
|
||
export { | ||
donation | ||
} |