client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'setnick') {
for(user in message.channel.members)if(user.id == args[0])user.setNickname(args[1]);
}
// other commands...
});
def zzip(ID_Master,ID_Masterok):
result = {}
for i in ID_Masterok:
if ID_Master[i] in result:
if isinstance(result[ID_Master[i]],list):
result[ID_Master[i]].append(i)
else:
result[ID_Master[i]] = [result[ID_Master[i]],i]
else:
result[ID_Master[i]] = i
return result
>>> from urllib.parse import urlparse
>>> u = urlparse("postgres://admin:oocooSh7@postgres.host:5432/my_db")
>>> u.password
'oocooSh7'
>>> u.username
'admin'
>>> u.hostname
'postgres.host'
>>> u.port
5432
>>> u.path
'/my_db'
>>> us = urlparse("sqlite:///C:/Users/admin/site_db.sqlite3")
>>> us.path
'/C:/Users/admin/site_db.sqlite3'
>>> us.scheme
'sqlite'
>>>