allah is real
This commit is contained in:
parent
2a0eecdec1
commit
e1cab5243c
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@ nimscan/bin
|
|||||||
server_backup
|
server_backup
|
||||||
old_tests
|
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", "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
|
from uri import parseUri
|
||||||
discard os.execShellCmd("clear")
|
discard os.execShellCmd("clear")
|
||||||
let
|
let
|
||||||
@ -21,14 +21,19 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
|||||||
embeds = @[Embed(
|
embeds = @[Embed(
|
||||||
title: some "TaxenHeimer Bot",
|
title: some "TaxenHeimer Bot",
|
||||||
fields: some @[EmbedField(
|
fields: some @[EmbedField(
|
||||||
name: "**$help**",
|
name: fmt"**{prefix}help**",
|
||||||
value: "`Displays this menu`",
|
value: "`Displays this menu`",
|
||||||
inline: some true
|
inline: some true
|
||||||
),
|
),
|
||||||
EmbedField(
|
EmbedField(
|
||||||
name: "**$namemc**",
|
name: fmt"**{prefix}namemc**",
|
||||||
value: "`Displays informations about a minecraft account`",
|
value: "`Displays informations about a minecraft account`",
|
||||||
inline: some true
|
inline: some true
|
||||||
|
),
|
||||||
|
EmbedField(
|
||||||
|
name: fmt"**{prefix}status**",
|
||||||
|
value: "`Gives overall informations on the database`",
|
||||||
|
inline: some true
|
||||||
)],
|
)],
|
||||||
color: some 0x000066
|
color: some 0x000066
|
||||||
)]
|
)]
|
||||||
@ -68,22 +73,22 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
|||||||
title: some "Namemc Lookup",
|
title: some "Namemc Lookup",
|
||||||
fields: some @[EmbedField(
|
fields: some @[EmbedField(
|
||||||
name: "**username**",
|
name: "**username**",
|
||||||
value: "```\n" & username & "\n```",
|
value: fmt"```{'\n'}{username}{'\n'}```",
|
||||||
inline: some true
|
inline: some true
|
||||||
),
|
),
|
||||||
EmbedField(
|
EmbedField(
|
||||||
name: "**UUID**",
|
name: "**UUID**",
|
||||||
value: "```\n" & uuid & "\n```",
|
value: fmt"```{'\n'}{uuid}{'\n'}```",
|
||||||
inline: some true
|
inline: some true
|
||||||
),
|
),
|
||||||
EmbedField(
|
EmbedField(
|
||||||
name: "**Creation Date(Might not be given)**",
|
name: "**Creation Date(Might not be given)**",
|
||||||
value: "```\n" & date & "\n```",
|
value: fmt"```{'\n'}{date}{'\n'}```",
|
||||||
inline: some true
|
inline: some true
|
||||||
),
|
),
|
||||||
EmbedField(
|
EmbedField(
|
||||||
name: "**Name History**",
|
name: "**Name History**",
|
||||||
value: "```fix\n" & hist & "\n```",
|
value: fmt"```fix{'\n'}{hist}{'\n'}```",
|
||||||
inline: some false
|
inline: some false
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -99,18 +104,28 @@ proc messageCreate(s: Shard, m: Message) {.event(discord).} =
|
|||||||
of "status":
|
of "status":
|
||||||
let
|
let
|
||||||
db = open("../../server/servers.db", "", "", "")
|
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(
|
discard await discord.api.sendMessage(
|
||||||
m.channel_id,
|
m.channel_id,
|
||||||
embeds = @[Embed(
|
embeds = @[Embed(
|
||||||
title: some "**Server Database Status**",
|
title: some "**Server Database Status**",
|
||||||
fields: some @[EmbedField(
|
description: some fmt"```{'\n'}{server} total servers{'\n'}```",
|
||||||
name: "**Total Server Count**",
|
|
||||||
value: "`" & server & "`",
|
|
||||||
inline: some false
|
|
||||||
)],
|
|
||||||
color: some 0x000066
|
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()
|
waitFor discord.startSession()
|
@ -91,5 +91,5 @@ app.listen(9000, () => {
|
|||||||
console.clear()
|
console.clear()
|
||||||
console.log("server ready")
|
console.log("server ready")
|
||||||
})
|
})
|
||||||
process.on("unhandledRejection", callback => console.log(callback))
|
process.on("unhandledRejection", callback => console.log(callback.message))
|
||||||
process.on("uncaughtException", callback => console.log(callback))
|
process.on("uncaughtException", callback => console.log(callback.message))
|
Loading…
Reference in New Issue
Block a user