concord icon indicating copy to clipboard operation
concord copied to clipboard

Added a starboard-bot clone as an example.

Open Piecuuu opened this issue 2 years ago • 4 comments

Notice

  • [x] I understand the code that I have edited, and have the means to test it before making changes to Concord.

What?

I have made a new example, a starboard bot clone. It is an advanced example, showing how you can use SQLite3 with Concord.

Why?

It's just is an example.

How?

As mentioned previously, it's just an example. The more, the better.

Testing?

I believe there might be one thing. When you don't add a board channel, and the bot tries to send a message to a board channel, but the function, that's tasked to return the board channel from the database, doesn't find it, it returns a Channel ID that's 0. It shouldn't crash the bot, and if the user read the README file, they would know to add a board channel.

Screenshots

Anything Else?

We could add caching messages, and other things to the bot. For now, it doesn't use caching at all.

Piecuuu avatar Sep 10 '23 13:09 Piecuuu

Heads up -- the Makefile is busted!

OBJS = src/memhandl.o src/utils.o src/db.o src/main.o
PROGRAM = sbclone

CC = cc
CCLD = cc
CFLAGS = -g -I/usr/local/include
LDFLAGS = -ldiscord -lcurl -lsqlite3 -lpthread -L/usr/local/lib

.SUFFIXES: .c .o

.c.o:
	$(CC) $(CFLAGS) -c $< -o $@

$(PROGRAM): $(OBJS)
	$(CCLD) -o $(PROGRAM) $(OBJS) $(LDFLAGS)

all: $(PROGRAM)

.PHONY: clean

clean:
	rm -f $(OBJS) $(PROGRAM) *.db *.log

HackerSmacker avatar Sep 10 '23 14:09 HackerSmacker

Post-testing results for record and bookkeeping's sake:

  • Code quality is decent (yes, I saw that famous comment and laughed at it)
  • It failed almost everywhere with the aforementioned-discussed channel ID issue
  • Nice and compact DB (PG support would be trivial to add later as a "double example")
  • All of this was under the latest and greatest dev Concord, and under master Concord.

HackerSmacker avatar Sep 11 '23 15:09 HackerSmacker

🤯

jdeokkim avatar Dec 02 '23 13:12 jdeokkim

🤯

Piecuuu avatar Dec 03 '23 11:12 Piecuuu