Git Product home page Git Product logo

scythebot's Introduction

ScytheBot

ScytheBot grew to be a discord companion of some sorts. It started out as a randomizer for the Scythe game, but soon found it's way to share profound knowledge. After many fortnights though not too many, ScytheBot spoke up for the voiceless.

Cogs

Discord.py uses cogs to separate code into manageable chunks. Cogs are modular and can be added and removed while the bot is running. ScytheBot currently consists of the following chunks of code:

  • main
    • general methods to boot the bot and load other cogs as well as some basic functions
  • scythe
    • Scythe specific functions, for which the bot was initially created. Assigns random teams based on shibrady/scythe-stats tier list.
  • proverbs
    • A proverb cog containing methods to post proverbs, gather votes and keep track of votes. These proverbs are collected through scraping websites using the sayings.py file. These real proverbs are then used to generate new proverbs.
  • soundboard
    • A soundboard cog containing methods to join voice channels and play mp3 audio fragments uploaded in the ./soundboard/data/d1mp3 folder

Set-up

Discord

Create a bot (application) over at the discord developers website. After successful creation, copy your application's discord token to an environment file. You can find your bot's token under Application > Settings (left) > Bot > Token > Click to Reveal Token

File: .env
--------------
DISCORD_TOKEN='AA.nA.nas313'
ADMIN_DICT='{"Name": discord.user.id}'
SUPER_ADMIN='Name'
SCYTHEBOT_DEBUG_MODE='False'
LIBOPUS=/absolute/path/to/libopus/so/if/needed

Host

Clone this repo, install the requirements.txt, create .env file in root of the ScytheBot folder and run scythebot.py

Develop

See Host, but set SCYTHEBOT_DEBUG_MODE to 'True' It is recommended to host a separate developers application to test your changes and prevent your production server from crashing or spamming constantly

scythebot's People

Contributors

tadsz avatar tariqdam avatar

Stargazers

 avatar

Watchers

Joost Warmerdam avatar  avatar

scythebot's Issues

Schijtbot not respected

expected behavior

When the word 'schijtbot' is used, the current timestamp is saved and scythebot is expected to not react to non-command messages for a set amount of time.

if any(x in message.content for x in ['schijtbot']):

Actual behavior

The timestamp is saved to a variable, but the message listener never checks this variable and no timedelta is set for how long to stay muted.

proposed solution

at the start of on_message include an evaluation of timedeltas and return None if within the time window to stay muted

if len(message.content) > 100 or message.author.bot:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.