aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRatakor <ratakor@disroot.org>2023-06-14 01:31:35 +0200
committerRatakor <ratakor@disroot.org>2023-06-14 01:31:35 +0200
commit930bfc32a62ea7f6de43ca9e378111f50edb9f09 (patch)
tree75099b6790036c40a423459913909fbbb89ba24e
parentbb91534e74adb047d68ae1dd91bb5b2e20952447 (diff)
Remove use_embed and kingdoms[]v0.0.10
-rw-r--r--config.def.h20
-rw-r--r--src/cmd_info.c55
-rw-r--r--src/init.c2
-rw-r--r--src/nolan.h3
-rw-r--r--src/stats.c2
5 files changed, 8 insertions, 74 deletions
diff --git a/config.def.h b/config.def.h
index f26ca0e..6ffd5ab 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,23 +1,22 @@
#define DELIM ',' /* Delimiter for the save file */
#define FILENAME "source.csv" /* Filename of the save file */
#define LB_MAX 10 /* Max players to be shown with ?lb */
-#define APP_ID 1109604402102273245 /* The bot's application ID */
-#define ADMIN 277534384175841280 /* Admin user ID for bug reports */
+#define APP_ID 0 /* The bot's application ID */
+#define ADMIN 0 /* Admin user ID for bug reports */
#define RAID_GUILD_ID 0 /* Server ID for raids */
+#define ROLE_GUILD_ID 0 /* this is only for to Orna FR */
#define TOKEN "YOUR-BOT-TOKEN"
#define PREFIX "?"
-
-static const int use_embed = 0; /* 0 means no embed on info */
+#define MAX_PLAYERS 50
/* list of channel ids to check for stats screenshots */
static const u64snowflake stats_ids[] = {
- 1110185440285302855,
- 1110767040890941590,
+ 0,
};
/* list of channel ids to check for raids screenshots */
static const u64snowflake raids_ids[] = {
- 1112094855691239616,
+ 0,
};
/* list of chinese slayers for raids screenshots */
@@ -29,10 +28,3 @@ static const u64snowflake cn_slayer_ids[] = {
static const u64snowflake jp_slayer_ids[] = {
0,
};
-
-/* list of kingdom to accept if verification is on */
-static const char *kingdoms[] = {
- "Scream of Terra",
- "Volcano of Terra",
- "Whisper of Terra",
-};
diff --git a/src/cmd_info.c b/src/cmd_info.c
index 85098ad..789f8b4 100644
--- a/src/cmd_info.c
+++ b/src/cmd_info.c
@@ -6,8 +6,6 @@
#define ICON_URL "https://orna.guide/static/orna/img/npcs/master_gnome.png"
static void write_invalid(char *buf, size_t siz);
-/* static void write_info_embed(struct discord *client, char *buf, size_t siz, */
-/* int index); */
static void info_from_uid(char *buf, size_t siz, u64snowflake userid);
static void info_from_txt(char *buf, size_t siz, char *txt);
@@ -52,44 +50,6 @@ write_invalid(char *buf, size_t siz)
strlcat(buf, "To check your info just type /info.", siz);
}
-/* TODO: embed */
-/* void */
-/* write_info_embed(struct discord *client, char *buf, size_t siz, int index) */
-/* { */
-/* unsigned long i; */
-/* char *p; */
-
-/* struct discord_embed embed = { */
-/* .color = 0x3498DB, */
-/* .timestamp = discord_timestamp(client), */
-/* .title = players[index].name */
-/* }; */
-/* discord_embed_set_footer(&embed, "Nolan", ICON_URL, NULL); */
-/* discord_embed_add_field( */
-/* &embed, (char *)fields[1], players[index].kingdom, true); */
-/* for (i = 2; i < LENGTH(fields) - 1; i++) { */
-/* if (i == 7) { /1* playtime *1/ */
-/* p = playtime_to_str(((long *)&players[index])[i]); */
-/* discord_embed_add_field( */
-/* &embed, (char *)fields[i], p, true); */
-/* free(p); */
-/* } else { */
-/* sprintf(buf, "%'ld", ((long *)&players[index])[i]); */
-/* if (i == 18) /1* distance *1/ */
-/* strcat(buf, "m"); */
-/* discord_embed_add_field( */
-/* &embed, (char *)fields[index], buf, true); */
-/* } */
-/* } */
-/* struct discord_create_message msg = { */
-/* .embeds = &(struct discord_embeds) */
-/* { */
-/* .size = 1, */
-/* .array = &embed, */
-/* } */
-/* }; */
-/* } */
-
void
write_info(char *buf, size_t siz, const Player *player)
{
@@ -172,21 +132,6 @@ on_info(struct discord *client, const struct discord_message *event)
else
info_from_txt(buf, sizeof(buf), event->content);
- /*
- if (use_embed) {
- write_info_embed(client, buf, siz, i);
- struct discord_create_message msg = {
- .embeds = &(struct discord_embeds)
- {
- .size = 1,
- .array = &embed,
- }
- };
- discord_create_message(client, event->channel_id, &msg, NULL);
- discord_embed_cleanup(&embed);
- }
- */
-
struct discord_create_message msg = {
.content = buf
};
diff --git a/src/init.c b/src/init.c
index a1dc71c..90cc927 100644
--- a/src/init.c
+++ b/src/init.c
@@ -121,7 +121,7 @@ init_players(void)
nplayers--; /* first line is not a player */
if (nplayers > MAX_PLAYERS)
- DIE("there is too much players to load (max:%lu)", MAX_PLAYERS);
+ DIE("there is too much players to load (max:%d)", MAX_PLAYERS);
for (i = 0; i < nplayers; i++)
players[i] = load_player(i + 2);
diff --git a/src/nolan.h b/src/nolan.h
index 786ef9d..c390730 100644
--- a/src/nolan.h
+++ b/src/nolan.h
@@ -6,7 +6,6 @@
#include "../config.h"
#include "util.h"
-#define MAX_PLAYERS LENGTH(kingdoms) * 50 /* might need to update that */
#define MAX_SLAYERS 50
#define LINE_SIZE 300 + 1
#define MAX_MESSAGE_LEN 2000 + 1
@@ -23,8 +22,6 @@
#define RAIDS_FOLDER SAVE_FOLDER "raids/"
#define STATS_FILE SAVE_FOLDER FILENAME
-#define ROLE_GUILD_ID 999691133103919135 /* this is only for to Orna FR */
-
enum {
NAME,
KINGDOM,
diff --git a/src/stats.c b/src/stats.c
index 3c42df8..5b7dcd3 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -406,7 +406,7 @@ update_players(char *buf, size_t siz, Player *player)
if (i == nplayers) { /* new player */
nplayers++;
if (nplayers > MAX_PLAYERS)
- DIE("there is too much players (max:%lu)", MAX_PLAYERS);
+ DIE("there is too much players (max:%d)", MAX_PLAYERS);
create_player(player, i);
s += write_quote(buf + s, siz - s);
s += snprintf(buf + s, siz - s,