question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bot not starting up due to "[ERROR]: 'type' is specified more than once"

See original GitHub issue

Describe the bug So, i’ve created my own bot with Discordeno based from the template you have provided and customised it with my own liking. I’ve installed the newly released latest Deno Version, TypeScript and Discordeno version. However, when booting up the bot with the deno run --allow-read --unstable mod.ts or without the --unstable. I have ran into an error which resulted in:

ntmnathan:DenoBot ntmnathan$ deno run --allow-net --allow-read --unstable mod.ts
Compile file:///Users/ntmnathan/Documents/DenoBot/mod.ts
error: TS2783 [ERROR]: 'type' is specified more than once, so this usage will be overwritten.
          type: options.type ? ChannelTypes[options.type] : undefined,
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/Skillz4Killz/Discordeno/v1/structures/guild.ts:85:11

    This spread always overwrites this property.
              ...options,
              ~~~~~~~~~~
        at https://raw.githubusercontent.com/Skillz4Killz/Discordeno/v1/structures/guild.ts:93:11

I am not 100% sure if this is on my end or Discordeno’s. Any help appreciated.

To Reproduce Steps to reproduce the behaviour:

  1. Execute deno run --allow-net --allow-read --unstable mod.ts
  2. Error above will be produced

Expected behaviour If the deno command above is executed in the bash console, it should make the bot authenticate with the API and go online.

Resources If you want me to add screenshots/code. Let me know, but its similar to Discordeno example.

Additional context None.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Skillz4Killzcommented, May 15, 2020
  • Whats the correct way to define the Avatar for an Author (me) or another user with image size, format, dynamic image etc.?

@NTMNathan There was a small / typo in the avatarURL value but that is now fixed if you do deno cache --reload mod.ts it should fix itself.

user.avatarURL() => Default settings user.avatarURL(2048) => Default image format with size of 2048 user.avatarURL(2048, 'jpg') => JPG image format with size of 2048

  • How would I work out mentions? (E.g. Mention user for hug command)

Discordeno provides you a message.mentions property which has all User objects for any users that were mentioned. So if for example you wanted to do a hug command you could do

const user = message.mentions.length ? message.mentions[0] : message.author

This would use the first mentioned user or if none were provided it would use the message author itself.

As an example, I just pushed a simple avatar command showing both these in action: https://github.com/Skillz4Killz/Discordeno-bot-template/blob/master/src/commands/avatar.ts image

image

Note: i am going to close this issue as the bug related to this issue has been closed, if you have any more questions or bugs feel free to open as many issues as you like

0reactions
NTMNathancommented, May 15, 2020

Sure, as of now, the bot started and commands work as expected.

Also I am having some problems (still learning as im new to Discordeno) with getting the Author/OtherUser Avatar URL and mentions:

  • Whats the correct way to define the Avatar for an Author (me) or another user with image size, format, dynamic image etc.?
  • How would I work out mentions? (E.g. Mention user for hug command)

Thanks again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord Bot won't start due to logic error
I'm making this bot (i'm fairly new to javascript) and for no reason, it doesn't say anything after i type node . and...
Read more >
Unable to execute because the specified command or file ...
When I run the Echo Bot example I get this error message : Unable to execute because the specified command or file could...
Read more >
Errors | discord.js Guide
This error is caused by spawning a large number of event listeners, usually for the client. The most common cause of this is...
Read more >
Troubleshoot bot configuration issues - Bot Service
In this article. A bot can generate different types of errors, such as not being able to respond, throwing errors, or working in...
Read more >
Managing Messages - Amazon Lex
You configure bot-level messages in the Error Handling section of the Amazon Lex ... If there is more than one message of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found