GithubHelp home page GithubHelp logo

ezelkow1 / discord-key-bot Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 3.0 101 KB

A bot for discord that accepts, announces, and gives out keys

License: GNU General Public License v3.0

Go 99.32% Dockerfile 0.68%
bot discord steam uplay gamekey gogs golang discordgo gog humblebundle

discord-key-bot's People

Contributors

aloran6 avatar ezelkow1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord-key-bot's Issues

Allow searching by wishlist

Discord has a way to look up user integrations. Could add something that checks for a users steam integration, if it exists can see if there is a way to grab their wishlist, parse out all the titles, then check the database for any of them that exist and print out that list

Add throttling to !take

Currently someone can come in and take all keys. Could be useful to have some sort of per-day throttle to prevent someone from taking the entire database

Improve load/save and map usage

I am doing something wierd/wrong with the map and reading/writing to the db file. At some point the load works and so does the save, but it is not stored globally.

Need to figure out how to make this variable a global map and have it used properly in the load/save. I had seen when doing the checkDB function that the map is empty even though we had done a load on it in main, so it is not being stored in a global

Limited search text

Right now if you do a search its output is limited by the discord text limit, it is not setup to do multiple messages like the !listkeys does.

Need to decide if we want to allow it to spam something like !search s, or maybe only allow spam searches in PM

Convert to sqlite

Extending the existing database is a huge chore. It really should have been sql-ish from the start, so time to start investigating a good DB layout so that users can be cross referenced across new features and such

Add a game search function

Can search by substring in to normalized map key, any that match add it to a slize and output at the end

Option for only 1 key per game per user

Requested feature:

To have a way to limit keys to only 1 per game, per user. As of now Im thinking of this being an on/off type feature with a separate database of users with a list of what games they have taken. Would probably be the least intrusive to existing functionality and keep it separated from the keys themselves

Group buy hosting

*Manage group buys

-Allow creation of a group buy with a name, number of participants, and a host
-users can sign up for a buy
-send message to host when buy is full
-allow host to add keys for each member
-allow members to grab their key

File cleanup

  • Move embed functions to their own file
  • Move helper functions to their own file (load/save/string cleaning/regex matching)

Better Regex handling

The current regex just takes everything after the last space as a key. While this is nice to be generic since it handles urls and keys there could be more. I.e. separate regex to determine steam/uplay/origin/gog/url, label as appropriate. This could also allow multiple key additions in one message

panic: runtime error: invalid memory address or nil pointer dereference

I am trying to run this, but I get this error:

Db File does not exist, creating
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x67d7e3]

goroutine 1 [running]:
main.Load(0x0, 0x0, 0x6a9580, 0x8bf530)
        E:/My Documents/GitHub/discord-key-bot/utils.go:102 +0xa3
main.main()
        E:/My Documents/GitHub/discord-key-bot/main.go:112 +0x273

My E: is a Blu-Ray drive and doesn't even have these files.
I have filled out the Token and BroadcastChannel
Have I done something incorrectly?

Crash in message create

Aug 03 08:45:24 steamos discord-key-bot[13962]: Bot is now running. Press CTRL-C to exit.
Aug 03 09:30:55 steamos discord-key-bot[13962]: panic: runtime error: invalid memory address or nil pointer dereference
Aug 03 09:30:55 steamos discord-key-bot[13962]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x680916]
Aug 03 09:30:55 steamos discord-key-bot[13962]: goroutine 88 [running]:
Aug 03 09:30:55 steamos discord-key-bot[13962]: main.messageCreate(0xc42008b200, 0xc42021a028)
Aug 03 09:30:55 steamos discord-key-bot[13962]: /home/evan/github/discord-key-bot/main.go:165 +0xa6
Aug 03 09:30:55 steamos discord-key-bot[13962]: github.com/bwmarrin/discordgo.messageCreateEventHandler.Handle(0x7404b8, 0xc42008b200, 0x6d3bc0, 0xc42021a028)
Aug 03 09:30:55 steamos discord-key-bot[13962]: /home/evan/go/src/github.com/bwmarrin/discordgo/eventhandlers.go:496 +0x57
Aug 03 09:30:55 steamos discord-key-bot[13962]: created by github.com/bwmarrin/discordgo.(*Session).handle
Aug 03 09:30:55 steamos discord-key-bot[13962]: /home/evan/go/src/github.com/bwmarrin/discordgo/event.go:162 +0x2f8
Aug 03 09:30:55 steamos systemd[1]: keybot.service: main process exited, code=exited, status=2/INVALIDARGUMENT

Make a node.js version

I can't run the files on my hosting service because it is a 32 bit Linux hosting service. I need this bot for my server. Please help!

Change name/key parsing (spaces at end)

Someone added a key and it got entered as:
name: gamename key
keytype: unknown

Im guessing there may have been a space after the key. So for better key parsing maybe we can run the key regexes on each message, pull out the key first, then take the remainder as the name

panic: runtime error: index out of range

whenever i add a keyrole setting the bot give me this issue "panic: runtime error: index out of range"
if i leave keyrole blank the bot load without errors but not join or doing anything

i think i've setup everything as the README said is it outdated ? thanks for your work

How does this work?

Hi, I recently downloaded the bot but doesn't seem like the .exe file actually works. Or am I doing something wrong?

Sorry to ask a stupid question..

How do I start this bot? The executable doesn't do anything. I've tried doing an npm install / start in the directory, but nothing. I'm quite new to this so sorry if I sound like a complete toad. I've edited the conf file already.

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.