{"size": 593, "ext": "js", "max_stars_repo_path": "src/commands/owner/setusername.js", "max_stars_repo_name": "im-mortal/Discord.RSS", "max_stars_repo_stars_event_min_datetime": "2017-01-11T10:38:32.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-20T08:01:40.000Z", "max_issues_repo_path": "src/commands/owner/setusername.js", "max_issues_repo_name": "im-mortal/Discord.RSS", "max_issues_repo_issues_event_min_datetime": "2017-03-03T17:05:49.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-20T23:23:17.000Z", "max_forks_repo_path": "src/commands/owner/setusername.js", "max_forks_repo_name": "im-mortal/Discord.RSS", "max_forks_repo_forks_event_min_datetime": "2017-02-28T21:02:19.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-14T12:47:36.000Z"}
{"max_stars_count": 444, "max_issues_count": 156, "max_forks_count": 294, "avg_line_length": 37.0625, "max_line_length": 96, "alphanum_fraction": 0.7015177066}
const createLogger = require('../../util/logger/create.js')

module.exports = async (message) => {
  const content = message.content.split(' ')
  if (content.length === 1) return
  content.shift()
  const username = content.join(' ')
  const original = message.client.user.username
  const u = await message.client.user.setUsername(username)
  const log = createLogger(message.guild.shard.id)
  log.owner({
    user: message.author
  }, `Bot usename changed from ${original} to ${u.username}`)
  await message.channel.send(`Bot username has been changed from ${original} to ${u.username}.`)
}
