Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nuztalgia/taterbot

A Discord bot that serves as a cross-server spectater and communitater.
https://github.com/nuztalgia/taterbot

Last synced: about 1 month ago
JSON representation

A Discord bot that serves as a cross-server spectater and communitater.

Awesome Lists containing this project

README

        

TaterBot

[![Botstrap](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fnuztalgia%2Fbotstrap%2Fmain%2F.github%2Fbadges%2Fbotstrap-on.json&logo=0)](https://github.com/nuztalgia/botstrap)
[![Project License](https://img.shields.io/github/license/nuztalgia/taterbot?color=blue)](https://github.com/nuztalgia/taterbot/blob/main/LICENSE)
[![Python Version](https://img.shields.io/badge/python-3.10-blue)](https://github.com/nuztalgia/taterbot/blob/main/pyproject.toml)
[![Build Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/taterbot/build.yml?branch=main)](https://github.com/nuztalgia/taterbot/actions/workflows/build.yml)
[![CodeQL Status](https://img.shields.io/github/actions/workflow/status/nuztalgia/taterbot/codeql.yml?branch=main&label=codeQL)](https://github.com/nuztalgia/taterbot/actions/workflows/codeql.yml)
[![CodeFactor](https://img.shields.io/codefactor/grade/github/nuztalgia/taterbot/main?label=codefactor)](https://www.codefactor.io/repository/github/nuztalgia/taterbot)

TaterBot is a personal Discord bot that serves as a cross-server spec**tater**
and communi**tater**. πŸ₯”πŸ‘ΎπŸ’—

It lets me (hereafter referred to as a "Potato") connect with a group of people
that I love dearly (hereafter referred to as "Clowns") even though my actual
Discord account is no longer in their server. Frankly, it's an overengineered
way for me to maintain boundaries and protect my mental health, because I'm my
own worst sabo**tater**.

TMI (too much information) - Maybe.
LOL (lots of love) -
Absolutely. πŸ’œ

Are you also a Potato looking to associ**tate** with a group of Clowns? Maybe
TaterBot can help you out. It's a shy bot that forms a very strong attachment to
its Potato, so it isn't publicly hosted anywhere - but you're more than welcome
to install/clone/**fork** this project and run your own personal TaterBot! 🌟

## Adopting a TaterBot

### πŸ“œ Prerequisites

First, you'll need to make sure you have a few things ready in order to properly
care for your TaterBot:

- **Python 3.10** - https://www.python.org/downloads/release/python-3108/
- `pip` (usually auto-installed with Python) -
https://pip.pypa.io/en/stable/installation/
- `git` (just for installation; no need to know how to use it) -
https://git-scm.com/downloads
- Basic familiarity with the
[terminal or "command line"](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Understanding_client-side_tools/Command_line#welcome_to_the_terminal)
on your system

Do you meet the adoption requirements? If so, let's get this Potato rolling! πŸ₯

### 🌱 Installation & Usage

You can install and/or up**tate** TaterBot by using this command:

```
pip install -U git+https://github.com/nuztalgia/taterbot.git
```

Once you've installed TaterBot, you can run it by using this command from any
directory:

```
taterbot
```

For information about the available command-line options, run
taterbot -h (or click to expand this section).


```
usage: taterbot [-f] [-t] [-v] [--help] []

A Discord bot that serves as a cross-server spectater and communitater.
Run "taterbot" with no parameters to start the bot in development mode.

positional arguments:
The ID of the token to use to run the bot.
Valid options are "dev" and "prod".

options:
-f, --force-sync Force-sync all TaterBot app commands.
-t, --tokens View/manage your saved Discord bot tokens.
-v, --version Display the current bot version.
-h, --help Display this help message.
```

### πŸ”‘ Onboarding & Security

If everything was planted correctly, you should see something like this after
running `taterbot` for the first time:

```
taterbot: You currently don't have a saved development bot token.
Would you like to add one now? If so, type "yes" or "y":
```

A **bot token** is essentially the "key" to your bot's Discord account. It's
used for authorizing API requests and carries all of your bot's permissions,
which makes it a very sensitive piece of data. It should **never** be shared
with other people. For these reasons, TaterBot uses
[**Botstrap**](https://botstrap.readthedocs.io/) to safely encrypt/store tokens
and avoid potential security disas**taters**. πŸ’₯

If you don't have a bot token and want more info on how to get one, click to
to expand this section.


1. To obtain a bot token, you'll first have to create a new **Discord App**. Go
to the [Developer Portal](https://discord.com/developers/applications) and
click the New Application button in the top-right corner. Enter an
ap**peel**ing name for your bot and click Create.

2. Now you should be on the **General Information** page for your app. Give it a
cute profile picture and description - these will be visible to your Clowns!
After **tating** care of those two things, you can move on from this page.

3. The next step is to add a "bot user" to your app, which allows it to appear
in Discord similarly to other members. Navi**tate** to the **Bot** page using
the sidebar menu on the left, then click the Add Bot button on the
right.

4. After creating a bot user, you should see a Reset Token button.
Click it to gener**tate** your bot token! πŸŽ‰


If you have a bot token but are unsure of how to proceed through the Botstrap
setup, click to expand this section.


1. At the initial prompt that asks `Would you like to add one now?`, type `yes`
(or just `y`) and hit Enter.

2. Next, you'll be asked to enter your bot token (i.e. copy and paste it in).
When you do, your input won't be visible on the screen - this is by design,
to keep your token safe! Just trust that it's there, and hit Enter
again.

3. If you entered your token correctly, you'll be prompted to run your bot. Go
ahead and type `y`, then hit Enter.


After you set up your token and your bot successfully authenti**tates** with
Discord, you should see this message:

```
TaterBot is online and ready!
```

Congratu**tations**, you're now the proud Potato parent of a tiny Tater tot! πŸ‘Ά

## Putting Down Roots

### πŸ₯” Instructions for the Potato

So your bot is online and ready, but where exactly is it? If you haven't added
it to any Discord servers yet, you should check your potato clock... because
it's time for your TaterBot to put down its roots! 🌞

Open up the [Developer Portal](https://discord.com/developers/applications/)
(again) and select your app. Navi**tate** to the **Bot** page using the sidebar
menu on the left, then scroll down a little bit. There are **two** switches that
you need to flip on this page:

- **Server Members Intent** - This should be turned **ON**.
- **Message Content Intent** - This should be turned **ON**.

Make sure to leave all the other switches as they originally were!

Next, click **OAuth2** in the sidebar menu on the left. It'll expand to reveal
two sub-pages - click the one labeled **URL Generator**. On this page, select
the `bot` checkbox, and another section will appear.

There are **seven** new checkboxes that you need to select in order for your
TaterBot to work, and they're all in the **Text Permissions** column:

`Send Messages`, `Embed Links`, `Attach Files`, `Read Message History`,
`Use External Emojis`, `Add Reactions`, and `Use Slash Commands`.

Once you've selected all the appropriate permissions, click the Copy
button in the bottom-right corner of the page. Send the result (your TaterBot's
custom invite link) to a trusted Clown, then wait anxiously for them to accept
it. 🀑

### πŸŽͺ Instructions for the Clowns

A server admin for the Clowns will have to open the bot invite link provided by
the Potato in order to allow their TaterBot to facili**tate** communi**tation**.
Upon doing so, they should see a dialog that looks similar to the one in the
picture to the right - but with different names and icons, of course. (You _did_
give your bot a cute name and avatar like the instructions said to do... right?
😜)

The Clowns admin should verify that the requested permissions are
`Send Messages`, `Embed Links`, `Attach Files`, `Read Message History`,
`Add Reactions`, `Use External Emojis`, and last but not least,
`Use Application Commands`. They should then grant your TaterBot these
permissions and add it to the server by clicking the Authorize
button.

## Development

Are you a fellow compu**tater** programmer? If so, you might be interested in
these commands:

```
git clone https://github.com/nuztalgia/taterbot.git
cd taterbot
pip install -e .
```

This will create an
[editable](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs)
installation of TaterBot in your current environment. Any changes you make to
its code will immediately take effect when you run `taterbot` locally.

[Contributions](https://github.com/nuztalgia/taterbot/blob/main/.github/contributing.md)
to this project are very welcome, as long as they
[pass](https://results.pre-commit.ci/latest/github/nuztalgia/taterbot/main)
[all](https://github.com/nuztalgia/taterbot/actions/workflows/build.yml)
[the](https://github.com/nuztalgia/taterbot/actions/workflows/codeql.yml)
[checks](https://www.codefactor.io/repository/github/nuztalgia/taterbot) to keep
it green and healthy! πŸ’š

## License

**Source Code:** Copyright Β© 2022-2023
[Nuztalgia](https://github.com/nuztalgia). Released under the
[MIT License](https://github.com/nuztalgia/taterbot/blob/main/LICENSE).

**Image Assets:** Included under [fair use](https://www.copyright.gov/fair-use/)
and **not** covered by the above license. See
[`assets/README.md`](https://github.com/nuztalgia/taterbot/tree/main/taterbot/assets)
for more details.