Git Product home page Git Product logo

huldra's Introduction

.

huldra's People

Contributors

cnsumner avatar sumitsawant avatar

Stargazers

 avatar

Watchers

 avatar

huldra's Issues

Wrong string in string replacement

There is a bit of code to prevent the bot from mentioning itself when sending replies, however in one case this results in the bot replacing the self mention with the word "replace" instead of an empty string.

Simple fix. On line 47, 'replace' should be replaced with ''

huldra/lib/huldra.dart

Lines 45 to 48 in 00a0c46

var reply = (await Markov.generate(input))
.replaceAll('<@!${bot.self.id.id}>', '')
.replaceAll('<@${bot.self.id.id}>', 'replace')
.trim();

Replace hard coded bot id strings

There are a couple of places left in the code where I forgot to swap out the hard coded bot ID with variables. This would prevent the bot from working properly if anyone other than me tried to deploy it.

In both of the below cases, 674451490743779339 needs to be changed to ${bot.self.id.id}

message.content.replaceFirst('<@!674451490743779339>', '').split(' ')

.replaceFirst('<@!674451490743779339>', '')

Owner ID hard coded instead of being pulled from configuration

There are a few commands in the code where the bot will only respond to the bot owner. This is configurable in config.yaml but the value isn't actually being used in the code. This prevents the bot from being useful to anyone other than me.

In both of the instances below, the ID (after the ==) should be replaced with _config.getInt('owner')

e.message.author.id.id == 96407239232884736) {

e.message.author.id.id == 96407239232884736) {

Write a useful readme

Update the readme so it's not just the default one. Most of this can be copied from the rust project. Self-assigning this because I'm the only one who would even know what to write.

Example configuration file

Currently there is no example configuration file. This isn't ideal, especially since the configuration options are not documented (I had to search through the code just to make sure I remembered everything).

  1. We need an example configuration file, called config.yaml, probably under a folder (maybe example).
  2. config.yaml should contain the following:
discordToken: <discord bot token goes here> #the discord bot account token from the discord developer portal
owner: <bot owner id goes here> #the id of the discord user who should have admin permissions for this bot
probability: 1000 #the number of messages (on average) that should pass between each bot reply

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.