Implementation of Chatterbot using Discord API

Overview

discord-chat-bot

Implementation of Chatterbot using Discord API.

Usage

Due to the necessity of storing files to train the AI, the bot is not hosted publicy. You must download this repository and run the chat-bot.py script using your own bot account.

1. Create your own discord bot

Set up your bot and copy the token in Discord's developer portal at Application > (your application) > Bot > Token. Paste it into token.txt.

2. Install dependencies

chat-bot.py requires the modules that are imported at the top of the script, namely chatterbot and discord.py. To install these, open a command prompt and type pip install chatterbot and pip install discord.py and wait for each to install. If running the chat-bot.py script gives an error that either of the modules are not found, you should attempt to use pip3 instead to ensure the modules are installed to the correct python version. If chatterbot fails to install, type pip install chatterbot=1.0.0 instead.

3. Set up convos directory

Chatbot saves conversations cached by discord users to numbered .txt files. Each file represents one conversation in which each line is a valid response to the one before it. You can create your own files manually (following the number file name scheme) or teach the bot with commands within Discord (see below). You can change the directory in which conversations are saved by changing the CONVO_DIR variable within the chat-bot.py script.

4. Run the chat-bot.py script

Using any python interpreter, run the chat-bot.py script. When this script is running, your bot should be online and available for use!

Commands

  • $talk args: any

Takes any string of lowercase letters as input for the AI to repsond to. Any bot commands, numbers, and symbols are stripped before being interpreted.

  • $teach (in reply to another message or reply chain)

Takes every message in a reply chain and caches it as a conversation. If cache is full, all conversations will be saved.

  • $train args: 'basic', 'custom', 'clear'

Retrains AI. All of the cache is saved before training. basic will train based on the default English corpus, custom will train based on saved conversations, and clear will reset the AI storage (not saved custom conversations) before retraining. clear is accessible only to administrators of the server. Note that while one parameter is required, more than one can be passed in at once.

  • $cache_handle args: 'clear', 'write'

Modifies cache. clear will reset the cache and delete recently taught conversations. write will save all conversations in the cache. Accessible only to administrators of the server.

  • $check

Sends status.

You might also like...
PyDiscord, a maintained fork of discord.py, is a python wrapper for the Discord API.

discord.py A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. The Future of discord.py Please read the gi

An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links
API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library
MusicBot is the original Discord music bot written for Python 3.5+, using the discord.py library

The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)

Discord music bot using discord.py, slash commands, and yt-dlp.

bop Discord music bot using discord.py, slash commands, and yt-dlp. Features Play music from YouTube videos and playlists Queue system with shuffle Sk

Zero2 Discord bot is written with Discord.py using Python.
Zero2 Discord bot is written with Discord.py using Python.

Zero2 Discord bot is written with Discord.py using Python.

A simple fun discord bot using discord.py that can post memes

A simple fun discord bot using discord.py * * Commands $commands - to see all commands $meme - for a random meme from the internet $cry - to make the

This is a tutorial on how to make a Discord Bot using the discord.py library

HowToMakeADiscordBot This Github repository is here to help you code a Discord Bot using the discord.py library! 1 - Setup: Download the code inside t

Owner
kiwijuice56
kiwijuice56
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py)

Articuno (discord-interactions) A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py) Get started If you wa

Blue 8 Dec 26, 2022
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
DeKrypt 24 Sep 21, 2022
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

pycord A fork of discord.py. PyCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Mo

Pycord Development 2.3k Dec 31, 2022
An asyncio Python wrapper around the Discord API, forked off of Rapptz's Discord.py.

Novus A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. A full fork of Rapptz's Discord.py library, with

Voxel Fox 60 Jan 3, 2023
Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected discord server via Nextcordbot API.

Steam-Workshop-Monitor Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected Discord channel via Nextcordbo

null 7 Nov 3, 2022
An API wrapper for discord; maintained and improved from discord.py

Fusion.py Documentation What is Fusion.py you might ask; Fusion.py is a Discord.py fork that has most of the good features from most of the big Discor

Senarc Studios 5 Apr 19, 2022
Due to changes to the discord API and discord.py being discontinued

Talia Due to changes to the discord API and discord.py being discontinued, Talia development has been halted permanently A customizable economy discor

null 2 Mar 8, 2022