Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
email
posts {
id
body
numComments
comments {
id
body
authorId
archived
}
}
}
}`
db.open(path.join(__dirname, '..', 'db', 'test1-data.sl3'))
.then(() => graphql(schema, query))
.then(res => {
console.log(require('util').inspect(res, { depth: 10 })) // eslint-disable-line
})
.catch(console.error) // eslint-disable-line
this.on('ready', this.onReady())
.on('commandPrefixChange', this.onCommandPrefixChange())
.on('error', console.error)
.on('warn', console.warn)
//.on('debug', console.log)
.on('disconnect', this.onDisconnect())
.on('reconnecting', this.onReconnect())
.on('commandError', this.onCmdErr())
.on('commandBlocked', this.onCmdBlock())
.on('commandStatusChange', this.onCmdStatusChange())
.on('groupStatusChange', this.onGroupStatusChange())
.on('message', this.onMessage());
// set provider sqlite so we can actually save our config permanently
this.setProvider(
sqlite.open(path.join(__dirname.slice(0, -3), 'data/BotSettings.sqlite3')).then(db => new Commando.SQLiteProvider(db))
).catch(console.error);
// first we register groups and commands
this.registry
.registerDefaultGroups()
.registerGroups([
['ombi', 'Ombi'],
['sonarr', 'Sonarr'],
['radarr', 'Radarr'],
['tautulli', 'Tautulli']
])
.registerDefaultTypes()
.registerDefaultCommands({
'help': true,
'prefix': true,
'ping': true,
async function getContentDB() {
if (contentDB && contentDB.open)
return contentDB
else
return contentDB = await sqlite.open(path.join(process.env.ZeronetDataPath, "content.db"))
}
public static async connect(database: string = ':memory:') {
const conn = await sqlite.open(database)
await conn.run(createCommand)
return new ArticleDatabase(database)
}
public async replace(articles: Article[]) {
if (this.database) {
const conn = await sqlite.open(this.database)
await conn.run('UPDATE article SET included = false AND excluded = false')
await conn.run('BEGIN TRANSACTION')
articles.forEach(async article => {
const stmt = await conn.prepare('SELECT * FROM article WHERE title = ? AND year = ? AND origin = ?')
const existing = await stmt.get(article.title, article.year, article.origin)
if (existing)
await conn.run('UPDATE article SET doi = ?, publication = ?, authors = ?, type = ?, included = true, excluded = false WHERE title = ? AND year = ? AND origin = ?',
article.doi,
article.publication,
article.authors,
article.type,
article.title,
article.year,
.then(() => sqlite.open(config.database, { Promise }))
.then(() => {
.then(() => sqlite.open(config.database, { Promise }))
.then(db => db.migrate({
const Discord = require("discord.js");
const bot = new Discord.Client();
const sql = require("sqlite");
sql.open("./assets/guildsettings.sqlite");
exports.run = (client, message, args) => {
sql.get(`SELECT * FROM scores WHERE guildId ="${message.guild.id}"`).then(row => {
const prefixtouse = row.prefix
const usage = new Discord.RichEmbed()
.setColor(0x00A2E8)
.setThumbnail(client.user.avatarURL)
.setTitle("Command: " + prefixtouse + "softban")
.addField("Usage", prefixtouse + "softban @Someone ")
.addField("Example", prefixtouse + "softban @Someone trying to start trouble.")
.setDescription("Description: " + "Bans and unbans a user from the current server");
if (message.member.hasPermission("KICK_MEMBERS")) {
if (!message.guild.member(client.user).hasPermission('KICK_MEMBERS')) return message.reply('Sorry, i dont have the perms to do this cmd i need KICK_MEMBERS. :x:')
let reason = args.slice(1).join(' ') || `Moderator didn't give a reason.`;
if (message.mentions.users.size < 1) return message.channel.send(usage)
let user = message.guild.member(message.mentions.users.first());