allah is real
This commit is contained in:
parent
2a0eecdec1
commit
e1cab5243c
4
.gitignore
vendored
4
.gitignore
vendored
@ -5,4 +5,6 @@ nimscan/bin
|
||||
.vscode
|
||||
server_backup
|
||||
old_tests
|
||||
nim_bot/src/token.key
|
||||
nim_bot/src/token.key
|
||||
nim_bot/src/tmp
|
||||
nim_bot/src/bin
|
@ -1,2 +1,3 @@
|
||||
switch("d", "ssl")
|
||||
switch("d", "release")
|
||||
switch("d", "release")
|
||||
switch("o", "bin/nim_bot")
|
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
import asyncdispatch, json, options, dimscord, strutils, harpoon, os, db_sqlite
|
||||
import asyncdispatch, json, options, dimscord, strutils, harpoon, os, db_sqlite, strformat, tables
|
||||
from uri import parseUri
|
||||
discard os.execShellCmd("clear")
|
||||
let
|
||||
@ -21,14 +21,19 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
||||
embeds = @[Embed(
|
||||
title: some "TaxenHeimer Bot",
|
||||
fields: some @[EmbedField(
|
||||
name: "**$help**",
|
||||
name: fmt"**{prefix}help**",
|
||||
value: "`Displays this menu`",
|
||||
inline: some true
|
||||
),
|
||||
EmbedField(
|
||||
name: "**$namemc**",
|
||||
name: fmt"**{prefix}namemc**",
|
||||
value: "`Displays informations about a minecraft account`",
|
||||
inline: some true
|
||||
),
|
||||
EmbedField(
|
||||
name: fmt"**{prefix}status**",
|
||||
value: "`Gives overall informations on the database`",
|
||||
inline: some true
|
||||
)],
|
||||
color: some 0x000066
|
||||
)]
|
||||
@ -68,22 +73,22 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
||||
title: some "Namemc Lookup",
|
||||
fields: some @[EmbedField(
|
||||
name: "**username**",
|
||||
value: "```\n" & username & "\n```",
|
||||
value: fmt"```{'\n'}{username}{'\n'}```",
|
||||
inline: some true
|
||||
),
|
||||
EmbedField(
|
||||
name: "**UUID**",
|
||||
value: "```\n" & uuid & "\n```",
|
||||
value: fmt"```{'\n'}{uuid}{'\n'}```",
|
||||
inline: some true
|
||||
),
|
||||
EmbedField(
|
||||
name: "**Creation Date(Might not be given)**",
|
||||
value: "```\n" & date & "\n```",
|
||||
value: fmt"```{'\n'}{date}{'\n'}```",
|
||||
inline: some true
|
||||
),
|
||||
EmbedField(
|
||||
name: "**Name History**",
|
||||
value: "```fix\n" & hist & "\n```",
|
||||
value: fmt"```fix{'\n'}{hist}{'\n'}```",
|
||||
inline: some false
|
||||
)
|
||||
],
|
||||
@ -99,18 +104,28 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
||||
of "status":
|
||||
let
|
||||
db = open("../../server/servers.db", "", "", "")
|
||||
server = db.getAllRows(sql"SELECT host FROM servers").len.intToStr
|
||||
server = $db.getAllRows(sql"SELECT host FROM servers").len
|
||||
discard await discord.api.sendMessage(
|
||||
m.channel_id,
|
||||
embeds = @[Embed(
|
||||
title: some "**Server Database Status**",
|
||||
fields: some @[EmbedField(
|
||||
name: "**Total Server Count**",
|
||||
value: "`" & server & "`",
|
||||
inline: some false
|
||||
)],
|
||||
description: some fmt"```{'\n'}{server} total servers{'\n'}```",
|
||||
color: some 0x000066
|
||||
)]
|
||||
)
|
||||
|
||||
proc guild_member_add(s: Shard, g: Guild, m: Member) {.event(discord).} =
|
||||
discard await discord.api.sendMessage(
|
||||
"999502028227227810",
|
||||
embeds = @[Embed(
|
||||
title: some "Welcome to TaxenHeimer!",
|
||||
description: some fmt"Welcome <@{m.user.id}>! Hope you'll have a great time :coffee:",
|
||||
color: some 0x000066,
|
||||
fields: some @[EmbedField(
|
||||
name: "Member Count",
|
||||
value: "```\n" & $g.members.len & "\n```"
|
||||
)]
|
||||
)]
|
||||
)
|
||||
|
||||
waitFor discord.startSession()
|
@ -91,5 +91,5 @@ app.listen(9000, () => {
|
||||
console.clear()
|
||||
console.log("server ready")
|
||||
})
|
||||
process.on("unhandledRejection", callback => console.log(callback))
|
||||
process.on("uncaughtException", callback => console.log(callback))
|
||||
process.on("unhandledRejection", callback => console.log(callback.message))
|
||||
process.on("uncaughtException", callback => console.log(callback.message))
|
Loading…
Reference in New Issue
Block a user