commit
This commit is contained in:
parent
bc3c3f4cf1
commit
3991f820bc
8 changed files with 819 additions and 2 deletions
|
@ -121,3 +121,39 @@ export function setFeature(connection: mysql.Connection, guild_id: string, featu
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function getWelcomeConfig(connection: mysql.Connection, guild_id: string): Promise<any[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query(`SELECT * FROM welcome_config WHERE guild_id = "${guild_id}"`, (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
resolve(result);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function addWelcomeConfig(connection: mysql.Connection, guild_id: string) {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query(`INSERT INTO welcome_config (guild_id) VALUES ("${guild_id}")`, (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
resolve(result);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
export function setWelcomePropertiy(connection: mysql.Connection, guild_id: String, property: string, value: string) {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.query(`UPDATE welcome_config SET ${property} = "${value}" WHERE guild_id = "${guild_id}"`, (error, result) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
resolve(result);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue