This commit is contained in:
Lukian LEIZOUR 2023-03-28 11:33:55 +02:00
parent c4f0c65098
commit 85a9b7e674
3 changed files with 63 additions and 11 deletions

View file

@ -1 +1,39 @@
# chaise_bot
# Chaise Bot
Welcome to Chaise Bot's GitHub repository! Chaise Bot is a versatile and powerful chatbot designed to work seamlessly on both Discord and Telegram. Powered by OpenAI's API, the bot provides an interactive and engaging user experience, making it the perfect companion for managing your online communities and having some fun conversations.
## Features
- Integration with Discord and Telegram platforms
- Utilizes OpenAI's API for natural language processing and advanced conversation capabilities
- Easy setup and configuration
## Getting Started
To get Chaise Bot up and running on your Discord or Telegram server, follow these simple steps:
1. Clone this repository
2. Install the required dependencies
3. Configure your bot's API keys and settings
4. Deploy the bot on your server
For detailed setup instructions, please check our Wiki.
## Usage
Once you have Chaise Bot deployed and running, you can start interacting with it by sending messages on Discord or Telegram using the appropriate commands. The bot will automatically respond to your messages and provide the necessary information or actions based on the commands you use.
## Contributing
We welcome contributions to Chaise Bot's development! If you'd like to contribute bugfixes, improvements, or new features, please feel free to create a pull request on this repository. For any questions or concerns, please open an issue or contact us directly.
## License
This project is licensed under the MIT License. Feel free to use, modify, and distribute Chaise Bot as you see fit. We ask that you credit the original authors when using this code.
## Acknowledgments
- OpenAI for providing their API and resources
- The Discord and Telegram communities for their support and feedback
Enjoy using Chaise Bot, and happy chatting!

View file

@ -7,13 +7,7 @@ const { incrementQuota, addConv, delConv, getConvs, addMessage, getMessages, isN
module.exports = {
newMessage : (client) => {
client.on('messageCreate', async msg => {
if (msg.content.startsWith('/github')) {
console.log('[Discord] Sent github link')
addToLogs('[Discord] Sent github link')
msg.reply('Link of the Gihhub repository :\n -https://github.com/Ninja-Jambon/chaise_bot')
}
else if (msg.content.startsWith('/g')) {
if (msg.content.startsWith('/g')) {
generateImage(msg.content.slice(+3)).then((res) => {
console.log('[Discord] Sent image to : ' + msg.content.slice(+3));
addToLogs('[Discord] Sent image to : ' + msg.content.slice(+3));
@ -336,6 +330,21 @@ module.exports = {
addToLogs('[Discord] Quota requested by ' + interaction.member.user.username);
console.log('[Discord] Quota requested by ' + interaction.member.user.username);
}
else if (interaction.commandName === 'github') {
await interaction.deferReply();
const embed = new discord.EmbedBuilder()
.setColor(0xFABBDE)
.setAuthor({ name : "Github", iconURL : client.user.displayAvatarURL()})
.setDescription('Link of the Gihhub repository :\n https://github.com/Ninja-Jambon/chaise_bot')
.setFooter({ text : "Powered by OpenAI https://www.openai.com/", iconURL : "https://seeklogo.com/images/O/open-ai-logo-8B9BFEDC26-seeklogo.com.png" });
interaction.editReply({ embeds : [embed] });
addToLogs('[Discord] Github requested by ' + interaction.member.user.username);
console.log('[Discord] Github requested by ' + interaction.member.user.username);
}
});
}
}

View file

@ -97,6 +97,11 @@ const commands = [
name : 'getmyguota',
description : 'Get your quota',
},
{
name : 'github',
description : 'Get the github link of the bot',
},
];
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD);
@ -106,15 +111,15 @@ const rest = new REST({ version: '10' }).setToken(process.env.DISCORD);
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationGuildCommands('1059559067846189067', '1062473997297668108'),
Routes.applicationGuildCommands('1059559067846189067', '1062473997297668108'), //Les Clochards
{ body: commands },
);
await rest.put(
Routes.applicationGuildCommands('1059559067846189067', '1081560091951636481'),
Routes.applicationGuildCommands('1059559067846189067', '1081560091951636481'), //Fish and Chips
{ body: commands },
);
await rest.put(
Routes.applicationGuildCommands('1059559067846189067', '1059248968028139640'),
Routes.applicationGuildCommands('1059559067846189067', '1059248968028139640'), //Serveur de test
{ body: commands },
);